[ 
https://issues.apache.org/jira/browse/SPARK-47696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated SPARK-47696:
-----------------------------------
    Labels: pull-request-available  (was: )

> try_to_timestamp should handle SparkUpgradeException
> ----------------------------------------------------
>
>                 Key: SPARK-47696
>                 URL: https://issues.apache.org/jira/browse/SPARK-47696
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 4.0.0, 3.5.2, 3.4.3
>            Reporter: Gengliang Wang
>            Assignee: Gengliang Wang
>            Priority: Major
>              Labels: pull-request-available
>
> Currently, try_to_timestamp will throw an exception on legacy timestamp input.
> {code:java}
> > SELECT try_to_timestamp('2016-12-1', 'yyyy-MM-dd')
> org.apache.spark.SparkUpgradeException: 
> [INCONSISTENT_BEHAVIOR_CROSS_VERSION.PARSE_DATETIME_BY_NEW_PARSER] You may 
> get a different result due to the upgrading to Spark >= 3.0:
> Fail to parse '2016-12-1' in the new parser.
> You can set "spark.sql.legacy.timeParserPolicy" to "LEGACY" to restore the 
> behavior before Spark 3.0, or set to "CORRECTED" and treat it as an invalid 
> datetime string. SQLSTATE: 42K0B {code}
> It should return null instead of error.



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

Reply via email to