Support Questions

Find answers, ask questions, and share your expertise

Phoenix timestamp dropping digits

avatar
Master Guru

I have timestamp : 2011-08-28 20:03:01.554797

The last 3 digit fall off when I use timestamp or timestamp (26). I only see the value in whole when I use char(26) but that does not help me. Here are my results:

timestamp --> 2011-08-28 20:03:01.554

timestamp (26) --> 2011-08-28 20:03:01.554

char(26) --> 2011-08-28 20:03:01.554797

1 ACCEPTED SOLUTION

avatar
Master Mentor
@Sunile Manjee

It may be related to client time zone

TIMESTAMP

The timestamp data type. The format is yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]. Mapped to java.sql.Timestamp with an internal representation of the number of nanos from the epoch. The binary representation is 12 bytes: an 8 byte long for the epoch time plus a 4 byte integer for the nanos. Note that the internal representation is based on a number of milliseconds since the epoch (which is based on a time in GMT), while java.sql.Timestamp will format timestamps based on the client's local time zone.

Example:

TIMESTAMP

View solution in original post

4 REPLIES 4

avatar
Master Mentor

avatar
Master Guru

@Neeraj Sabharwal The bug is for hive. I am experiencing this issue with phoenix.

avatar
Master Mentor
@Sunile Manjee

It may be related to client time zone

TIMESTAMP

The timestamp data type. The format is yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]. Mapped to java.sql.Timestamp with an internal representation of the number of nanos from the epoch. The binary representation is 12 bytes: an 8 byte long for the epoch time plus a 4 byte integer for the nanos. Note that the internal representation is based on a number of milliseconds since the epoch (which is based on a time in GMT), while java.sql.Timestamp will format timestamps based on the client's local time zone.

Example:

TIMESTAMP

avatar
Master Guru

@Neeraj Sabharwal I am not sure I completely follow. The sql is being run from phoenix command line. Being so isn't the client should it use epoch? If not how to validate?