Skip to content

Disable PROJECT_SET_OP_TRANSPOSE rule in BeamRuleSets#39459

Draft
damccorm wants to merge 3 commits into
masterfrom
backport-3de6c449-disable-project-set-op-transpose
Draft

Disable PROJECT_SET_OP_TRANSPOSE rule in BeamRuleSets#39459
damccorm wants to merge 3 commits into
masterfrom
backport-3de6c449-disable-project-set-op-transpose

Conversation

@damccorm

Copy link
Copy Markdown
Contributor

Summary

Removes CoreRules.PROJECT_SET_OP_TRANSPOSE from the active planner rule set in BeamRuleSets.

This rule pushes projections through set operations (UNION/INTERSECT/EXCEPT), transposing the projection into each branch where PROJECT_MERGE then fuses it with adjacent branch projections. This fusion cancels the deterministic IEEE-754 FP surrogate wrapped around FLOAT/DOUBLE set-operation columns (collapsing from_bits(bits(x)) back to the raw DOUBLE), reintroducing the non-deterministic Double/Float key coder that Beam's CoGroup-based set operators reject with "the keyCoder of a GroupByKey must be deterministic." The rule is a pure optimization, so omitting it is correctness-preserving.

Changes

  • BeamRuleSets.java: Replaced CoreRules.PROJECT_SET_OP_TRANSPOSE with a comment explaining why it is intentionally disabled.
  • BeamRuleSetsTest.java (new): Tests verifying PROJECT_SET_OP_TRANSPOSE is not in the active rule set and FILTER_SET_OP_TRANSPOSE remains enabled.

Files Changed

  • sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/planner/BeamRuleSets.java
  • sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/planner/BeamRuleSetsTest.java (new)

Remove CoreRules.PROJECT_SET_OP_TRANSPOSE from the active rule set.
This rule pushes projections through set operations (UNION/INTERSECT/
EXCEPT), but doing so collapses IEEE-754 FP surrogates wrapped around
FLOAT/DOUBLE set-operation columns, reintroducing non-deterministic
key coders that Beam's CoGroup-based set operators reject.

Adds BeamRuleSetsTest verifying PROJECT_SET_OP_TRANSPOSE is disabled
and FILTER_SET_OP_TRANSPOSE remains enabled.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant