| 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) { |