Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-35662 Support Timestamp without time zone data type
  3. SPARK-36045

TO_UTC_TIMESTAMP and FROM_UTC_TIMESTAMP should return TimestampNTZ

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Won't Do
    • 3.3.0
    • None
    • SQL
    • None

    Description

      Currently, the SQL function to_utc_timestamp is confusing: it just takes the timestamp value in the local timezone and then pretends it’s in the provided timezone and then returns the UTC value, but the result is still treated as local timezone!
      The same issue happens in from_utc_timestamp as well.
      We even tried to deprecated in the OSS community: https://github.com/apache/spark/commit/c5e83ab92c0cb514963209dc3e70ba0e24570082

      We should make TO_UTC_TIMESTAMP and FROM_UTC_TIMESTAMP return TimestampNTZ, which makes a lot of sense. converting the current local time to/from UTC local time.
      The functions should accept both Timestamp types:
      1. given TimestampLTZ, convert it to TimestampNTZ and continue step #2
      2. given TimestampNTZ, convert it as to/from UTC local time.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Gengliang.Wang Gengliang Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: