You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Weijun-H (via GitHub)" <gi...@apache.org> on 2024/08/30 02:36:33 UTC

[I] Support `max_by` in Aggregation function [datafusion]

Weijun-H opened a new issue, #12252:
URL: https://github.com/apache/datafusion/issues/12252

   ### Is your feature request related to a problem or challenge?
   
   [max_by(arg, val)](https://duckdb.org/docs/sql/functions/aggregates#max_byarg-val)
   
   Finds the row with the maximum val. Calculates the arg expression at that row. 
   
   ### Describe the solution you'd like
   
   D SELECT max_by(x, y) FROM VALUES ('a', 10), ('b', 50), ('c', 20) AS tab(x, y);
   ┌──────────────┐
   │ max_by(x, y) │
   │   varchar    │
   ├──────────────┤
   │ b            │
   └──────────────┘
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   https://duckdb.org/docs/sql/functions/aggregates#max_byarg-val
   https://docs.databricks.com/en/sql/language-manual/functions/max_by.html


-- 
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] Support `max_by` in Aggregation function [datafusion]

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

   Suggestion: https://github.com/apache/datafusion/issues/12254#issuecomment-2353615046


-- 
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] Support `max_by` in Aggregation function [datafusion]

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

   We are going to implement these in a different repository so closing this ticket to avoid confusion: https://github.com/apache/datafusion/issues/12254#issuecomment-2374446425


-- 
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] Support `max_by` in Aggregation function [datafusion]

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

   This probably could be an aliases (with some additional transformations) for first/last aggregation functions -- otherwise there it'll end with two implementations of basically the same function (not something bad, but still redundant).
   
   Relevant discussion -- https://github.com/apache/datafusion/issues/12075


-- 
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] Support `max_by` in Aggregation function [datafusion]

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

   Given https://github.com/apache/datafusion/issues/12357 we may want to move this function to some other repo rather than the core


-- 
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] Support `max_by` in Aggregation function [datafusion]

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

   I'd love to see `min_by` & `max_by` within DataFusion repository.
   


-- 
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] Support `max_by` in Aggregation function [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #12252: Support `max_by` in Aggregation function
URL: https://github.com/apache/datafusion/issues/12252


-- 
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] Support `max_by` in Aggregation function [datafusion]

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

   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