Skip to content
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

feat(ir): more flexible dereferencing for join right-hand side #8916

Closed
wants to merge 2 commits into from

Conversation

kszucs
Copy link
Member

@kszucs kszucs commented Apr 9, 2024

The join dereferencing logic required explicit references to the exact right hand side table which disallowed more convenient syntaxes like t1.join(t2.at_time(t1.c), [t1.a == t2.d]).

Resolves #8581

@kszucs
Copy link
Member Author

kszucs commented Apr 9, 2024

cc @mfatihaktas

@kszucs
Copy link
Member Author

kszucs commented Apr 9, 2024

There is a more complicated test case in the impala test suite, inspecting it.

@kszucs
Copy link
Member Author

kszucs commented Apr 9, 2024

The multi-table dereference mapping calculation must be slightly smarter by tracking the distance from the target relations and picking the closest one (unless there are multiple ones at the same distance in which case an ambiguity error should be raised).

@cpcloud cpcloud added this to the 9.0 milestone Apr 12, 2024
@cpcloud
Copy link
Member

cpcloud commented Apr 15, 2024

@kszucs The two failures are pretty easy to fix. Otherwise, is this PR ready to go in?

@gforsyth
Copy link
Member

CI is green if @kszucs is happy with this.

@@ -62,7 +62,7 @@ INNER JOIN (
GROUP BY
1
) AS `t10`
ON `t8`.`d` = `t10`.`d`
ON `t10`.`d` = `t10`.`d`
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't look correct to me. Should be t8 as it was before.

@kszucs
Copy link
Member Author

kszucs commented Apr 16, 2024

No, I am not happy with this yet.

@cpcloud
Copy link
Member

cpcloud commented Apr 18, 2024

Should we close this in favor of #8992?

@kszucs
Copy link
Member Author

kszucs commented Apr 18, 2024

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(ir): more flexible dereferencing support for the right hand side of joins
3 participants