@Override protected void evaluate(LongColumnVector outputColVector, BytesColumnVector inV,
      int i) {
    String dateString =
        new String(inV.vector[i], inV.start[i], inV.length[i], StandardCharsets.UTF_8);
    Date date = formatter.parseDate(dateString.replaceAll("\u0000", ""));
    if (date != null) {
      outputColVector.vector[i] = DateWritableV2.dateToDays(date);
    } else {
      super.setNull(outputColVector, i);
    }
  }
Vectorized UDF for CAST (&lt;STRING&gt; TO DATE WITH FORMAT &lt;STRING&gt;).
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/CastStringToDateWithFormat.java