You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python][Parquet] ParquetFile projection includes extra column when dotted field name matches nested path #52997
Describe the bug, including details regarding any error messages, version, and platform.
Describe the bug
pyarrow.parquet.ParquetFile.read() returns an unexpected extra column when a literal top-level column name contains a dot and collides with a nested field path.
For example, a Parquet file contains two distinct fields:
a.b: a literal top-level column.
a: a struct containing nested field b.
When requesting columns=["a.b"], ParquetFile.read() returns botha.b and a, whereas pq.read_table() returns only a.b.
I independently reproduced this in Kaggle using PyArrow 26.0.0. The behavior was also observed locally with PyArrow 16.1.0 and 24.0.0.
Column projection should have a clear and consistent interpretation across the Parquet reading APIs.
Preferably, specifying columns=["a.b"] should select the exact top-level column named a.b when it exists, without unexpectedly including the unrelated top-level struct a.
Alternatively, if this name is considered ambiguous, a clear error or an explicit path-selection mechanism may be more appropriate.
I would appreciate maintainer guidance on the intended precedence.
Possible root cause
In python/pyarrow/parquet/core.py, _build_nested_paths() constructs lookup keys by joining path components with ".".
This makes the following distinct physical paths indistinguishable as strings:
["a.b"] -> "a.b"
["a", "b"] -> "a.b"
Consequently, _get_column_indices() can select both physical columns for a single requested name.
Impact
This may cause unexpected output schemas, unnecessary Parquet column reads, additional memory usage, or downstream failures in applications that use dotted column names alongside nested structures.
Environment
PyArrow: 26.0.0
Platform: Kaggle notebook (Linux)
Reproduction: In-memory Parquet buffer; no external files or datasets required.
I can prepare a focused regression test and fix once the expected ambiguity-resolution behavior is clarified.
The investigation and initial report drafting were AI-assisted; I independently executed and reviewed the reproduction.
Root cause:ParquetFile._build_nested_paths() creates identical lookup keys for a literal top-level field a.b and a nested path a → b, causing column projection to select both fields unexpectedly.
Proposed fix:
Give exact top-level column names precedence over ambiguous dotted nested paths.
Preserve normal nested-field selection when no exact top-level match exists.
Activity
Mohit-25-tech commentedon Oct 10, 2026
Hi maintainers,
I've prepared a focused PR addressing this issue.
Root cause:
ParquetFile._build_nested_paths()creates identical lookup keys for a literal top-level fielda.band a nested patha → b, causing column projection to select both fields unexpectedly.Proposed fix:
read(),read_row_group(),iter_batches(), deeper nested paths, duplicate selections, and pandas metadata.Validation:
git diff --checkpassed.PR: #53010
The precedence change is intentional, and I'd appreciate feedback on whether this is the preferred API behavior.
Thanks for your time and review!