@@ -164,14 +164,15 @@ void FileReaderWrapper::AdvanceToNextRowGroup() {
164164 current_row_group_idx_++;
165165 // Skip row groups excluded by read range.
166166 while (current_row_group_idx_ < target_row_groups_.size () &&
167- target_row_groups_[current_row_group_idx_].excluded_by_read_range ) {
167+ target_row_groups_[current_row_group_idx_].IsExcludedByReadRange () ) {
168168 current_row_group_idx_++;
169169 }
170170 if (current_row_group_idx_ >= target_row_groups_.size ()) {
171171 next_row_to_read_ = num_rows_;
172172 } else {
173173 next_row_to_read_ =
174- all_row_group_ranges_[target_row_groups_[current_row_group_idx_].row_group_index ].first ;
174+ all_row_group_ranges_[target_row_groups_[current_row_group_idx_].GetRowGroupIndex ()]
175+ .first ;
175176 }
176177}
177178
@@ -181,10 +182,10 @@ Status FileReaderWrapper::SeekToRow(uint64_t row_number) {
181182 filtered_global_offset_ = 0 ;
182183
183184 for (uint64_t i = 0 ; i < target_row_groups_.size (); i++) {
184- if (target_row_groups_[i].excluded_by_read_range ) {
185+ if (target_row_groups_[i].IsExcludedByReadRange () ) {
185186 continue ;
186187 }
187- int32_t rg_id = target_row_groups_[i].row_group_index ;
188+ int32_t rg_id = target_row_groups_[i].GetRowGroupIndex () ;
188189 uint64_t rg_start = all_row_group_ranges_[rg_id].first ;
189190 uint64_t rg_end = all_row_group_ranges_[rg_id].second ;
190191 if (row_number > rg_start && row_number < rg_end) {
@@ -200,9 +201,9 @@ Status FileReaderWrapper::SeekToRow(uint64_t row_number) {
200201 // Rebuild batch_reader_ for non-page-filtered RGs at/after seek position.
201202 std::vector<int32_t > fully_matched_indices;
202203 for (uint64_t j = i; j < target_row_groups_.size (); j++) {
203- if (!target_row_groups_[j].excluded_by_read_range &&
204- !target_row_groups_[j].is_partially_matched ) {
205- fully_matched_indices.push_back (target_row_groups_[j].row_group_index );
204+ if (!target_row_groups_[j].IsExcludedByReadRange () &&
205+ !target_row_groups_[j].IsPartiallyMatched () ) {
206+ fully_matched_indices.push_back (target_row_groups_[j].GetRowGroupIndex () );
206207 }
207208 }
208209 if (!fully_matched_indices.empty ()) {
@@ -222,7 +223,7 @@ Status FileReaderWrapper::SeekToRow(uint64_t row_number) {
222223}
223224
224225Result<std::shared_ptr<arrow::RecordBatch>> FileReaderWrapper::NextPageFiltered () {
225- int32_t rg_id = target_row_groups_[current_row_group_idx_].row_group_index ;
226+ int32_t rg_id = target_row_groups_[current_row_group_idx_].GetRowGroupIndex () ;
226227
227228 // Construct the per-RG streaming reader on demand.
228229 if (!current_page_filtered_reader_) {
@@ -237,7 +238,7 @@ Result<std::shared_ptr<arrow::RecordBatch>> FileReaderWrapper::NextPageFiltered(
237238 file_reader_->parquet_reader (), target_rg, target_column_indices_,
238239 page_filtered_read_schema_, file_reader_->properties ().cache_options (),
239240 pre_buffered, page_ranges, max_chunksize, pool_));
240- current_filtered_row_ranges_ = target_rg.row_ranges ;
241+ current_filtered_row_ranges_ = target_rg.GetRowRanges () ;
241242 current_filtered_rg_start_ = all_row_group_ranges_[rg_id].first ;
242243 filtered_global_offset_ = 0 ;
243244 }
@@ -273,7 +274,7 @@ Result<std::shared_ptr<arrow::RecordBatch>> FileReaderWrapper::NextFullyMatched(
273274 return std::shared_ptr<arrow::RecordBatch>();
274275 }
275276
276- int32_t rg_id = target_row_groups_[current_row_group_idx_].row_group_index ;
277+ int32_t rg_id = target_row_groups_[current_row_group_idx_].GetRowGroupIndex () ;
277278 uint64_t rg_end = all_row_group_ranges_[rg_id].second ;
278279 int64_t num_rows = record_batch->num_rows ();
279280
@@ -298,7 +299,7 @@ Result<std::shared_ptr<arrow::RecordBatch>> FileReaderWrapper::Next() {
298299
299300 while (current_row_group_idx_ < target_row_groups_.size ()) {
300301 bool is_partially_matched =
301- target_row_groups_[current_row_group_idx_].is_partially_matched ;
302+ target_row_groups_[current_row_group_idx_].IsPartiallyMatched () ;
302303 PAIMON_ASSIGN_OR_RAISE (std::shared_ptr<arrow::RecordBatch> batch,
303304 is_partially_matched ? NextPageFiltered () : NextFullyMatched ());
304305 if (batch) {
@@ -368,17 +369,17 @@ std::vector<::arrow::io::ReadRange> FileReaderWrapper::CollectPreBufferRanges(
368369 auto file_metadata = file_reader_->parquet_reader ()->metadata ();
369370
370371 for (const auto & trg : target_row_groups_) {
371- if (trg.excluded_by_read_range ) continue ;
372+ if (trg.IsExcludedByReadRange () ) continue ;
372373
373- if (trg.is_partially_matched ) {
374+ if (trg.IsPartiallyMatched () ) {
374375 // Page-filtered RGs: only matching page byte ranges.
375376 auto page_ranges = PageFilteredRowGroupReader::ComputePageRanges (
376377 file_reader_->parquet_reader (), trg, column_indices);
377378 ranges.insert (ranges.end (), std::make_move_iterator (page_ranges.begin ()),
378379 std::make_move_iterator (page_ranges.end ()));
379380 } else {
380381 // Fully-matched RGs: entire column chunk ranges.
381- auto rg_metadata = file_metadata->RowGroup (trg.row_group_index );
382+ auto rg_metadata = file_metadata->RowGroup (trg.GetRowGroupIndex () );
382383 for (int32_t col_idx : column_indices) {
383384 auto col_chunk = rg_metadata->ColumnChunk (col_idx);
384385 int64_t offset = col_chunk->data_page_offset ();
@@ -416,12 +417,12 @@ Status FileReaderWrapper::PrepareForReading(const std::vector<TargetRowGroup>& t
416417 std::vector<int32_t > fully_matched_row_groups;
417418 uint64_t active_count = 0 ;
418419 for (const auto & trg : target_row_groups_) {
419- if (trg.excluded_by_read_range ) {
420+ if (trg.IsExcludedByReadRange () ) {
420421 continue ;
421422 }
422423 active_count++;
423- if (!trg.is_partially_matched ) {
424- fully_matched_row_groups.push_back (trg.row_group_index );
424+ if (!trg.IsPartiallyMatched () ) {
425+ fully_matched_row_groups.push_back (trg.GetRowGroupIndex () );
425426 }
426427 }
427428
@@ -455,14 +456,15 @@ Status FileReaderWrapper::PrepareForReading(const std::vector<TargetRowGroup>& t
455456 // Reset read state. Find the first non-excluded row group.
456457 uint64_t first_active_idx = 0 ;
457458 while (first_active_idx < target_row_groups_.size () &&
458- target_row_groups_[first_active_idx].excluded_by_read_range ) {
459+ target_row_groups_[first_active_idx].IsExcludedByReadRange () ) {
459460 first_active_idx++;
460461 }
461462 if (first_active_idx >= target_row_groups_.size ()) {
462463 next_row_to_read_ = num_rows_;
463464 } else {
464465 next_row_to_read_ =
465- all_row_group_ranges_[target_row_groups_[first_active_idx].row_group_index ].first ;
466+ all_row_group_ranges_[target_row_groups_[first_active_idx].GetRowGroupIndex ()]
467+ .first ;
466468 }
467469 previous_first_row_ = std::numeric_limits<uint64_t >::max ();
468470 current_row_group_idx_ = first_active_idx;
@@ -476,7 +478,7 @@ Status FileReaderWrapper::ApplyReadRanges(
476478 const std::vector<std::pair<uint64_t , uint64_t >>& read_ranges) {
477479 if (read_ranges.empty ()) {
478480 for (auto & trg : target_row_groups_) {
479- trg.excluded_by_read_range = true ;
481+ trg.SetExcludedByReadRange ( true ) ;
480482 }
481483 reader_initialized_ = false ;
482484 return Status::OK ();
@@ -492,7 +494,7 @@ Status FileReaderWrapper::ApplyReadRanges(
492494 }
493495 // Mark each target row group as excluded or not based on the matching set.
494496 for (auto & trg : target_row_groups_) {
495- trg.excluded_by_read_range = matching_rg_indices.count (trg.row_group_index ) == 0 ;
497+ trg.SetExcludedByReadRange ( matching_rg_indices.count (trg.GetRowGroupIndex ()) == 0 ) ;
496498 }
497499 reader_initialized_ = false ;
498500 return Status::OK ();
0 commit comments