berkaysynnada commented on PR #6273:
URL: 
https://github.com/apache/arrow-datafusion/pull/6273#issuecomment-1538221261

   > @berkaysynnada
   > 
   > Can you extend the optimization to non-column cases?
   > 
   > For example
   > 
   > ```sql
   > select a + b from table_2 order by a + b
   > union all
   > select x + y from table_2  order by x + y
   > ```
   
   
   
   > @berkaysynnada
   > 
   > Can you extend the optimization to non-column cases?
   > 
   > For example
   > 
   > ```sql
   > select a + b from table_2 order by a + b
   > union all
   > select x + y from table_2  order by x + y
   > ```
   
   My last commit can succeed in the cases of your example. However, for the 
cases like a+b+c (having two or more depth), the build order of the binary 
expression is important. We can get false negative results. Actually, I think 
this is a general problem with binary expressions in Datafusion. 


-- 
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