You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Max Gekk (Jira)" <ji...@apache.org> on 2021/07/06 10:53:00 UTC
[jira] [Resolved] (SPARK-36023) Confusing error from casting a
string to ANSI interval
[ https://issues.apache.org/jira/browse/SPARK-36023?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Max Gekk resolved SPARK-36023.
------------------------------
Fix Version/s: 3.2.0
Resolution: Fixed
Issue resolved by pull request 33217
[https://github.com/apache/spark/pull/33217]
> Confusing error from casting a string to ANSI interval
> ------------------------------------------------------
>
> Key: SPARK-36023
> URL: https://issues.apache.org/jira/browse/SPARK-36023
> Project: Spark
> Issue Type: Sub-task
> Components: SQL
> Affects Versions: 3.2.0
> Reporter: Max Gekk
> Assignee: angerszhu
> Priority: Major
> Fix For: 3.2.0
>
>
> See the example:
> {code:sql}
> spark-sql> select interval '56:12' minute to second;
> 0 00:56:12.000000000
> spark-sql> select cast('56:12' as interval minute to second);
> 21/07/05 22:58:03 ERROR SparkSQLDriver: Failed in [select cast('56:12' as interval minute to second)]
> java.lang.IllegalArgumentException: Interval string does not match day-time format of `[+|-]h`, `INTERVAL [+|-]'[+|-]h' HOUR` when cast to interval minute to second: 56:12
> at org.apache.spark.sql.catalyst.util.IntervalUtils$.checkStringIntervalType$2(IntervalUtils.scala:287)
> {code}
> The error message from the second command confuses slightly. It mentions INTERVAL HOUR but how it relates to the input?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org