private static HiveDecimal timestampToDecimal(Timestamp ts) {
    BigDecimal d = new BigDecimal(getSeconds(ts));
    d = d.add(new BigDecimal(ts.getNanos()).divide(new BigDecimal(BILLION)));
    return HiveDecimal.create(d);
  }
Test timestamps that don't necessarily fit between 1970 and 2038. This depends on HIVE-4525
being fixed.
serde/src/test/org/apache/hadoop/hive/serde2/io/TestTimestampWritableV2.java