ueshin opened a new pull request, #39297:
URL: https://github.com/apache/spark/pull/39297

   ### What changes were proposed in this pull request?
   
   Adds an alias "reduce" to `ArrayAggregate`.
   
   Also modified the higher-order functions to also copy tags when binding to 
propagate them properly.
   
   ### Why are the changes needed?
   
   Presto provides the function: 
https://prestodb.io/docs/current/functions/array.html#reduce.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, a new alias for `ArrayAggregate`.
   
   For example:
   
   ```sql
   SELECT reduce(array(1, 2, 3), 0, (acc, x) -> acc + x);
   SELECT reduce(array(1, 2, 3), 0, (acc, x) -> acc + x, acc -> acc * 10);
   ```
   
   as the same as "aggregate":
   
   ```sql
   SELECT aggregate(array(1, 2, 3), 0, (acc, x) -> acc + x);
   SELECT aggregate(array(1, 2, 3), 0, (acc, x) -> acc + x, acc -> acc * 10);
   ```
   
   ### How was this patch tested?
   
   Added/modified tests.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to