@Test
  public void testCastStringToDateWithFormat() throws HiveException {
    VectorizedRowBatch b =
        TestVectorMathFunctions.getVectorizedRowBatchStringInDateOutFormatted();
    LongColumnVector resultV;
    resultV = new LongColumnVector();
    b.cols[1] = resultV;
    VectorExpression expr = new CastStringToDateWithFormat(0, "yyyy.mm.dd".getBytes(), 1);
    expr.evaluate(b);

    Assert.assertEquals(Date.valueOf("2019-12-31").toEpochDay(), resultV.vector[0]);
    Assert.assertEquals(Date.valueOf("1776-07-04").toEpochDay(), resultV.vector[1]);
    Assert.assertEquals(Date.valueOf("2012-02-29").toEpochDay(), resultV.vector[2]);
    Assert.assertEquals(Date.valueOf("1580-08-08").toEpochDay(), resultV.vector[3]);
    Assert.assertEquals(Date.valueOf("0005-01-01").toEpochDay(), resultV.vector[4]);
    Assert.assertEquals(Date.valueOf("9999-12-31").toEpochDay(), resultV.vector[5]);
  }
Tests vectorized type cast udfs CastDateToStringWithFormat, CastTimestampToStringWithFormat,
CastStringToDateWithFormat, CastStringToTimestampWithFormat.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCastsWithFormat.java