private void verifyUDFYear(VectorizedRowBatch batch, TestType testType)
      throws HiveException {
    VectorExpression udf = null;
    if (testType == TestType.TIMESTAMP_LONG) {
      udf = new VectorUDFYearTimestamp(0, 1);
      udf.setInputTypeInfos(new TypeInfo[] {TypeInfoFactory.timestampTypeInfo});
    } else {
      udf = new VectorUDFYearString(0, 1);
      udf.setInputTypeInfos(new TypeInfo[] {TypeInfoFactory.stringTypeInfo});
    }
    udf.transientInit(hiveConf);
    udf.evaluate(batch);
    final int in = 0;
    final int out = 1;

    for (int i = 0; i < batch.size; i++) {
      if (batch.cols[in].noNulls || !batch.cols[in].isNull[i]) {
        if (!batch.cols[in].noNulls) {
          Assert.assertEquals(batch.cols[out].isNull[i], batch.cols[in].isNull[i]);
        }
        Timestamp t = readVectorElementAt(batch.cols[in], i);
        long y = ((LongColumnVector) batch.cols[out]).vector[i];
        compareToUDFYearLong(t, (int) y);
      } else {
        Assert.assertEquals(batch.cols[out].isNull[i], batch.cols[in].isNull[i]);
      }
    }
  }
Input array is used to fill the entire size of the vector row batch
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTimestampExpressions.java