alamb commented on PR #6482:
URL: 
https://github.com/apache/arrow-datafusion/pull/6482#issuecomment-1570881636

   > in terms of behavior. Hence by converting query above to its equivalent 
form below
   
   ```sql
   SELECT country, LAST_VALUE(amount ORDER BY amount DESC) AS fv1,
     LAST_VALUE(amount ORDER BY amount DESC) AS fv2,
     ARRAY_AGG(amount ORDER BY amount ASC) AS amounts
     FROM sales_global
     GROUP BY country
   ```
   
   
   Did you mean like this (change `LAST_VALUE` to `FIRST_VALUE` and switch the 
order):
   
   ```sql
   SELECT country, LAST_VALUE(amount ORDER BY amount DESC) AS fv1,
     FIRST_VALUE(amount ORDER BY amount ASC) AS fv2,
     ARRAY_AGG(amount ORDER BY amount ASC) AS amounts
     FROM sales_global
     GROUP BY country
   ```
   
   


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