- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Timestamp in Hive without Timezone
- Labels:
-
Apache Hive
Created ‎02-14-2017 06:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to store the timestamp value in a column in Hive without the timezone part?
For e.g. Oracle supports the timestamp value without a timezone attached to it - https://docs.oracle.com/cd/B19306_01/server.102/b14225/ch4datetime.htm#i1006760
The requirement simply is that store whatever value of the timestamp is given in a column. Currently, Hive automatically applies Day Light Savings adjustment based on the timezone value.
Any inputs are appreciated. Thanks
Created ‎02-14-2017 07:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hive always takes timezone into consideration. May be what you want to try is to set that field as String which will retain the same value.
Created ‎02-15-2017 01:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @bsaini, you can keep it as an int or float representing Unix timestamp in seconds (float if you want to use sub-second units up to nanosec), or a string. From what I see here: Timestamps are interpreted to be timezoneless and stored as an offset from the UNIX epoch. Convenience UDFs for conversion to and from timezones are provided (to_utc_timestamp
, from_utc_timestamp
).
