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 support for join right hand side #8992

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

kszucs
Copy link
Member

@kszucs kszucs commented Apr 18, 2024

Enables to use fields from parent tables of the join right hand side instead of enforcing to use the same exact table:

t1 = ibis.table(name="t1", schema={"a": "int64", "b": "string"})
t2 = ibis.table(name="t2", schema={"c": "int64", "d": "string"})

t3 = t2.mutate(e=t2.c + 1)
joined = t1.join(t3, [t1.a == t2.c])  # here we use t2.c instead of t3.c

Identify ambiguous cases and raise an error, like the following case:

t.join(t, [t.a == t.a])

depends on:

fixes #8581

ibis/expr/format.py Outdated Show resolved Hide resolved
ibis/common/graph.py Outdated Show resolved Hide resolved
ibis/expr/types/joins.py Outdated Show resolved Hide resolved
@kszucs kszucs force-pushed the derefff branch 3 times, most recently from 2e2ce8e to 1ec497f Compare April 19, 2024 10:15
@kszucs kszucs marked this pull request as ready for review April 19, 2024 10:16
@kszucs kszucs requested review from cpcloud and jcrist and removed request for cpcloud April 22, 2024 16:07
@kszucs kszucs force-pushed the derefff branch 7 times, most recently from 7ad98df to 53d02db Compare April 24, 2024 09:01
@kszucs kszucs requested review from cpcloud and gforsyth April 24, 2024 09:03
@cpcloud cpcloud added this to the 9.0 milestone Apr 24, 2024
@cpcloud cpcloud added the feature Features or general enhancements label Apr 24, 2024
Copy link
Member

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

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

LGTM mostly, just a few small requests.

Would really like to see a docstring for DerefMap but I won't block on that.

ibis/common/typing.py Outdated Show resolved Hide resolved
ibis/expr/rewrites.py Show resolved Hide resolved
ibis/expr/tests/test_newrels.py Outdated Show resolved Hide resolved
ibis/expr/tests/test_newrels.py Show resolved Hide resolved
@kszucs kszucs force-pushed the derefff branch 2 times, most recently from e060461 to 3baedcc Compare April 25, 2024 14:06
@kszucs kszucs enabled auto-merge (squash) April 25, 2024 14:20
@kszucs kszucs merged commit d7a31aa into ibis-project:main Apr 25, 2024
91 checks passed
kszucs added a commit that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features or general enhancements
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
4 participants