rishvin opened a new issue, #17923:
URL: https://github.com/apache/datafusion/issues/17923

   ### Is your feature request related to a problem or challenge?
   
   Implement 
[collect_list](https://spark.apache.org/docs/latest/api/sql/index.html#collect_list),
 [array_agg](https://spark.apache.org/docs/latest/api/sql/index.html#array_agg) 
and 
[collect_set](https://spark.apache.org/docs/latest/api/sql/index.html#collect_set)
 equivalent of spark.
   
   Note that in Spark, the `array_agg` is an alias of `collect_list`, [link 
here](https://github.com/apache/spark/blob/65ff85a31fe8a8ea4a2ba713ba2c624709ce815a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala#L510).
 
   
   Also note that, Datafusion also support `array_agg`, however, there seems to 
a difference in behaviour and syntax with Spark. 
   
   For eg. Datafusion support `ORDER BY` within `array_agg`, 
[link](https://datafusion.apache.org/user-guide/sql/aggregate_functions.html#array-agg),
 and can provide deterministic ordering. Spark on the other hand, doesn't 
support `ORDER BY` within `array_agg` and does not ensure deterministic 
ordering. Spark doc explicitly mentions this for all 3 functions - `The 
function is non-deterministic because the order of collected results depends on 
the order of the rows which may be non-deterministic after a shuffle.`, 
[link](https://spark.apache.org/docs/latest/api/sql/index.html#array_agg).
   
   
   ### Describe the solution you'd like
   
   _No response_
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


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