You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Pablo Langa Blanco (Jira)" <ji...@apache.org> on 2021/05/02 23:45:00 UTC
[jira] [Commented] (SPARK-35249) to_timestamp can't parse 6 digit
microsecond SSSSSS
[ https://issues.apache.org/jira/browse/SPARK-35249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338139#comment-17338139 ]
Pablo Langa Blanco commented on SPARK-35249:
--------------------------------------------
Hi [~toopt4],
I think there are two different issues here. First, the correct pattern for this string is as follows.
{code:java}
select x, to_timestamp(x,"MMM dd yyyy hh:mm:ss.SSSSSSa") from (select 'Apr 13 2021 12:00:00.001000AM' x);
{code}
The other problem is that in spark 2.4.6 this pattern (SSSSSS) with more than 5 characters apparently doesn't work. But I have tested it in 3.1.1 version and it works fine.
Regards
> to_timestamp can't parse 6 digit microsecond SSSSSS
> ---------------------------------------------------
>
> Key: SPARK-35249
> URL: https://issues.apache.org/jira/browse/SPARK-35249
> Project: Spark
> Issue Type: Wish
> Components: SQL
> Affects Versions: 2.4.6
> Reporter: t oo
> Priority: Major
>
> spark-sql> select x, to_timestamp(x,"MMM dd yyyy hh:mm:ss.SSSSSS") from (select 'Apr 13 2021 12:00:00.001000AM' x);
> Apr 13 2021 12:00:00.001000AM NULL
>
> Why doesn't the to_timestamp work?
>
--
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