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 59 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (6)
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.
| rel.hasPostJoinFilter() ? converter.from(rel.getPostJoinFilter()) : null)); | ||
| .joinType(joinType); | ||
|
|
||
| if (rel.hasPostJoinFilter()) { |
There was a problem hiding this comment.
Apply the same output-schema decoding in newLateralJoin (line 1065), newHashJoin (1141) and newMergeJoin (1180). The spec gives all four joins the same direct-output rule, and right now a LEFT is_null filter on those three decodes with the wrong nullability. JoinRoundtripTest.lateralJoinWithAnchorAndPostFilter builds its filter over left+right, so it will need the same update.
There was a problem hiding this comment.
Thanks, good catch. I’ve prepared the same output-schema decoding for lateral, hash, and merge joins, while keeping join conditions and residual predicates on the input schema. The regressions cover outer-join nullability, semi/anti output coordinates, and emit mappings; they fail with the previous decoder and pass with the local changes. The full build passes too. These changes are local and have not been pushed yet.
|
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
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.