You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "rishvin (via GitHub)" <gi...@apache.org> on 2025/10/05 05:08:24 UTC

[I] [datafusion-spark]: Implement collect_list/array_agg and collect_set [datafusion]

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: github-unsubscribe@datafusion.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] [datafusion-spark]: Implement collect_list/array_agg [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #17923:
URL: https://github.com/apache/datafusion/issues/17923#issuecomment-3401634794

   Thanks! I added this to the epic:
   - https://github.com/apache/datafusion/issues/15914


-- 
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-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] [datafusion-spark]: Implement collect_list/array_agg [datafusion]

Posted by "cht42 (via GitHub)" <gi...@apache.org>.
cht42 commented on issue #17923:
URL: https://github.com/apache/datafusion/issues/17923#issuecomment-3723393328

   take


-- 
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-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] [datafusion-spark]: Implement collect_list/array_agg [datafusion]

Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey closed issue #17923: [datafusion-spark]: Implement collect_list/array_agg
URL: https://github.com/apache/datafusion/issues/17923


-- 
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-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org