Skip to content

[C++][Parquet] OpenTelemetry possibly reporting wrong column in ColumnReaderImpl::ReadColumn #51370

Description

@EnricoMi

Describe the bug, including details regarding any error messages, version, and platform.

ColumnReaderImpl::ReadColumn reports information on the column being read in

#ifdef ARROW_WITH_OPENTELEMETRY
std::string column_name = reader_->metadata()->schema()->Column(i)->name();
std::string phys_type =
TypeToString(reader_->metadata()->schema()->Column(i)->physical_type());
::arrow::util::tracing::Span span;
START_SPAN(span, "parquet::arrow::read_column",
{{"parquet.arrow.columnindex", i},
{"parquet.arrow.columnname", column_name},
{"parquet.arrow.physicaltype", phys_type},
{"parquet.arrow.records_to_read", records_to_read}});
#endif

However, FileReaderImpl::DecodeRowGroups uses column index i that refers to the reader index, not the column index:

RETURN_NOT_OK(ReadColumn(static_cast<int>(i), row_groups, reader.get(), &column));

So the reported column information is wrong when only a subset of columns is read, or when nested schemas exist.

Could use manifest_.GetFieldIndices(column_indices)[i], but that does not work with nested schemas. Cannot use column_indices[i] here, as it does not align with reader indices either.

Note: Use of i earlier in this method is fixed in #51362:

records_to_read +=
reader_->metadata()->RowGroup(row_group)->ColumnChunk(i)->num_values();

Component(s)

C++

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions