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


   > @alamb Am I missing something by any chance?
   
   I had a thought this morning: what if we didn't introduce an `Aggregate` 
function at all, and instead simply rewrote queries 
   
   so a query that has
   
   ```sql
   select approx_median(x) from foo;
   ```
   
   could be rewritten to 
   ```sql
   select approx_percentile(x, 5.0) as "approx_median(x)" from foo;
   ```
   
   Similar to how we transform `SELECT count(distinct x) from foo` to `select 
count(*) from (select x from foo group by x)` in 
https://github.com/realno/arrow-datafusion/blob/add-median-operator/datafusion/src/optimizer/single_distinct_to_groupby.rs#L44
   
   this may be a silly idea, but I wanted to write it down


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