protected void truncDate(BytesColumnVector inV, BytesColumnVector outV, int i) {
    if (inV.vector[i] == null) {
      outV.isNull[i] = true;
      outV.noNulls = false;
    }

    String dateString =
        new String(inV.vector[i], inV.start[i], inV.length[i], StandardCharsets.UTF_8);
    if (DateParser.parseDate(dateString, date)) {
      processDate(outV, i, date);
    } else {
      outV.isNull[i] = true;
      outV.noNulls = false;
    }
  }
Vectorized implementation of trunc(date, fmt) function for string input
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/TruncDateFromString.java