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

More projection pushdown for HashJoinExec #9218

Open
my-vegetable-has-exploded opened this issue Feb 13, 2024 · 2 comments
Open

More projection pushdown for HashJoinExec #9218

my-vegetable-has-exploded opened this issue Feb 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@my-vegetable-has-exploded
Copy link
Contributor

my-vegetable-has-exploded commented Feb 13, 2024

Is your feature request related to a problem or challenge?

When I try to implement #6768, I find that the current pushdown on hashjoinexec needs to satisfy strict condition.

https://github.com/apache/arrow-datafusion/blob/main/datafusion/core/src/physical_optimizer/projection_pushdown.rs#L1144-L1157

This function requires that the column in the left table is in front of the column in the right table the schema of ProjectionExec.

Screenshot from 2024-02-14 00-22-42

So , it works fine for sql like SELECT t1.c as c_from_left, t1.b as b_from_left, t1.a as a_from_left, t2.a as a_from_right, t2.c as c_from_right FROM t1 JOIN t2 ON t1.b = t2.c WHERE t1.b - (1 + t2.a) <= t2.a + t1.c but won't optimize sql like SELECT t1.c as c_from_left, t1.b as b_from_left, t2.a as a_from_right, t1.a as a_from_left, t2.c as c_from_right FROM t1 JOIN t2 ON t1.b = t2.c WHERE t1.b - (1 + t2.a) <= t2.a + t1.c. (just reorder columns)

I added a unit test here. https://github.com/apache/arrow-datafusion/compare/main...my-vegetable-has-exploded:hashjoin-pushdown-test?expand=1 (It won't optimize the process)

But it seems that the logical optimizer can hold it rightly, so I don't know to whether it matters.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

@my-vegetable-has-exploded my-vegetable-has-exploded added the enhancement New feature or request label Feb 13, 2024
@my-vegetable-has-exploded
Copy link
Contributor Author

@berkaysynnada Please take a look when you are free, Thanks a lot.

@berkaysynnada
Copy link
Contributor

This issue will be resolved as well when I launch the new projection optimizer rule. You can see the details here #9111. If you have any question or suggestion, please feel free to ask.

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

No branches or pull requests

2 participants