Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Phoenix timestamp dropping digits

Solved Go to solution

Phoenix timestamp dropping digits

Super 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

Accepted Solutions

Re: Phoenix timestamp dropping digits

@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

4 REPLIES 4

Re: Phoenix timestamp dropping digits

Re: Phoenix timestamp dropping digits

Super Guru

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

Re: Phoenix timestamp dropping digits

@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

Re: Phoenix timestamp dropping digits

Super 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?

Don't have an account?
Coming from Hortonworks? Activate your account here