timsaucer opened a new issue, #12075:
URL: https://github.com/apache/datafusion/issues/12075
### Is your feature request related to a problem or challenge?
It is a common need to get the value of one column such that another column
is a minimum. For example, if I have a column of fruit_name and price_per_pound
I might want to get the fruit_name for which price_per_pound is a minimum. This
can be done with existing functions, but it should be both more performant and
more user friendly to add these functions.
### Describe the solution you'd like
Ideally this would take two expressions. The first would be the expression
you want to return and the second would be the expression that we are looking
for the min/max of. In my example we would do something like
`min_by(col("fruit_name"), col("price_per_pound"))`
### Describe alternatives you've considered
Right now I would probably do a first_value with an order_by. This will
introduce an unnecessary sort of the dataframe.
### Additional context
Example from
https://docs.databricks.com/en/sql/language-manual/functions/min_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: [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]