You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/16 03:11:57 UTC

[GitHub] [flink] Myracle commented on a diff in pull request #19182: [FLINK-26771][Hive] Hive dialect supports to compare boolean type with numeric/string type

Myracle commented on code in PR #19182:
URL: https://github.com/apache/flink/pull/19182#discussion_r873293995


##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/copy/HiveParserSqlFunctionConverter.java:
##########
@@ -415,24 +425,73 @@ public static SqlOperator getCalciteFn(
                                 OperandTypes.PLUS_OPERATOR);
                 break;
             default:
-                calciteOp = HIVE_TO_CALCITE.get(hiveUdfName);
-                if (null == calciteOp) {
-                    calciteOp =
-                            new CalciteSqlFn(
-                                    uInf.udfName,
-                                    uInf.identifier,
-                                    SqlKind.OTHER_FUNCTION,
-                                    uInf.returnTypeInference,
-                                    uInf.operandTypeInference,
-                                    uInf.operandTypeChecker,
-                                    SqlFunctionCategory.USER_DEFINED_FUNCTION,
-                                    deterministic);
+                // some functions should be handled as Hive UDF for
+                // the Hive specific logic
+                if (shouldHandleAsHiveUDF(uInf) && canHandledAsHiveUDF(uInf, functionConverter)) {
+                    calciteOp = asCalciteSqlFn(uInf, deterministic);
+                } else {
+                    calciteOp = HIVE_TO_CALCITE.get(hiveUdfName);

Review Comment:
   A few minor suggestions:
   
   1. The comments should be started with a capital letter.
   2. shouldHandleAsHiveUDF->shouldHandledAsHiveUDF to be consistent with canHandledAsHiveUDF



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org