Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-30668

to_timestamp failed to parse 2020-01-27T20:06:11.847-0800 using pattern "yyyy-MM-dd'T'HH:mm:ss.SSSz"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.0
    • Component/s: SQL
    • Labels:
      None
    • Target Version/s:

      Description

      SELECT to_timestamp("2020-01-27T20:06:11.847-0800", "yyyy-MM-dd'T'HH:mm:ss.SSSz")
      

      This can return a valid value in Spark 2.4 but return NULL in the latest master

      *2.4.5 RC2*

      scala> sql("""SELECT to_timestamp("2020-01-27T20:06:11.847-0800", "yyyy-MM-dd'T'HH:mm:ss.SSSz")""").show
      +----------------------------------------------------------------------------+
      |to_timestamp('2020-01-27T20:06:11.847-0800', 'yyyy-MM-dd\'T\'HH:mm:ss.SSSz')|
      +----------------------------------------------------------------------------+
      |                                                         2020-01-27 20:06:11|
      +----------------------------------------------------------------------------+
      

      *2.2.3 ~ 2.4.4* (2.0.2 ~ 2.1.3 doesn't have `to_timestamp`).

      spark-sql> SELECT to_timestamp("2020-01-27T20:06:11.847-0800", "yyyy-MM-dd'T'HH:mm:ss.SSSz");
      2020-01-27 20:06:11
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                maxgekk Maxim Gekk
                Reporter:
                smilegator Xiao Li
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: