Skip to content

Commit 32fbcda

Browse files
committed
[Python][Tests] Verify projected path-based ORC filters without filter column in output
1 parent 11e120e commit 32fbcda

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

python/pyarrow/tests/test_orc.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,21 @@ def test_read_table_filters_buffer_reader_fallback_empty_projection():
840840
assert result.num_columns == 0
841841

842842

843+
def test_read_table_filters_projection_without_filter_column(tempdir):
844+
"""Path-like reads should filter using hidden columns and project output."""
845+
from pyarrow import orc
846+
import pyarrow.dataset as ds
847+
848+
path = str(tempdir / 'projection_filter.orc')
849+
table = pa.table({'id': range(10), 'value': range(10, 20)})
850+
orc.write_table(table, path)
851+
852+
result = orc.read_table(path, columns=['value'], filters=ds.field('id') > 5)
853+
assert result.num_rows == 4
854+
assert result.column_names == ['value']
855+
assert result['value'].to_pylist() == [16, 17, 18, 19]
856+
857+
843858
def test_parquet_orc_predicate_pushdown_parity(tempdir):
844859
"""Equivalent ORC and Parquet predicates should produce equal results."""
845860
from pyarrow import orc

0 commit comments

Comments
 (0)