protected void validateUDF(ASTNode expr, boolean isFunction, TypeCheckCtx ctx, FunctionInfo fi,
        List<T> children) throws SemanticException {
      // Check if a bigint is implicitely cast to a double as part of a comparison
      // Perform the check here instead of in GenericUDFBaseCompare to guarantee it is only run once per operator
      if (exprFactory.isCompareFunction(fi) && children.size() == 2) {
        TypeInfo oiTypeInfo0 = exprFactory.getTypeInfo(children.get(0));
        TypeInfo oiTypeInfo1 = exprFactory.getTypeInfo(children.get(1));

        SessionState ss = SessionState.get();
        Configuration conf = (ss != null) ? ss.getConf() : new Configuration();

        LogHelper console = new LogHelper(LOG);

        if (TypeInfoUtils.isConversionLossy(oiTypeInfo0, oiTypeInfo1)) {
          String error = StrictChecks.checkTypeSafety(conf);
          if (error != null) {
            throw new UDFArgumentException(error);
          }
          String tName0 = oiTypeInfo0.getTypeName();
          String tName1 = oiTypeInfo1.getTypeName();
          console.printError("WARNING: Comparing " + tName0 + " and " + tName1 + " may result in loss of information.");
        }
      }

      // Detect UDTF's in nested SELECT, GROUP BY, etc as they aren't
      // supported
      if (fi.getGenericUDTF() != null) {
        throw new SemanticException(ErrorMsg.UDTF_INVALID_LOCATION.getMsg());
      }
      // UDAF in filter condition, group-by caluse, param of funtion, etc.
      if (fi.getGenericUDAFResolver() != null) {
        if (isFunction) {
          throw new SemanticException(ASTErrorUtils.getMsg(
              ErrorMsg.UDAF_INVALID_LOCATION.getMsg(), (ASTNode) expr.getChild(0)));
        } else {
          throw new SemanticException(ASTErrorUtils.getMsg(
              ErrorMsg.UDAF_INVALID_LOCATION.getMsg(), expr));
        }
      }
      if (!ctx.getAllowStatefulFunctions()) {
        if (exprFactory.isStateful(fi)) {
          throw new SemanticException(ErrorMsg.UDF_STATEFUL_INVALID_LOCATION.getMsg());
        }
      }
    }
@param column  column expression to convert
@param tableFieldTypeInfo TypeInfo to convert to
@return Expression converting column to the type specified by tableFieldTypeInfo
ql/src/java/org/apache/hadoop/hive/ql/parse/type/TypeCheckProcFactory.java