Skip to content

Commit

Permalink
Update cpp/src/parquet/file_reader.cc
Browse files Browse the repository at this point in the history
replace mutable_data() with data() when checking bitmap in Buffer

Co-authored-by: Gang Wu <ustcwg@gmail.com>
  • Loading branch information
2 people authored and jp0317 committed Jul 19, 2023
1 parent 04adeb2 commit 8c1482b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cpp/src/parquet/file_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class SerializedRowGroup : public RowGroupReader::Contents {
ComputeColumnChunkRange(file_metadata_, source_size_, row_group_ordinal_, i);
std::shared_ptr<ArrowInputStream> stream;
if (cached_source_ && prebuffered_column_chunks_bitmap_ != nullptr &&
::arrow::bit_util::GetBit(prebuffered_column_chunks_bitmap_->mutable_data(), i)) {
::arrow::bit_util::GetBit(prebuffered_column_chunks_bitmap_->data(), i)) {
// PARQUET-1698: if read coalescing is enabled, read from pre-buffered
// segments.
PARQUET_ASSIGN_OR_THROW(auto buffer, cached_source_->Read(col_range));
Expand Down Expand Up @@ -370,8 +370,7 @@ class SerializedFile : public ParquetFileReader::Contents {
std::shared_ptr<Buffer>& col_bitmap = prebuffered_column_chunks_[row];
int num_cols = file_metadata_->num_columns();
PARQUET_THROW_NOT_OK(
AllocateBitmap(num_cols, properties_.memory_pool()).Value(&col_bitmap));
memset(col_bitmap->mutable_data(), 0, col_bitmap->size());
AllocateEmptyBitmap(num_cols, properties_.memory_pool()).Value(&col_bitmap));
for (int col : column_indices) {
::arrow::bit_util::SetBit(col_bitmap->mutable_data(), col);
ranges.push_back(
Expand Down

0 comments on commit 8c1482b

Please sign in to comment.