Skip to content

[CALCITE-7434] Error in new decorrelation algorithm caused by FilterJoinRule omitting variablesSet#4824

Merged
silundong merged 1 commit intoapache:mainfrom
silundong:issue-7434
Mar 7, 2026
Merged

[CALCITE-7434] Error in new decorrelation algorithm caused by FilterJoinRule omitting variablesSet#4824
silundong merged 1 commit intoapache:mainfrom
silundong:issue-7434

Conversation

@silundong
Copy link
Contributor

The root cause is that FilterJoinRule was applied before the subquery was removed, and when building the top Filter, the variablesSet was omitted. SubQueryRemoveRule.FILTER_SUB_QUERY_TO_MARK_CORRELATE performs a strict check on variablesSet when removing a subquery: if it is empty, a Join will be generated instead of a Correlate. As a result, the plan does not contain a Correlate, but correlated variables remain.

Copy link
Member

@asolimando asolimando left a comment

Choose a reason for hiding this comment

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

LGTM

!plan
!}

SELECT E.EMPNO
Copy link
Member

Choose a reason for hiding this comment

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

Please add a jira link here.

@xiedeyantu xiedeyantu added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Mar 6, 2026
@silundong silundong merged commit 66c496a into apache:main Mar 7, 2026
17 of 18 checks passed
@silundong silundong deleted the issue-7434 branch March 7, 2026 08:07
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