Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Impala - bug timestamp

avatar
Champion Alumni

Hello,

 

By doing these 2 queries I get the same result (1412640000):

select unix_timestamp('2014-10-07 00:00:00.209','yyyy-MM-dd HH:mm:ss.SSS') as date_event from myTable;

select unix_timestamp('2014-10-07 00:00:00.100','yyyy-MM-dd HH:mm:ss.SSS') as date_event from myTable;

 

However, by doing I get 1412640001

select unix_timestamp('2014-10-07 00:00:01.100','yyyy-MM-dd HH:mm:ss.SSS') as date_event from myTable; the timestamp changes well;

 

 

I have the feeling that the seconds are not taken into account,

 

My Impalad version is 2.1.0-cdh5 (build e48c2b48c53ea9601b8f47a39373aa83ff7ca6e2)

 

Thank you!

GHERMAN Alina
1 ACCEPTED SOLUTION

avatar
Contributor

Hi, Alina

 

Seconds are taken into unix times, not miliseconds.

 

So,

select unix_timestamp('2014-10-07 00:00:00.999','yyyy-MM-dd HH:mm:ss.SSS') = unix_timestamp('2014-10-07 00:00:00.100','yyyy-MM-dd HH:mm:ss.SSS')

 

Result: True

 

You can check it here

http://www.onlineconversion.com/unix_time.htm

 

FYI

http://en.wikipedia.org/wiki/Unix_time

View solution in original post

1 REPLY 1

avatar
Contributor

Hi, Alina

 

Seconds are taken into unix times, not miliseconds.

 

So,

select unix_timestamp('2014-10-07 00:00:00.999','yyyy-MM-dd HH:mm:ss.SSS') = unix_timestamp('2014-10-07 00:00:00.100','yyyy-MM-dd HH:mm:ss.SSS')

 

Result: True

 

You can check it here

http://www.onlineconversion.com/unix_time.htm

 

FYI

http://en.wikipedia.org/wiki/Unix_time