ozankabak commented on PR #6445: URL: https://github.com/apache/arrow-datafusion/pull/6445#issuecomment-1563304302
Note that this change makes `FIRST_VALUE` and `LAST_VALUE` functions, which are already available as window functions, also available in an aggregation context so that one can choose first/last values within a group according to a given ordering. These functions are sometimes called `FIRST` and `LAST` in other query engines/DBs, but we chose to use the same with their window function counterparts (as in the case of `SUM`, `COUNT` etc.) Having said that, there are few minor issues here that we will fix shortly. I think the example in the PR body should read something like: ```sql SELECT a, FIRST_VALUE(c ORDER BY b DESC) as first_c FROM table GROUP BY a ``` This will return the first `c` value, according to the reverse `b` order, for every `a` group. Also some tests are failing. We will fix the tests, make the PR body clearer and possibly add another test that looks like this. -- 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]
