private void testSetterTimestamp(TypeInfo type) throws HiveException {
    Timestamp[] timestampValues = new Timestamp[vectorSize];
    TimestampColumnVector tcv =
        VectorizedRowGroupGenUtil.generateTimestampColumnVector(true, false,
        vectorSize, new Random(10), timestampValues);
    tcv.isNull[3] = true;

    Object[] values = new Object[this.vectorSize];

    VectorExpressionWriter vew = getWriter(type);
    for (int i = 0; i < vectorSize; i++) {
      values[i] = null;  // setValue() should be able to handle null input
      values[i] = vew.setValue(values[i], tcv, i);
      if (values[i] != null) {
        Writable expected = getWritableValue(type, timestampValues[i]);
        TimestampWritableV2 t1 = (TimestampWritableV2) expected;
        TimestampWritableV2 t2 = (TimestampWritableV2) values[i];
        Assert.assertTrue(t1.equals(t2));
      } else {
        Assert.assertTrue(tcv.isNull[i]);
      }
    }
  }
Unit tests for vector expression writers.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorExpressionWriters.java