my-vegetable-has-exploded opened a new issue, #9218:
URL: https://github.com/apache/arrow-datafusion/issues/9218

   ### 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](https://github.com/apache/arrow-datafusion/assets/48236141/ddbdad69-e6b6-42b0-9012-a0b52c6a1982)
   
   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`. 
   
   I added a unit test here. 
https://github.com/apache/arrow-datafusion/compare/main...my-vegetable-has-exploded:hashjoin-pushdown-test?expand=1
   
   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_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to