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

Method LeafReader

cpp/src/parquet/arrow/reader.cc:455–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453class LeafReader : public ColumnReaderImpl {
454 public:
455 LeafReader(std::shared_ptr<ReaderContext> ctx, std::shared_ptr<Field> field,
456 std::unique_ptr<FileColumnIterator> input,
457 ::parquet::internal::LevelInfo leaf_info)
458 : ctx_(std::move(ctx)),
459 field_(std::move(field)),
460 input_(std::move(input)),
461 descr_(input_->descr()) {
462 const auto type_id = field_->type()->id();
463 // If binary-like, RecordReader is able to read directly as the concrete type
464 // so as to avoid offset limitations.
465 std::shared_ptr<DataType> type_for_reading =
466 (::arrow::is_base_binary_like(type_id) || ::arrow::is_binary_view_like(type_id))
467 ? field_->type()
468 : nullptr;
469 record_reader_ = RecordReader::Make(
470 descr_, leaf_info, ctx_->pool,
471 /*read_dictionary=*/field_->type()->id() == ::arrow::Type::DICTIONARY,
472 /*read_dense_for_nullable=*/false, /*arrow_type=*/type_for_reading);
473 NextRowGroup();
474 }
475
476 Status GetDefLevels(const int16_t** data, int64_t* length) final {
477 *data = record_reader_->def_levels();

Callers

nothing calls this directly

Calls 6

is_base_binary_likeFunction · 0.85
is_binary_view_likeFunction · 0.85
MakeFunction · 0.50
descrMethod · 0.45
idMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected