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 2022/08/22 06:41:55 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #37595: [SPARK-40151][SQL] Return wider ANSI interval types from the percentile functions

MaxGekk commented on code in PR #37595:
URL: https://github.com/apache/spark/pull/37595#discussion_r951064662


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/percentiles.scala:
##########
@@ -59,7 +59,8 @@ abstract class PercentileBase
 
   override lazy val dataType: DataType = {
     val resultType = child.dataType match {
-      case it: AnsiIntervalType => it
+      case _: YearMonthIntervalType => YearMonthIntervalType()
+      case _: DayTimeIntervalType => DayTimeIntervalType()

Review Comment:
   It could make sense, but the current approach is we return the default type (interval day to second) in many places. See `mean()` (PR's description), for instance. cc @srielau 



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