0
votes

I have a HIVE table which stores timestamp in yyyy-MM-dd HH:mm::ss.S format. But I have noticed that The value in such columns keeps changing, e.g. the value that I sqooped was '2016-01-25 00:00:00.0' but sometimes (not always) this value is shown as '2016-01-24 19:00:00.0'.

To make matters worse, this does not happen in all tables at the same time. Sometimes table1 would have the correct format and table2, the incorrect one (2016-01-24 19:00:00.0) and vice versa

I don't know if this is relevant, but we recently moved from ORACLE to HIVE. In the oracle table the date column was of type 'DATE' which stored datda as 25-JAN-16 but in HIVE the column is of type 'TIMESTAMP' and stores data as 2016-01-25 00:00:00.0.

The timestamp is correct when I sqoop the data but is sometimes incorrect when I check it out later.

Could someone please tell me how I could fix or work around this problem?

1

1 Answers

0
votes

I believe this is because of the timezone problem. Try using timezone UDFs in hive and check whether you are getting it right.

eg. to_utc_timestamp