Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Types are organized in the following hierarchy (where the parent is a super type of all the children instances):

  • Type

    • Primitive Type


      • Number


        • DOUBLE


          • FLOAT


            • BIGINT


              • INT


                • SMALLINT


                  • TINYINT



          • STRING



      • BOOLEAN


This type hierarchy defines how the types are implicitly converted in the query language. Implicit conversion is allowed for types from child to an ancestor. So when a query expression expects type1 and the data is of type2, type2 is implicitly converted to type1 if type1 is an ancestor of type2 in the type hierarchy. Note that the type hierarchy allows the implicit conversion of STRING to DOUBLE.

...

Timestamps have been the source of much confusion, so we try to document the intended semantics of Hive.

Timestamp

...

(

...

"

...

This timestamp defines a particular point in time, which is mapped into the local timezone. Thus, "2014-12-12 12:34:56" when written in EST, will become "2014-12-12 09:34:56" when read in PST.

Timestamp ("LocalDateTime" semantics)

...

For example, the timestamp value of "2014-12-12 12:34:56" is decomposed into year, month, day, hour, minute and seconds fields, but with no time zone information available, it . It does not correspond to any specific instant. It will always be the same value regardless of the local time zone. Unless your application uses UTC consistently, timestamp with local time zone is strongly preferred over timestamp for most applications. When users say an event is at 10:00, it is always in reference to a certain timezone and means a point in time, rather than 10:00 in an arbitrary time zone.

Timestamp with local time zone ("Instant" semantics)

Java's "Instant" timestamps define a point in time that remains constant regardless of where the data is read. Thus, the timestamp will be adjusted by the local time zone to match the original point in time.


TypeValue in America/Los_AngelesValue in America/New_York
timestamp2014-12-12 12:34:56

2014-12-12 12:34:56

timestamp with local time zone2014-12-12 12:34:562014-12-12 15:34:56


Built In Operators and Functions

...