Skip to content

Conversation

@silundong
Copy link
Contributor

@silundong silundong commented Jan 29, 2026

CALCITE-7402

When D-elimination is triggered during decorrelation, outer variables are replaced with local attributes and constrained with IS_NOT_NULL. The transformation looks like:

Filter(condition=[=($0, $cor0.DEPTNO)])
=>
Filter(condition=[IS_NOT_NULL($0)])

$0 (it's nullable before IS_NOT_NULL) will later be used to replace $cor0.DEPTNO(not nullable). The rewrite itself is fine, but the type inference of Filter does not detect the nullability change implied by the IS_NOT_NULL predicate. That is, $0 is still treated as nullable, which leads to a type mismatch when replacing $cor0.DEPTNO later.

@silundong silundong added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Jan 30, 2026
…eralDecorrelator type mismatch during translation
@sonarqubecloud
Copy link

@silundong silundong merged commit bf0eae0 into apache:main Jan 30, 2026
20 checks passed
@silundong silundong deleted the issue-7402 branch January 30, 2026 14:44
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