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

dgd_contributor commented on SPARK-36022:
-----------------------------------------

as they are calendarInterval, which is presented by months, days and 
microseconds, I think "2021 years" is equal to "2021 years and 0 months", why 
the last command should fail?

> Respect interval fields in extract
> ----------------------------------
>
>                 Key: SPARK-36022
>                 URL: https://issues.apache.org/jira/browse/SPARK-36022
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.2.0
>            Reporter: Max Gekk
>            Priority: Major
>
> Extract should process only existing fields of interval types. For example:
> {code:sql}
> spark-sql> SELECT EXTRACT(MONTH FROM INTERVAL '2021-11' YEAR TO MONTH);
> 11
> spark-sql> SELECT EXTRACT(MONTH FROM INTERVAL '2021' YEAR);
> 0
> {code}
> The last command should fail as the month field doesn't present in INTERVAL 
> YEAR.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to