private static VectorExpressionWriter genVectorExpressionWritableTimestamp(
      SettableTimestampObjectInspector fieldObjInspector) throws HiveException {

    return new VectorExpressionWriterTimestamp() {
      private Object obj;

      public VectorExpressionWriter init(SettableTimestampObjectInspector objInspector) throws HiveException {
        super.init(objInspector);
        obj = initValue(null);
        return this;
      }

      @Override
      public Object writeValue(TimestampWritableV2 value) throws HiveException {
        return ((SettableTimestampObjectInspector) this.objectInspector).set(obj, value);
      }

      @Override
      public Object writeValue(Timestamp value) throws HiveException {
        return ((SettableTimestampObjectInspector) this.objectInspector).set(obj, value);
      }

      @Override
      public Object writeValue(HiveIntervalDayTimeWritable value) throws HiveException {
        return ((SettableHiveIntervalDayTimeObjectInspector) this.objectInspector).set(obj, value);
      }

      @Override
      public Object writeValue(HiveIntervalDayTime value) throws HiveException {
        return ((SettableHiveIntervalDayTimeObjectInspector) this.objectInspector).set(obj, value);
      }

      @Override
      public Object setValue(Object field, TimestampWritableV2 value) {
        if (null == field) {
          field = initValue(null);
        }
        return ((SettableTimestampObjectInspector) this.objectInspector).set(field, value);
      }

      @Override
      public Object setValue(Object field, Timestamp value) {
        if (null == field) {
          field = initValue(null);
        }
        return ((SettableTimestampObjectInspector) this.objectInspector).set(field, value);
      }

      @Override
      public Object initValue(Object ignored) {
        return ((SettableTimestampObjectInspector) this.objectInspector).create(new Timestamp(0));
      }
    }.init(fieldObjInspector);
  }
Compiles the appropriate vector expression writers based on a struct object
inspector.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java