Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-21039

CURRENT_TIMESTAMP returns value in UTC time zone

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.1
    • 3.1.2, 3.2.0, 4.0.0-alpha-1
    • None
    • None

    Description

      We're upgrading from hive 1.2 to 3.1 and it seems like new hive returns CURRENT_TIMESTAMP in UTC timezone. But before it was in local (system's default) timezone.

      According to HIVE-5472 current_timestamp should use user's local timezone. This behaviour was changed in HIVE-12192 (if I got it right). GenericUDFCurrentTimestamp now explicitly uses UTC as timezone to initialise org.apache.hadoop.hive.common.type.Timestamp .

      For example
      Old hive:

      hive> select current_timestamp;
      OK
      2018-12-12 22:43:39.024
      

      New hive:

      > select current_timestamp;
      +--------------------------+
      |           _c0            |
      +--------------------------+
      | 2018-12-12 19:43:57.024  |
      +--------------------------+
      

      Attachments

        1. HIVE-21039.01.patch
          7 kB
          jcamachorodriguez
        2. HIVE-21039.02.patch
          11 kB
          jcamachorodriguez

        Issue Links

          Activity

            People

              jcamacho Jesús Camacho Rodríguez
              zvez Andrey Zinovyev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: