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

Method PreBuffer

cpp/src/parquet/file_reader.cc:377–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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