| 268 | } |
| 269 | |
| 270 | Status ReadColumn(int i, const std::vector<int>& row_groups, ColumnReader* reader, |
| 271 | std::shared_ptr<ChunkedArray>* out) { |
| 272 | BEGIN_PARQUET_CATCH_EXCEPTIONS |
| 273 | // TODO(wesm): This calculation doesn't make much sense when we have repeated |
| 274 | // schema nodes |
| 275 | int64_t records_to_read = 0; |
| 276 | for (auto row_group : row_groups) { |
| 277 | // Can throw exception |
| 278 | records_to_read += |
| 279 | reader_->metadata()->RowGroup(row_group)->ColumnChunk(i)->num_values(); |
| 280 | } |
| 281 | #ifdef ARROW_WITH_OPENTELEMETRY |
| 282 | std::string column_name = reader_->metadata()->schema()->Column(i)->name(); |
| 283 | std::string phys_type = |
| 284 | TypeToString(reader_->metadata()->schema()->Column(i)->physical_type()); |
| 285 | ::arrow::util::tracing::Span span; |
| 286 | START_SPAN(span, "parquet::arrow::read_column", |
| 287 | {{"parquet.arrow.columnindex", i}, |
| 288 | {"parquet.arrow.columnname", column_name}, |
| 289 | {"parquet.arrow.physicaltype", phys_type}, |
| 290 | {"parquet.arrow.records_to_read", records_to_read}}); |
| 291 | #endif |
| 292 | return reader->NextBatch(records_to_read, out); |
| 293 | END_PARQUET_CATCH_EXCEPTIONS |
| 294 | } |
| 295 | |
| 296 | Status ReadColumn(int i, const std::vector<int>& row_groups, |
| 297 | std::shared_ptr<ChunkedArray>* out) { |