phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Taylor <jamestay...@apache.org>
Subject Re: Parsing TIMESTAMP value as HBase bytes
Date Mon, 21 Dec 2015 22:30:32 GMT
Dropping a view doesn't impact your data. Phoenix doesn't support altering
the data type of a column.

On Monday, December 21, 2015, Naor David <tron47@gmail.com> wrote:

> Thanks James.
> This means that If I don't want to delete my data, I can alter the table
> and replicate the TIMESTAMP column to a new UNSIGNED_TIMSTAMP column?
>
> On Mon, Dec 21, 2015 at 10:29 PM, James Taylor <jamestaylor@apache.org
> <javascript:_e(%7B%7D,'cvml','jamestaylor@apache.org');>> wrote:
>
>> Use UNSIGNED_TIMESTAMP instead.
>>
>> On Mon, Dec 21, 2015 at 12:17 PM, Naor David <tron47@gmail.com
>> <javascript:_e(%7B%7D,'cvml','tron47@gmail.com');>> wrote:
>>
>>> Hello,
>>> I'm using Phoenix 4.3.0 in CDH5.4 cluster.
>>> I'm trying to parse a TIMESTAMP column from a table using HBase native
>>> API. (Because I want to get all versions of that column, which I
>>> couldn't do using Phoenix JDBC)
>>>
>>> From the documentation, the TIMESTAMP type is a 12-byte value, 8-byte
>>> for the milliseconds since the epoch, and 4 bytes for the nanoseconds.
>>> My HBase query resulted in a Java byte[] array (which has 12 bytes
>>> indeed)
>>>
>>> from there, I tried parsing the first 8 bytes into a long variable,
>>> and then parsing that long value to a java.sql.Timestamp object.
>>> (let's ignore the 4-bytes for now)
>>> the problem is that the resulting long value is a large Negative
>>> number, which make no sense for a timestamp value.
>>>
>>> Is there a correct method for extracting this long value?
>>>
>>> Thanks,
>>>
>>> David
>>>
>>
>>
>

Mime
View raw message