Skip to content

[CALCITE-7006] Incorrect left join results with IS NOT DISTINCT FROM under specific plan #4368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2025

Conversation

xiedeyantu
Copy link
Member

JIRA link: CALCITE-7006

@@ -854,4 +854,154 @@ EnumerableCalc(expr#0..1=[{inputs}], A=[$t0])
EnumerableValues(tuples=[[{ 1 }, { null }]])
!plan

# Test for Double
SELECT t1.a
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these are DECIMAL.
For DOUBLE you have to write 1.0e0

Copy link
Contributor

Choose a reason for hiding this comment

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

the test is good, but add a DOUBLE test too
In general, joining on double is tricky, but for this case it should work fine

Copy link
Contributor

Choose a reason for hiding this comment

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

the test for DECIMAL was good too, but it's also covered by the ARRAY tests below


!ok

# Test for TimesStamp
Copy link
Contributor

Choose a reason for hiding this comment

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

typo


!ok

# Test for Decimal
Copy link
Contributor

Choose a reason for hiding this comment

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

were these tests failing previously?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes

@mihaibudiu mihaibudiu added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label May 10, 2025
@xiedeyantu
Copy link
Member Author

@mihaibudiu I have fixed the comment above.

@mihaibudiu
Copy link
Contributor

I will merge this once CI passes; it's a serious bug. Surprising it wasn't found earlier.

@xiedeyantu
Copy link
Member Author

xiedeyantu commented May 10, 2025

I will merge this once CI passes; it's a serious bug. Surprising it wasn't found earlier.

Please wait for me to squish these commits. The reason is that previously it was is not distinct from and could not match null values. After implementing IsNotDistinctitFromImplementer, the equal method was not implemented correctly, which led to this issue. Whether it's the inability to match NULL values or the inability to match equivalent values, I think it might be because we didn't sufficiently test IS NOT DISTINCT FROM in the JDBC tests before.

@xiedeyantu xiedeyantu closed this May 10, 2025
@xiedeyantu xiedeyantu reopened this May 10, 2025
Copy link

@mihaibudiu mihaibudiu merged commit 99c4493 into apache:main May 11, 2025
37 checks passed
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