MCPcopy Create free account
hub / github.com/apache/arrow / PreBuffer

Method PreBuffer

cpp/src/parquet/file_reader.cc:378–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376 }
377
378 void PreBuffer(const std::vector<int>& row_groups,
379 const std::vector<int>& column_indices,
380 const ::arrow::io::IOContext& ctx,
381 const ::arrow::io::CacheOptions& options) {
382 cached_source_ =
383 std::make_shared<::arrow::io::internal::ReadRangeCache>(source_, ctx, options);
384 std::vector<::arrow::io::ReadRange> ranges;
385 prebuffered_column_chunks_.clear();
386 int num_cols = file_metadata_->num_columns();
387 // a bitmap for buffered columns.
388 std::shared_ptr<Buffer> buffer_columns;
389 if (!row_groups.empty()) {
390 PARQUET_THROW_NOT_OK(AllocateEmptyBitmap(num_cols, properties_.memory_pool())
391 .Value(&buffer_columns));
392 for (int col : column_indices) {
393 ::arrow::bit_util::SetBit(buffer_columns->mutable_data(), col);
394 }
395 }
396 for (int row : row_groups) {
397 prebuffered_column_chunks_[row] = buffer_columns;
398 for (int col : column_indices) {
399 ranges.push_back(
400 ComputeColumnChunkRange(file_metadata_.get(), source_size_, row, col));
401 }
402 }
403 PARQUET_THROW_NOT_OK(cached_source_->Cache(ranges));
404 }
405
406 Result<std::vector<::arrow::io::ReadRange>> GetReadRanges(
407 const std::vector<int>& row_groups, const std::vector<int>& column_indices,

Callers

nothing calls this directly

Calls 12

AllocateEmptyBitmapFunction · 0.85
SetBitFunction · 0.85
ComputeColumnChunkRangeFunction · 0.85
push_backMethod · 0.80
clearMethod · 0.45
num_columnsMethod · 0.45
emptyMethod · 0.45
ValueMethod · 0.45
memory_poolMethod · 0.45
mutable_dataMethod · 0.45
getMethod · 0.45
CacheMethod · 0.45

Tested by

no test coverage detected