alamb commented on issue #5635:
URL: 
https://github.com/apache/arrow-datafusion/issues/5635#issuecomment-1481551641

   >  Hmm, this doesn't seem very intuitive. why would a to_date() function 
need to be an aggregate function. Seems more like a bug tbh.
   
   I think @doki23  means that this query doesn't makes sense because it is 
needs to produce a single output per distinct value of `u` (not a) so to_date 
needs to be an aggregate function (that takes in multiple rows and produces a 
single output row)
   
   ```sql
   SELECT to_date(a) as u from t group by u
   ```
   
   What I think is *super* confusing is that datafusion does run this query 
(when there is an order by)
   
   ```
   SELECT to_date(a) as u from t group by u order by u
   ```
   
   IOx users also recently hit this confusing behavior: 
   
   https://github.com/influxdata/docs-v2/issues/4812#issuecomment-1478395592
   
   I will write a ticket to fix it (basically proposing to make `SELECT 
to_date(a) as u from t group by u order by u` error)


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to