public static boolean isCastToIntFamily(Class<? extends UDF> udfClass) {
    return udfClass.equals(UDFToByte.class)
        || udfClass.equals(UDFToShort.class)
        || udfClass.equals(UDFToInteger.class)
        || udfClass.equals(UDFToLong.class);

    // Boolean is purposely excluded.
  }
The GenericUDFs might need their children output to be cast to the given castType.
This method returns a cast expression that would achieve the required casting.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java