Skip to content

Commit

Permalink
Add comment for stride
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou authored May 13, 2024
1 parent 1415a54 commit 5014aeb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cpp/src/parquet/column_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,9 @@ class TypedRecordReader : public TypedColumnReaderImpl<DType>,
ARROW_DCHECK(!at_record_start_);
// Scan repetition levels to find record end
while (levels_position_ < levels_written_) {
// We use an estimated batch size to simplify branching and
// improve performance in the common case. This might slow
// things down a bit if a single long record remains, though.
int64_t stride =
std::min(levels_written_ - levels_position_, num_records - records_read);
const int64_t position_end = levels_position_ + stride;
Expand Down

0 comments on commit 5014aeb

Please sign in to comment.