Skip to content

[CALCITE-7909] ProjectSetOpTransposeRule returns wrong results for EXCEPT ALL and INTERSECT ALL - #5378

Open
snuyanzin wants to merge 2 commits into
apache:mainfrom
snuyanzin:calcite7909
Open

snuyanzin wants to merge 2 commits into
apache:mainfrom
snuyanzin:calcite7909

Conversation

@snuyanzin

Copy link
Copy Markdown
Contributor

Jira Link

CALCITE-7909

Changes Proposed

The PR fixes behavior of ProjectSetOpTransposeRule for the case of EXCEPT ALL, INTERSECT ALL


// cannot push project past a distinct
if (!setOp.all) {
// only UNION ALL; other set ops compare rows on all fields

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the rule misnamed?

@mihaibudiu mihaibudiu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but perhaps the rule should not be called SetOp anymore

@sonarqubecloud

Copy link
Copy Markdown

manish1337 added a commit to manish1337/flink that referenced this pull request Nov 1, 2026
…link rule

Copy Calcite's ProjectSetOpTransposeRule with the fix of CALCITE-7909
(apache/calcite#5378) and drop FlinkProjectSetOpTransposeRule, so both
rule sets use CoreRules.PROJECT_SET_OP_TRANSPOSE again. The copy should
be removed after upgrading to a Calcite version that contains the fix.
The plans are the same as with FlinkProjectSetOpTransposeRule.

The fix is in a logical rule that batch and streaming share, so keep
only the streaming semantic tests.

Generated-by: Claude Code (Claude Opus 5.5)
@mihaibudiu mihaibudiu added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants