protected void trunc(ColumnVector inputColVector, ColumnVector outputColVector, int i) {
    BigDecimal input = BigDecimal.valueOf(((DoubleColumnVector) inputColVector).vector[i]);

    double output = trunc(input).doubleValue();
    ((DoubleColumnVector) outputColVector).vector[i] = output;
  }
Vectorized implementation of trunc(number, scale) function for float/double input
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/TruncFloat.java