public static HiveDecimal getHiveDecimal(Timestamp timestamp) {
    // The BigDecimal class recommends not converting directly from double to BigDecimal,
    // so we convert through a string...
    Double timestampDouble = TimestampUtils.getDouble(timestamp);
    HiveDecimal result = HiveDecimal.create(timestampDouble.toString());
    return result;
  }
Given an integer representing nanoseconds, write its serialized
value to the byte array b at offset

@param nanos
@param b
@param offset
@return
serde/src/java/org/apache/hadoop/hive/serde2/io/TimestampWritable.java