Repository navigation
PyArrow: Keep the row count when a scan selects no columns - #4161
vibhuthespeedst wants to merge 3 commits into
Conversation
Closes apache#4137 Generated-by: AI assistant
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that's incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
|
Still relevant, both new tests still fail on current main (7864d4c) without this change. @kevinjqliu could you take a look when you have time? |
Fokko
left a comment
There was a problem hiding this comment.
Nice one @vibhuthespeedst 🙌
|
Thanks for the review @Fokko! |
|
I renamed arrow_schema in to_table, which caused the merge queue to fail. I’ve merged the latest changes from main and fixed the issue. @Fokko Could you please add it to the merge queue again? |
Closes #4137
Rationale for this change
table.scan(selected_fields=()).to_arrow()returned 0 rows instead of the row count with no columns. Two places lost the rows:_to_requested_schemabuilds the struct from zero fields, which has length 0, andArrowScan.to_tableusespa.concat_tables, which drops the rows of tables without columns.Are these changes tested?
Yes, two tests in
tests/io/test_pyarrow.py, with and without a row filter. Both fail without the fix.Are there any user-facing changes?
Scans that select no columns now return the right number of rows.
Generated-by: AI assistant