advancedxy commented on code in PR #956:
URL: https://github.com/apache/iceberg-cpp/pull/956#discussion_r4244347966
##########
src/iceberg/parquet/parquet_reader.cc:
##########
@@ -387,39 +406,58 @@ class ParquetReader::Impl {
}
private:
+ Status OpenNextRowGroupRange() {
+ const size_t begin = context_->next_row_group_;
+ size_t end = begin + 1;
+ std::vector<int> row_groups{context_->row_groups_[begin].index};
+ // Share a reader across adjacent row groups so Arrow can coalesce
pre-buffered
+ // reads. Stop at gaps to keep physical row positions contiguous within
batches.
+ while (end < context_->row_groups_.size() &&
+ context_->row_groups_[end].index == context_->row_groups_[end -
1].index + 1) {
+ row_groups.push_back(context_->row_groups_[end].index);
+ ++end;
+ }
+ ICEBERG_ARROW_ASSIGN_OR_RETURN(
+ context_->record_batch_reader_,
+ reader_->GetRecordBatchReader(row_groups,
SelectedColumnIndices(projection_)));
+ context_->next_row_group_ = end;
+ metadata_context_.next_file_pos = context_->row_groups_[begin].first_row;
Review Comment:
Let me see if whether we can add the support in iceberg-cpp first, then we
can contribute back to arrow c++.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]