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

Method ReadColumn

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

Source from the content-addressed store, hash-verified

271 }
272
273 Status ReadColumn(int field_index, const std::vector<int>& row_groups,
274 ColumnReader* reader, std::shared_ptr<ChunkedArray>* out) {
275 BEGIN_PARQUET_CATCH_EXCEPTIONS
276 // NextBatch()'s size is a number of records (rows), not leaf values, so use the
277 // row group's own row count directly rather than some column's num_values().
278 int64_t records_to_read = 0;
279 for (auto row_group : row_groups) {
280 records_to_read += reader_->metadata()->RowGroup(row_group)->num_rows();
281 }
282#ifdef ARROW_WITH_OPENTELEMETRY
283 const auto& schema_field = manifest_.schema_fields[field_index];
284 const std::string& field_name = schema_field.field->name();
285 std::string phys_type;
286 if (schema_field.is_leaf()) {
287 phys_type = TypeToString(reader_->metadata()
288 ->schema()
289 ->Column(schema_field.column_index)
290 ->physical_type());
291 }
292 ::arrow::util::tracing::Span span;
293 START_SPAN(span, "parquet::arrow::read_column",
294 {{"parquet.arrow.columnindex", field_index},
295 {"parquet.arrow.columnname", field_name},
296 {"parquet.arrow.physicaltype", phys_type},
297 {"parquet.arrow.records_to_read", records_to_read}});
298#endif
299 return reader->NextBatch(records_to_read, out);
300 END_PARQUET_CATCH_EXCEPTIONS
301 }
302
303 Status ReadColumn(int field_index, const std::vector<int>& row_groups,
304 std::shared_ptr<ChunkedArray>* out) {

Callers 6

ReadMethod · 0.45
TESTFunction · 0.45
StatisticsReadArrayFunction · 0.45
read_single_columnFunction · 0.45

Calls 13

TypeToStringFunction · 0.85
IotaFunction · 0.85
physical_typeMethod · 0.80
NextBatchMethod · 0.80
GetColumnFunction · 0.50
num_rowsMethod · 0.45
RowGroupMethod · 0.45
metadataMethod · 0.45
nameMethod · 0.45
ColumnMethod · 0.45
schemaMethod · 0.45
getMethod · 0.45

Tested by 2

TESTFunction · 0.36
StatisticsReadArrayFunction · 0.36