| 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, |
nothing calls this directly
no test coverage detected