@Override
    public Object setValue(Object field, ColumnVector column, int row) throws HiveException {
      TimestampColumnVector dcv = (TimestampColumnVector) column;
      TimestampWritableV2 timestampWritable = (TimestampWritableV2) dcv.getScratchWritable();
      if (timestampWritable == null) {
        timestampWritable = new TimestampWritableV2();
        dcv.setScratchWritable(timestampWritable);
      }
      if (dcv.noNulls && !dcv.isRepeating) {
        return setValue(field, TimestampUtils.timestampColumnVectorWritable(dcv, row, timestampWritable));
      } else if (dcv.noNulls && dcv.isRepeating) {
        return setValue(field, TimestampUtils.timestampColumnVectorWritable(dcv, 0, timestampWritable));
      } else if (!dcv.noNulls && !dcv.isRepeating && !dcv.isNull[row]) {
        return setValue(field, TimestampUtils.timestampColumnVectorWritable(dcv, row, timestampWritable));
      } else if (!dcv.noNulls && !dcv.isRepeating && dcv.isNull[row]) {
        return null;
      } else if (!dcv.noNulls && dcv.isRepeating && !dcv.isNull[0]) {
        return setValue(field, TimestampUtils.timestampColumnVectorWritable(dcv, 0, timestampWritable));
      } else if (!dcv.noNulls && dcv.isRepeating && dcv.isNull[0]) {
        return null;
      }
      throw new HiveException(
          String.format(
              "Incorrect null/repeating: row:%d noNulls:%b isRepeating:%b isNull[row]:%b isNull[0]:%b",
              row, dcv.noNulls, dcv.isRepeating, dcv.isNull[row], dcv.isNull[0]));
    }
Specialized writer for TimestampColumnVector. Will throw cast exception
if the wrong vector column is used.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java