You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "t oo (Jira)" <ji...@apache.org> on 2019/12/25 23:25:00 UTC

[jira] [Reopened] (SPARK-27429) [SQL] to_timestamp function with additional argument flag that will allow exception if value could not be cast

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

t oo reopened SPARK-27429:
--------------------------

presto has both functionality, https://prestosql.io/docs/current/functions/conditional.html
by default they fail if bad data, to get null if bad data wrap in TRY().
I get user data to ingest first as string format, then I want to conform it to casted data types with sql but right now I don't get errors back!

> [SQL] to_timestamp function with additional argument flag that will allow exception if value could not be cast
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-27429
>                 URL: https://issues.apache.org/jira/browse/SPARK-27429
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.4.1
>            Reporter: t oo
>            Priority: Major
>
> If I am running a SQL on a csv based dataframe and my query has  to_timestamp(input_col,'yyyy-MM-dd HH:mm:ss'), if the values in input_col are not really timestamp like 'ABC' then I would like to_timestamp function to throw an exception rather than happily (silently) return the values as null.



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