@Override protected void evaluate(TimestampColumnVector outputColVector,
      BytesColumnVector inputColVector, int i) {
    String inputString =
        new String(inputColVector.vector[i], inputColVector.start[i], inputColVector.length[i],
            StandardCharsets.UTF_8);
    Timestamp timestamp = formatter.parseTimestamp(inputString.replaceAll("\u0000", ""));
    if (timestamp != null) {
      outputColVector.set(i, timestamp.toSqlTimestamp());
    } else {
      super.setNull(outputColVector, i);
    }
  }
Vectorized UDF for CAST (&lt;STRING&gt; TO TIMESTAMP WITH FORMAT &lt;STRING&gt;).
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/CastStringToTimestampWithFormat.java