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/01/08 05:22:45 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #31079: [SPARK-34037][SQL] ResolveAggregateFunctions pushes duplicated sort order into aggregate because of unnecessary casting

cloud-fan commented on a change in pull request #31079:
URL: https://github.com/apache/spark/pull/31079#discussion_r553747797



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
##########
@@ -634,17 +634,6 @@ object TypeCoercion {
 
         m.copy(newKeys.zip(newValues).flatMap { case (k, v) => Seq(k, v) })
 
-      // Promote SUM, SUM DISTINCT and AVERAGE to largest types to prevent overflows.
-      case s @ Sum(e @ DecimalType()) => s // Decimal is already the biggest.

Review comment:
       Yea, `Sum`/`Average` already casts the inputs internally.




----------------------------------------------------------------
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