Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive, mail # user - Is this a Bug in from_utc_timestamp?

Copy link to this message
Is this a Bug in from_utc_timestamp?
John Omernik 2013-11-19, 18:14
There are some discussions on this

However, one person is stating there is not an issue with timestamp, thus I
am asking this question: is this a bug in from_utc_timestamp?


I have a column starttime with the value 1384495201 in it (it's stored as
string, hence the cast)

I select it out

select starttime, from_utc_timestamp(cast(starttime as double), 'UTC') from

Here is how I describe what SHOULD happen:

starttime is epoch time, thus it is by nature, timezone less.  There is no
timezone in Epoch time because it is defined as the number of seconds from
a certain point in time, at a certain timezone. Ok, so I am casting that
into a hive timestamp, which is also timezone less. Right?  Based on that,
I want to print the timestamp using the from_utc_timestamp (which has no
timezone) in a human readable format, applying a timezone UTC).  Ok

What should the result be? 2013-11-15 06:00:01   I had an epoch time
(timezone less) I converted to timestamp (timezone less) and I wanted to
print that time in human readable applying the timezone UTC, thus
2013-11-15 06:00:01 is correct.

What prints?

2013-11-15 00:00:01

It appears that somewhere in that process there is an implicit conversion
using the timezone of my cluster (-6). This makes NO sense from Epoch time
to timezone should be affected by timezone, both are timezoneless, from
timestamp to human readable, with a specified timezone, should take the
specified timezone.   Should I open a JIRA or is there another way to
look/address this?