realno commented on pull request #1729:
URL: 
https://github.com/apache/arrow-datafusion/pull/1729#issuecomment-1029176197


   > I had a thought this morning: what if we didn't introduce an `Aggregate` 
function at all, and instead simply rewrote queries
   
   @alamb I think this is a actually a good idea. Let me look at the code you 
shared.
   
   I was thinking about something like this when started looking at median (the 
exact version). If we have some official support for rewrite query and logical 
plan that'll help. I was thinking to implement a `CombinedOperator` that can be 
expanded during planning phase but didn't have enough time to explore too much 
- it does not appear to be trivial. For example, 
   ```
   PROJECT
       MEDIAN c1
   ...
   ```
   can be rewrite to something like 
   ```
   PROJECT 
       FINDN 
           SORT c1
   ...
   ```
   
   Though rewriting query will introduce potential security risks I think 
rewriting logical plan is a better option. 


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