You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by John Omernik <jo...@omernik.com> on 2013/11/19 19:14:43 UTC

Is this a Bug in from_utc_timestamp?

There are some discussions on this
https://issues.apache.org/jira/browse/HIVE-3822

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?

Example:

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
table

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?