Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-12191 Hive timestamp problems
  3. HIVE-12195

Unknown zones should cause an error instead of silently failing

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Hive

    Description

      Using an unknown time zone with the from_utc_timestamp or to_utc_timetamp methods returns the time un-adjusted instead of throwing an error:

      hive> select from_utc_timestamp('2015-04-11 12:24:34.535', 'panda');
      OK
      2015-04-11 12:24:34.535
      

      This should be an error because users may attempt to adjust to valid but unknown zones, like PDT or MDT. This would produce incorrect results with no warning or error.

      Update: A good work-around is to add a table of known zones that maps to offset zone identifiers, like GMT-07:00. The table is small enough to always be a broadcast join and results can be filtered (e.g. offset_zone IS NOT NULL) so that only valid zones are passed to from_utc_timestamp.

      Attachments

        1. HIVE-12195.1.patch
          3 kB
          Shinichi Yamashita
        2. HIVE-12195.2.patch
          13 kB
          Shinichi Yamashita
        3. HIVE-12195.3.patch
          14 kB
          Shinichi Yamashita
        4. HIVE-12195.4.patch
          14 kB
          Shinichi Yamashita

        Issue Links

          Activity

            People

              sinchii Shinichi Yamashita
              rdblue Ryan Blue
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: