@Test
  public void testCastDateToStringWithFormat() throws HiveException {
    VectorizedRowBatch b = TestVectorMathFunctions.getVectorizedRowBatchDateInStringOutFormatted();
    BytesColumnVector resultV = (BytesColumnVector) b.cols[1];
    VectorExpression expr = new CastDateToStringWithFormat(0, "yyyy".getBytes(), 1);
    expr.evaluate(b);
    verifyString(0, "2019", resultV);
    verifyString(1, "1776", resultV);
    verifyString(2, "2012", resultV);
    verifyString(3, "1580", resultV);
    verifyString(4, "0005", resultV);
    verifyString(5, "9999", resultV);

    expr = new CastDateToStringWithFormat(0, "MM".getBytes(), 1);
    resultV = new BytesColumnVector();
    b.cols[1] = resultV;
    expr.evaluate(b);
    verifyString(0, "12", resultV);
    verifyString(1, "07", resultV);
    verifyString(2, "02", resultV);
    verifyString(3, "08", resultV);
    verifyString(4, "01", resultV);
    verifyString(5, "12", resultV);
  }
Tests vectorized type cast udfs CastDateToStringWithFormat, CastTimestampToStringWithFormat,
CastStringToDateWithFormat, CastStringToTimestampWithFormat.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCastsWithFormat.java