@Override
  protected void func(DecimalColumnVector outV, DoubleColumnVector inV, int i) {
    HiveDecimalWritable decWritable = outV.vector[i];

    // TEMPORARY: In order to avoid a new version of storage-api, do the conversion here...
    byte[] floatBytes = Float.toString((float) inV.vector[i]).getBytes();
    decWritable.setFromBytes(floatBytes, 0, floatBytes.length);
    if (!decWritable.mutateEnforcePrecisionScale(outV.precision, outV.scale)) {
      outV.isNull[i] = true;
      outV.noNulls = false;
    }
  }
Cast input float to a decimal. Get target value scale from output column vector.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/CastFloatToDecimal.java