Skip to content

[python] Fall back to row filtering for large system table predicates. - #11628

Open
fengruotj wants to merge 1 commit into
apache:masterfrom
fengruotj:fix/fallback-row-filter
Open

fengruotj wants to merge 1 commit into
apache:masterfrom
fengruotj:fix/fallback-row-filter

Conversation

@fengruotj

@fengruotj fengruotj commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Closes #11626

PyPaimon raises NotImplementedError when a system-table filter exceeds the 256-leaf limit for Arrow expressions. For example, a query on $options with 256 equality conditions joined by OR returns ['file.format']. Adding one more condition for a missing key causes to_arrow() to fail.

This PR routes oversized predicate trees through the system-table reader’s existing row filter. The reader validates the predicate, evaluates it before projection, and applies the global limit across splits. Eligible predicates with up to 256 leaves continue to use Arrow.

Tests

Added regression tests for AND and OR predicates with 256, 257, and 1,024 leaves. They verify that 256 equality conditions use Arrow and that larger trees return the expected rows through row filtering. Additional cases cover nested predicates, NULL comparisons, filtering on columns omitted from the projection, and a global limit across two splits.

  • The $options reproducer now returns ['file.format'] with both 256 and 257 conditions.
  • Python 3.13.2 / PyArrow 22.0.0: 284 system-table tests passed, 6 skipped.
  • Python 3.6.15 / PyArrow 6.0.1: 226 passed, 6 skipped, 58 failed. Of those failures, 56 also occurred on the parent commit. The two additional failures are new tests that exercise the existing Table.filter(Expression) incompatibility at 256 leaves.

@fengruotj
fengruotj force-pushed the fix/fallback-row-filter branch from 3616b06 to fe7ca69 Compare December 2, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] PyPaimon rejects system-table predicates with more than 256 leaves.

1 participant