chrisvittal opened a new issue, #55682:
URL: https://github.com/apache/arrow/issues/55682
### Describe the bug, including details regarding any error messages,
version, and platform.
This is kind of a follow on from #35692. Which fixed the nullable
fixed-length list case.
Python reproducer:
```python
import io
import pyarrow as pa, pyarrow.parquet as pq
t = pa.struct([pa.field('shape', pa.list_(pa.field('element', pa.int32(),
False), 2), False)])
schema = pa.schema([pa.field('x', t, True)])
tbl = pa.Table.from_pylist([{'x': {'shape': [1, 2]}}, {'x': None}, {'x':
{'shape': [3, 4]}}], schema=schema)
buf = io.BytesIO()
pq.write_table(tbl, buf, store_schema=True)
pq.read_table(io.BytesIO(buf.getvalue()))
```
Error message:
```
Traceback (most recent call last):
File "<stdin>", line 8, in <module>
File
"<REDACTED>/.venv/lib/python3.14/site-packages/pyarrow/parquet/core.py", line
1985, in read_table
return dataset.read(columns=columns, use_threads=use_threads,
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
use_pandas_metadata=use_pandas_metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"<REDACTED>/.venv/lib/python3.14/site-packages/pyarrow/parquet/core.py", line
1606, in read
table = self._dataset.to_table(
columns=columns, filter=self._filter_expression,
use_threads=use_threads
)
File "pyarrow/_dataset.pyx", line 589, in pyarrow._dataset.Dataset.to_table
File "pyarrow/_dataset.pyx", line 3981, in
pyarrow._dataset.Scanner.to_table
return pyarrow_wrap_table(GetResultValue(result))
File "pyarrow/error.pxi", line 155, in
pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status
raise convert_status(status)
pyarrow.lib.ArrowInvalid: Expected all lists to be of size=2 but index 2 had
size=0
```
## Probable cause
I examined the reader code and in
[`FixedSizedListReader::AssembleArray`](https://github.com/apache/arrow/blob/ac7d3fabaa089001627b32cb6f33789e0919d4df/cpp/src/parquet/arrow/reader.cc#L766),
the reader pads nulls only when `data->GetNullCount() != 0`, but that only
works when there is a validity bitmap for the item itself, not when an ancestor
is null.
This is with version 26.0.0.
### Component(s)
C++
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]