public static SqlOperator getCalciteFn(String hiveUdfName,
      List<RelDataType> calciteArgTypes, RelDataType calciteRetType,
      boolean deterministic, boolean runtimeConstant)
      throws CalciteSemanticException {

    SqlOperator calciteOp;
    CalciteUDFInfo uInf = getUDFInfo(hiveUdfName, calciteArgTypes, calciteRetType);
    switch (hiveUdfName) {
      // Follow hive's rules for type inference as oppose to Calcite's
      // for return type.
      //TODO: Perhaps we should do this for all functions, not just +,-
      case "-":
        calciteOp = new SqlMonotonicBinaryOperator("-", SqlKind.MINUS, 40, true,
            uInf.returnTypeInference, uInf.operandTypeInference, OperandTypes.MINUS_OPERATOR);
        break;
      case "+":
        calciteOp = new SqlMonotonicBinaryOperator("+", SqlKind.PLUS, 40, true,
            uInf.returnTypeInference, uInf.operandTypeInference, OperandTypes.PLUS_OPERATOR);
        break;
      default:
        calciteOp = hiveToCalcite.get(hiveUdfName);
        if (null == calciteOp) {
          calciteOp = new HiveSqlFunction(uInf.udfName, SqlKind.OTHER_FUNCTION, uInf.returnTypeInference,
              uInf.operandTypeInference, uInf.operandTypeChecker,
              SqlFunctionCategory.USER_DEFINED_FUNCTION, deterministic, runtimeConstant);
        }
        break;
    }
    return calciteOp;
  }
This class is used to build immutable hashmaps in the static block above.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/SqlFunctionConverter.java