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

Support Time Zone Specifiers (i.e. "at time zone X")

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      HIVE-14412 introduces a timezone-aware timestamp.

      SQL has a concept of "time zone specifier" which applies to any datetime value expression (which covers time/timestamp with and without timezones). Hive lacks a time type so we can put that aside for a while.

      Examples:
      a. select time_stamp_with_time_zone at time zone '-8:00';
      b. select time_stamp_without_time_zone at time zone LOCAL;

      These statements would adjust the expression from its original timezone into a known target timezone.

      Using the time zone specifier results in a data type that has a time zone. If the original expression lacked a time zone, the result has a time zone. If the original expression had a time zone, the result still has a time zone, possibly a different one.

      LOCAL means to use the session's original default time zone displacement.

      The standard says that dates are not supported with time zone specifiers. It seems common to ignore this rule and allow this, by converting the date to a timestamp and then applying the usual rule.

      The standard only requires an interval or the LOCAL keyword. Some databases allow time zone identifiers like PST.

      Reference: SQL:2011 section 6.31

      Attachments

        Issue Links

          Activity

            People

              libing Bing Li
              cartershanklin Carter Shanklin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: