jiangxt2 opened a new issue, #55773:
URL: https://github.com/apache/arrow/issues/55773
Reading a nonempty ORC file with an empty column projection returns zero
rows from `ORCFile.read()` and `ORCFile.read_stripe()`. The projection should
contain no columns while retaining the number of rows.
```python
import pyarrow as pa
import pyarrow.orc as orc
sink = pa.BufferOutputStream()
orc.write_table(pa.table({"value": [1, 2, 3]}), sink)
reader = orc.ORCFile(sink.getvalue())
print(reader.read(columns=[]).num_rows)
print(reader.read_stripe(0, columns=[]).num_rows)
```
Both calls return `0`; the expected row count is `3`.
`ORCFile.iter_batches(columns=[])` preserves row counts.
The issue was discussed in [PR
#54926](https://github.com/apache/arrow/pull/54926#discussion_r4631862211).
Reproduced with a local PyArrow 27 development build and ORC 2.2.1 on macOS
arm64.
**Components:** C++, Python
--
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]