phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Taylor <jamestay...@apache.org>
Subject Re: Differences between the date/time types
Date Fri, 17 Mar 2017 17:13:38 GMT
The DATE and TIME types in Phoenix are more or less the same. They store
their data as an 8 byte long Epoch time and maintain millisecond
granularity.

The TIMESTAMP stores nanosecond data in a 12 bytes - an 8 byte long Epoch
time plus 4 bytes for nanoseconds. Unless you need nanosecond granularity,
I'd stick to using DATE.

Not sure what you mean by "parse". You should use JDBC APIs to access the
data which will return to you a sql Date or sql Time instance. Apart from
that, we have no public APIs to work with these (but you're welcome to look
at the type code in PDate, PTime, and PTimestamp).

The UNSIGNED date types are the same as above, except they use the HBase
Bytes utility methods to serialize/deserialize the 8 byte part of the
date/time. This means you can only store dates greater than 1-1-1970 while
our the other date types allow the value to be negative as well.

HTH. Thanks,

    James

On Fri, Mar 17, 2017 at 2:21 AM, Cheyenne Forbes <
cheyenne.osanu.forbes@gmail.com> wrote:

> Anyone?
>

Mime
View raw message