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/04/19 06:50:07 UTC
[GitHub] [spark] beliefer opened a new pull request #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
beliefer opened a new pull request #32229:
URL: https://github.com/apache/spark/pull/32229
### What changes were proposed in this pull request?
Extend the `Average` expression to support `DayTimeIntervalType` and `YearMonthIntervalType` added by #31614.
Note: the expressions can throw the overflow exception independently from the SQL config `spark.sql.ansi.enabled`. In this way, the modified expressions always behave in the ANSI mode for the intervals.
### Why are the changes needed?
Extend `org.apache.spark.sql.catalyst.expressions.aggregate.Average` to support `DayTimeIntervalType` and `YearMonthIntervalType`.
### Does this PR introduce _any_ user-facing change?
'No'.
Should not since new types have not been released yet.
### How was this patch tested?
Jenkins test
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822382068
**[Test build #137624 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137624/testReport)** for PR 32229 at commit [`20cc8b1`](https://github.com/apache/spark/commit/20cc8b16b467505e7c5cb6841daec8eeeb5a9105).
--
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.
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] beliefer commented on pull request #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
beliefer commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822919744
@MaxGekk Thanks for your review. @HyukjinKwon Thanks for you help too.
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822375345
Kubernetes integration test unable to build dist.
exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42155/
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822257595
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/42138/
--
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.
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] MaxGekk commented on pull request #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822444745
+1, LGTM. Merging to master.
Thank you, @beliefer.
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822253249
Kubernetes integration test unable to build dist.
exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42138/
--
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.
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] MaxGekk closed pull request #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #32229:
URL: https://github.com/apache/spark/pull/32229
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822257595
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/42138/
--
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.
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] beliefer commented on a change in pull request #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
beliefer commented on a change in pull request #32229:
URL: https://github.com/apache/spark/pull/32229#discussion_r621066701
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Average.scala
##########
@@ -82,6 +87,8 @@ case class Average(child: Expression) extends DeclarativeAggregate with Implicit
case _: DecimalType =>
DecimalPrecision.decimalAndDecimal(
Divide(sum, count.cast(DecimalType.LongDecimal), failOnError = false)).cast(resultType)
+ case _: YearMonthIntervalType => DivideYMInterval(sum, count)
+ case _: DayTimeIntervalType => DivideDTInterval(sum, count)
case _ =>
Divide(sum.cast(resultType), count.cast(resultType), failOnError = false)
Review comment:
I fixed it with https://github.com/apache/spark/pull/32358.
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822340401
**[Test build #137606 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137606/testReport)** for PR 32229 at commit [`43fe7f4`](https://github.com/apache/spark/commit/43fe7f43cea50c11261cb4fec6fa8cadd48eaa97).
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822340401
**[Test build #137606 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137606/testReport)** for PR 32229 at commit [`43fe7f4`](https://github.com/apache/spark/commit/43fe7f43cea50c11261cb4fec6fa8cadd48eaa97).
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822613183
**[Test build #137624 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137624/testReport)** for PR 32229 at commit [`20cc8b1`](https://github.com/apache/spark/commit/20cc8b16b467505e7c5cb6841daec8eeeb5a9105).
* 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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822581791
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137606/
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822382068
**[Test build #137624 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137624/testReport)** for PR 32229 at commit [`20cc8b1`](https://github.com/apache/spark/commit/20cc8b16b467505e7c5cb6841daec8eeeb5a9105).
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822377541
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/42155/
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822624701
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137624/
--
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.
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] beliefer commented on a change in pull request #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
beliefer commented on a change in pull request #32229:
URL: https://github.com/apache/spark/pull/32229#discussion_r615678978
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Average.scala
##########
@@ -40,10 +39,15 @@ case class Average(child: Expression) extends DeclarativeAggregate with Implicit
override def prettyName: String = getTagValue(FunctionRegistry.FUNC_ALIAS).getOrElse("avg")
- override def inputTypes: Seq[AbstractDataType] = Seq(NumericType)
+ override def inputTypes: Seq[AbstractDataType] =
+ Seq(TypeCollection(NumericType, YearMonthIntervalType, DayTimeIntervalType))
- override def checkInputDataTypes(): TypeCheckResult =
- TypeUtils.checkForNumericExpr(child.dataType, "function average")
+ override def checkInputDataTypes(): TypeCheckResult = child.dataType match {
+ case YearMonthIntervalType | DayTimeIntervalType | NullType => TypeCheckResult.TypeCheckSuccess
+ case dt if dt.isInstanceOf[NumericType] => TypeCheckResult.TypeCheckSuccess
+ case other => TypeCheckResult.TypeCheckFailure(
+ s"function average requires numeric or interval types, not ${other.catalogString}")
+ }
Review comment:
Good idea.
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822377541
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/42155/
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822266733
cc @MaxGekk 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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822552868
**[Test build #137606 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137606/testReport)** for PR 32229 at commit [`43fe7f4`](https://github.com/apache/spark/commit/43fe7f43cea50c11261cb4fec6fa8cadd48eaa97).
* 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.
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] MaxGekk commented on a change in pull request #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #32229:
URL: https://github.com/apache/spark/pull/32229#discussion_r615638733
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Average.scala
##########
@@ -40,10 +39,15 @@ case class Average(child: Expression) extends DeclarativeAggregate with Implicit
override def prettyName: String = getTagValue(FunctionRegistry.FUNC_ALIAS).getOrElse("avg")
- override def inputTypes: Seq[AbstractDataType] = Seq(NumericType)
+ override def inputTypes: Seq[AbstractDataType] =
+ Seq(TypeCollection(NumericType, YearMonthIntervalType, DayTimeIntervalType))
- override def checkInputDataTypes(): TypeCheckResult =
- TypeUtils.checkForNumericExpr(child.dataType, "function average")
+ override def checkInputDataTypes(): TypeCheckResult = child.dataType match {
+ case YearMonthIntervalType | DayTimeIntervalType | NullType => TypeCheckResult.TypeCheckSuccess
+ case dt if dt.isInstanceOf[NumericType] => TypeCheckResult.TypeCheckSuccess
+ case other => TypeCheckResult.TypeCheckFailure(
+ s"function average requires numeric or interval types, not ${other.catalogString}")
+ }
Review comment:
The code is similar to https://github.com/apache/spark/commit/12abfe79173f6ab00b3341f3b31cad5aa26aa6e4#diff-310e24b112a4665955ce5db769e4afe57cf2cd07cf9c19ef8b8173d324285ecfR51-R56 . Could you place it to a function in `TypeUtils`.
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822581791
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137606/
--
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.
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 #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32229:
URL: https://github.com/apache/spark/pull/32229#issuecomment-822624701
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137624/
--
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.
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] cloud-fan commented on a change in pull request #32229: [SPARK-34837][SQL] Support ANSI SQL intervals by the aggregate function `avg`
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #32229:
URL: https://github.com/apache/spark/pull/32229#discussion_r616347027
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Average.scala
##########
@@ -82,6 +87,8 @@ case class Average(child: Expression) extends DeclarativeAggregate with Implicit
case _: DecimalType =>
DecimalPrecision.decimalAndDecimal(
Divide(sum, count.cast(DecimalType.LongDecimal), failOnError = false)).cast(resultType)
+ case _: YearMonthIntervalType => DivideYMInterval(sum, count)
+ case _: DayTimeIntervalType => DivideDTInterval(sum, count)
case _ =>
Divide(sum.cast(resultType), count.cast(resultType), failOnError = false)
Review comment:
how about global aggregate with empty input? we should return null or fail?
--
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.
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