Skip to content

[CALCITE-7634] JoinExpandOrToUnionRule incorrectly expands OR branches with non-equi predicates referencing both join inputs#5069

Open
xiedeyantu wants to merge 1 commit into
apache:mainfrom
xiedeyantu:CALCITE-7634
Open

[CALCITE-7634] JoinExpandOrToUnionRule incorrectly expands OR branches with non-equi predicates referencing both join inputs#5069
xiedeyantu wants to merge 1 commit into
apache:mainfrom
xiedeyantu:CALCITE-7634

Conversation

@xiedeyantu

@xiedeyantu xiedeyantu commented Jul 2, 2026

Copy link
Copy Markdown
Member

Jira Link

CALCITE-7634

@xiedeyantu xiedeyantu changed the title [CALCITE-7634] JoinExpandOrToUnionRule incorrectly expands OR branche… [CALCITE-7634] JoinExpandOrToUnionRule incorrectly expands OR branches with non-equi predicates referencing both join inputs Jul 2, 2026

@xuzifu666 xuzifu666 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall it is a nice fix, only left a comment for test.

* <a href="https://issues.apache.org/jira/browse/CALCITE-7634">[CALCITE-7634]
* JoinExpandOrToUnionRule incorrectly expands OR branches with non-equi
* predicates referencing both join inputs</a>. */
@Test void testJoinConditionOrExpansionRuleWithCrossInputPredicate() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This only asserts the plan shape, maybe it can't catch the row-dropping bug above. Can we add a quidem test for it? that runs with NULL data and checks the actual result set.

@mihaibudiu mihaibudiu added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Jul 2, 2026
@mihaibudiu

Copy link
Copy Markdown
Contributor

We should merge correctness bugfixes as soon as possible.

@xiedeyantu

Copy link
Copy Markdown
Member Author

I added test in hep.iq. I changed the NOT to IS NOT TRUE. Please take another look. Thanks! @xuzifu666 @mihaibudiu

@xuzifu666

Copy link
Copy Markdown
Member

Thanks for the test; I think everything looks good now. However, the Jira ticket doesn't seem to have a link to this PR yet—you might need to add it manually. @xiedeyantu

…s with non-equi predicates referencing both join inputs

Signed-off-by: xiedeyantu <czjourney@163.com>
@xiedeyantu

Copy link
Copy Markdown
Member Author

If there are no other comments, I plan to merge them in a day.

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

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.

3 participants