Support Questions
Find answers, ask questions, and share your expertise

PutHBaseJSON - Timestamp

Highlighted

PutHBaseJSON - Timestamp

Explorer

Hi All,

Has anyone worked with the PutHabseJSON processor Timestamp field?

I'm trying to pass an attribute(op_ts) which contains the time stamp("2018-03-09 01:15:15.000000") as below

Timestamp : ${op_ts}

But it errors out with the below message

Invalid timestamp value: 2018-03-09 01:15:15.000000: java.lang.NumberFormatException: For input string: "2018-03-09 01:15:15.000000"

I then tried converting it into number format using the below EL

Timestamp :${op_ts:toDate("YYYY-MM-dd HH:mm:ss.SSSSSS"):toNumber()}

The insert works fine but the timestamp value in Hbase is not correct.

E.g.

"2018-03-10 05:15:15.000000" is converted into Hbase timestamp 1514664915000 ( when i convert it back to Timestamp using (https://www.epochconverter.com/) it turns out to be Sunday, December 31, 2017 5:15:15 AM

"2017-06-03 05:15:15.000000" is converted into Hbase timestamp 1483215315000 ( when i convert it back to Timestamp using it turns out to be Sunday, January 1, 2017 5:15:15 AM

Please help!