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

   ### Is your feature request related to a problem or challenge?
   
   DataFusion currently has no support for aggregate function `map_agg` , which 
is supported in other engines like 
[trino](https://trino.io/docs/current/functions/aggregate.html#map_agg) , 
[presto](https://prestodb.io/docs/current/functions/aggregate.html#map_agg), 
[map_from_arrays](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.map_from_arrays.html)
 (not UDAF), 
[json_object_agg](https://www.postgresql.org/docs/current/functions-aggregate.html)
 in postgres
   
   ### Describe the solution you'd like
   
   Extend the api `AggregateUDFImpl` to implement `MapAgg`. 
   
   The expected behavior should be somehting like:
   
   ```
   SELECT k, map_agg(v, m)
   FROM (VALUES
       ('a', 1, 10),
       ('a', 2, 20),
       ('b', 3, 30)
   ) t(k, v, m)
   GROUP BY k;
   ```
   
   ```
   k | map_agg(v, m)
   --+------------------
   a | {1: 10, 2: 20}
   b | {3: 30}
   ```
   
   ### Describe alternatives you've considered
   
   Implement it in our codebase, but given the generic behavior of this 
function and the fact that it exists in other engines, I think it would be 
worth upstreaming.
   
   ### 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