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

Use CAST in parsing of dates/timestamps with default pattern

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.3.0
    • 3.3.0
    • SQL
    • None

    Description

      In functions, CSV/JSON datasources and other places, when the pattern is default, use CAST logic in parsing strings to dates/timestamps.

      Currently, TimestampFormatter.getFormatter() applies the default pattern yyyy-MM-dd HH:mm:ss when the pattern is not set, see https://github.com/apache/spark/blob/f2492772baf1d00d802e704f84c22a9c410929e9/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/TimestampFormatter.scala#L344 . Instead of that, need to create a special formatter which invokes the cast logic.

      Attachments

        Activity

          People

            maxgekk Max Gekk
            maxgekk Max Gekk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: