@Test
  public void testTimestampPrecision6() throws Exception {
    props.setProperty(TeradataBinarySerde.TD_TIMESTAMP_PRECISION, "6");
    serde.initialize(null, props, null);

    //2012-10-01 12:00:00.110000
    BytesWritable in = new BytesWritable(
        BaseEncoding.base16().lowerCase().decode("00323031322d31302d30312031323a30303a30302e313130303030"));

    List<Object> row = (List<Object>) serde.deserialize(in);
    Timestamp ts = ((TimestampWritableV2) row.get(0)).getTimestamp();
    Assert.assertEquals(ts.getYear(), 2012);
    Assert.assertEquals(ts.getMonth(), 10);
    Assert.assertEquals(ts.getDay(), 1);
    Assert.assertEquals(ts.getHours(), 12);
    Assert.assertEquals(ts.getMinutes(), 0);
    Assert.assertEquals(ts.getSeconds(), 0);
    Assert.assertEquals(ts.getNanos(), 110000000);

    BytesWritable res = (BytesWritable) serde.serialize(row, serde.getObjectInspector());
    Assert.assertTrue(Arrays.equals(in.copyBytes(), res.copyBytes()));
  }
Test the data type TIMESTAMP for Teradata binary format.
serde/src/test/org/apache/hadoop/hive/serde2/teradata/TestTeradataBinarySerdeForTimeStamp.java