[jira] [Commented] (SPARK-40151) Fix return type for new median(interval) function

2022-08-21 Thread Apache Spark (Jira)


[ 
https://issues.apache.org/jira/browse/SPARK-40151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17582482#comment-17582482
 ] 

Apache Spark commented on SPARK-40151:
--

User 'MaxGekk' has created a pull request for this issue:
https://github.com/apache/spark/pull/37595

> Fix return type for new median(interval) function 
> --
>
> Key: SPARK-40151
> URL: https://issues.apache.org/jira/browse/SPARK-40151
> Project: Spark
>  Issue Type: Bug
>  Components: Spark Core
>Affects Versions: 3.4.0
>Reporter: Serge Rielau
>Priority: Critical
>
> median() right now returns an interval of the same type as the input.
> We should instead match mean and avg():
> The result type is computed as for the arguments:
> - year-month interval: The result is an `INTERVAL YEAR TO MONTH`.
> - day-time interval: The result is an `INTERVAL DAY TO SECOND`.
> - In all other cases the result is a DOUBLE.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-40151) Fix return type for new median(interval) function

2022-08-21 Thread Apache Spark (Jira)


[ 
https://issues.apache.org/jira/browse/SPARK-40151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17582481#comment-17582481
 ] 

Apache Spark commented on SPARK-40151:
--

User 'MaxGekk' has created a pull request for this issue:
https://github.com/apache/spark/pull/37595

> Fix return type for new median(interval) function 
> --
>
> Key: SPARK-40151
> URL: https://issues.apache.org/jira/browse/SPARK-40151
> Project: Spark
>  Issue Type: Bug
>  Components: Spark Core
>Affects Versions: 3.4.0
>Reporter: Serge Rielau
>Priority: Critical
>
> median() right now returns an interval of the same type as the input.
> We should instead match mean and avg():
> The result type is computed as for the arguments:
> - year-month interval: The result is an `INTERVAL YEAR TO MONTH`.
> - day-time interval: The result is an `INTERVAL DAY TO SECOND`.
> - In all other cases the result is a DOUBLE.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org