Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

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.

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?