[
https://issues.apache.org/jira/browse/SPARK-38317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17498885#comment-17498885
]
Max Gekk commented on SPARK-38317:
----------------------------------
[~asm0dey] The table at
https://spark.apache.org/docs/latest/sql-ref-datatypes.html shows that
java.time.Period is converted to YearMonthIntervalType which has months as the
smallest granularity.
> Encoding of java.time.Period always results in "INTERVAL '0-0' YEAR TO MONTH"
> -----------------------------------------------------------------------------
>
> Key: SPARK-38317
> URL: https://issues.apache.org/jira/browse/SPARK-38317
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.2.0, 3.2.1
> Reporter: Jolan Rensen
> Priority: Major
>
> {code}
> val dates = Seq(
> Period.ZERO,
> Period.ofWeeks(2),
> ).toDS()
> dates.show(false)
> {code}
> Results in:
> {code}
> +----------------------------+
> |value |
> +----------------------------+
> |INTERVAL '0-0' YEAR TO MONTH|
> |INTERVAL '0-0' YEAR TO MONTH|
> +----------------------------+
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]