kudu-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mauricio Aristizabal <mauri...@impact.com>
Subject Right way to insert to timestamp column via Java api
Date Wed, 02 May 2018 22:43:20 GMT
Impala docs
<https://www.cloudera.com/documentation/enterprise/5-13-x/topics/impala_timestamp.html>
indicate that "Kudu represents date/time columns using 64-bit values" and
also that "the time portion of a TIMESTAMP value is in nanoseconds", and I
know a Java Date "stores time in milliseconds since January 1, 1970" so
since there is no partialRow.addTimestamp I did a

partialRow.addLong(someJavaUtilDate.getTime() * 1000)

and that seems to work, but it's kinda hokey.  Am I doing this right?

Also, would be nice to update the java sample
<https://github.com/cloudera/kudu-examples/blob/master/java/java-sample/src/main/java/org/kududb/examples/sample/Sample.java>
with a few more column types and operations.

thanks,

-m

-- 
Mauricio Aristizabal
Architect - Data Pipeline
*M * 323 309 4260
*E  *mauricio@impact.com  |  *W * https://impact.com
<https://www.linkedin.com/company/608678/>
<https://www.facebook.com/ImpactMarTech/>
<https://twitter.com/impactmartech>


<http://impactgrowth.com>

Mime
View raw message