You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/10/09 03:01:08 UTC
[GitHub] [spark] zhengruifeng opened a new pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
zhengruifeng opened a new pull request #34229:
URL: https://github.com/apache/spark/pull/34229
### What changes were proposed in this pull request?
Add max_by/min_by to sql.functions
### Why are the changes needed?
for convenience
### Does this PR introduce _any_ user-facing change?
yes, new methods are added
### How was this patch tested?
existing testsuits and added testsuits
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939285354
**[Test build #144056 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144056/testReport)** for PR 34229 at commit [`734d0d6`](https://github.com/apache/spark/commit/734d0d6ef3f00fa0a53501ccb13e6f66126e600c).
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939356440
**[Test build #144056 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144056/testReport)** for PR 34229 at commit [`734d0d6`](https://github.com/apache/spark/commit/734d0d6ef3f00fa0a53501ccb13e6f66126e600c).
* This patch **fails from timeout after a configured wait of `500m`**.
* This patch merges cleanly.
* This patch adds no public classes.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939360716
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144056/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939234679
Looks good otherwise
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on a change in pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #34229:
URL: https://github.com/apache/spark/pull/34229#discussion_r725439515
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala
##########
@@ -673,6 +673,23 @@ object functions {
*/
def max(columnName: String): Column = max(Column(columnName))
+ /**
+ * Aggregate function: returns the value associated with the maximum value of ord.
+ *
+ * @group agg_funcs
+ * @since 3.3.0
+ */
+ def max_by(e: Column, ord: Column): Column = withAggregateFunction { MaxBy(e.expr, ord.expr) }
+
+ /**
+ * Aggregate function: returns the value associated with the maximum value of ord.
+ *
+ * @group agg_funcs
+ * @since 3.3.0
+ */
+ def max_by(columnName: String, ordColumnName: String): Column =
Review comment:
We will have too add them into PySpark and SparkR side too ... can be done separately though. cc @yoda-mon FYI
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939251204
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144045/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939301576
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48533/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939301576
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48533/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939250565
**[Test build #144045 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144045/testReport)** for PR 34229 at commit [`7435e88`](https://github.com/apache/spark/commit/7435e8896faab016acb2707761f6fe35e31a696d).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon closed pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #34229:
URL: https://github.com/apache/spark/pull/34229
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939227074
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48522/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939290583
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48533/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939225723
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48522/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on a change in pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #34229:
URL: https://github.com/apache/spark/pull/34229#discussion_r725765010
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala
##########
@@ -673,6 +673,23 @@ object functions {
*/
def max(columnName: String): Column = max(Column(columnName))
+ /**
+ * Aggregate function: returns the value associated with the maximum value of ord.
+ *
+ * @group agg_funcs
+ * @since 3.3.0
+ */
+ def max_by(e: Column, ord: Column): Column = withAggregateFunction { MaxBy(e.expr, ord.expr) }
+
+ /**
+ * Aggregate function: returns the value associated with the maximum value of ord.
+ *
+ * @group agg_funcs
+ * @since 3.3.0
+ */
+ def max_by(columnName: String, ordColumnName: String): Column =
Review comment:
Sure, please go ahead!
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939213091
**[Test build #144045 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144045/testReport)** for PR 34229 at commit [`7435e88`](https://github.com/apache/spark/commit/7435e8896faab016acb2707761f6fe35e31a696d).
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939213091
**[Test build #144045 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144045/testReport)** for PR 34229 at commit [`7435e88`](https://github.com/apache/spark/commit/7435e8896faab016acb2707761f6fe35e31a696d).
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] yoda-mon commented on a change in pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
yoda-mon commented on a change in pull request #34229:
URL: https://github.com/apache/spark/pull/34229#discussion_r725746304
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala
##########
@@ -673,6 +673,23 @@ object functions {
*/
def max(columnName: String): Column = max(Column(columnName))
+ /**
+ * Aggregate function: returns the value associated with the maximum value of ord.
+ *
+ * @group agg_funcs
+ * @since 3.3.0
+ */
+ def max_by(e: Column, ord: Column): Column = withAggregateFunction { MaxBy(e.expr, ord.expr) }
+
+ /**
+ * Aggregate function: returns the value associated with the maximum value of ord.
+ *
+ * @group agg_funcs
+ * @since 3.3.0
+ */
+ def max_by(columnName: String, ordColumnName: String): Column =
Review comment:
May I do those 2 APIs ? @HyukjinKwon @zhengruifeng
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939285354
**[Test build #144056 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/144056/testReport)** for PR 34229 at commit [`734d0d6`](https://github.com/apache/spark/commit/734d0d6ef3f00fa0a53501ccb13e6f66126e600c).
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939218069
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48522/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939296095
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48533/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939251204
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144045/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939589404
Merged to master.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939360716
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/144056/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34229:
URL: https://github.com/apache/spark/pull/34229#issuecomment-939227074
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48522/
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on a change in pull request #34229: [SPARK-36963][SQL] Add max_by/min_by to sql.functions
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #34229:
URL: https://github.com/apache/spark/pull/34229#discussion_r725439408
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala
##########
@@ -673,6 +673,23 @@ object functions {
*/
def max(columnName: String): Column = max(Column(columnName))
+ /**
+ * Aggregate function: returns the value associated with the maximum value of ord.
+ *
+ * @group agg_funcs
+ * @since 3.3.0
+ */
+ def max_by(e: Column, ord: Column): Column = withAggregateFunction { MaxBy(e.expr, ord.expr) }
+
+ /**
+ * Aggregate function: returns the value associated with the maximum value of ord.
+ *
+ * @group agg_funcs
+ * @since 3.3.0
+ */
+ def max_by(columnName: String, ordColumnName: String): Column =
Review comment:
Let's avoid adding string overriden version (see the comments on the top of this file)
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org