Repository navigation
fix!: preserve mandatory read and post-join filters - #1260
Conversation
021e0c4 to
65eea25
Compare
|
Heads-up on an overlap: The two compose: the filter stays on the scan, the mask goes above it, the emit mapping above that -- a filter is read against the direct schema, before the projection (spec v0.102.0, Read Filtering). Whichever of us lands second rebases, and I am glad to be that one. |
65eea25 to
30da2f0
Compare
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (11)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
nielspardon
left a comment
There was a problem hiding this comment.
Please mark this breaking (fix!: plus a BREAKING CHANGE: footer). Decoding post_join_filter against the join output changes what field indices in existing plans mean: a LEFT_SEMI filter that references a right column now fails to decode, and an outer-join reference changes nullability. The direct-output rule came in spec v0.91.0, so the body can cite that instead of v0.102.0.
|
Thanks for flagging the projection overlap and the compatibility impact. I prepared a candidate on current main that applies read filters before projection and emit, including named scans and both virtual-table forms. The combined regressions and full build pass locally. I also drafted a breaking-change title and footer, with the direct-output semantics attributed to spec v0.91.0. The code and description updates have not been published yet. |
Apply mandatory read predicates before projection and emit, and post-join predicates after join output formation. Decode logical, lateral, hash, and merge post-join references against their direct output schemas. BREAKING CHANGE: Calcite and Spark now enforce embedded mandatory filters. Post-join field references use direct join output before emit instead of concatenated inputs. Regenerate plans that reference removed semi/anti columns or use concatenated-input indices for right-oriented joins; outer-join references now preserve nullable output types.
30da2f0 to
0f9253b
Compare
|
Refreshed against main, keeping read filters before projection and emit. Lateral, hash, and merge post-join filters now use the direct output schema as well. I also updated the compatibility note and the spec reference. |
nielspardon
left a comment
There was a problem hiding this comment.
Thanks, both are fixed. The rest is small and nothing here blocks.
|
Updated these too. The round-trip test now covers every defined join type, |
Mandatory ReadRel filters and JoinRel post-join filters are currently dropped when converting plans to Calcite or Spark. A read carrying FALSE therefore returns its input rows, and an outer join loses predicates that should inspect its null-extended output.
For example, this scan must produce no rows, but Isthmus currently returns an unrestricted TableScan:
Apply mandatory scan filters before projection and emit remapping, and post-join filters after join output formation. Decode logical, lateral, hash, and merge post-join references against each join's direct output schema, preserving outer-join nullability and semi/anti output coordinates. This follows the direct-output rule documented in spec v0.91.0 and the lateral-join semantics in the pinned spec v0.102.0.
Partially addresses #1204 for mandatory read filtering.
BREAKING CHANGE: Mandatory read and post-join filters are now enforced by Calcite and Spark conversion. Post-join field references are decoded against the join's direct output before emit, rather than concatenated inputs. Regenerate plans that reference removed semi/anti input columns or use concatenated-input indices for right-oriented joins; outer-join references now retain their nullable output types.