snuyanzin commented on code in PR #28113:
URL: https://github.com/apache/flink/pull/28113#discussion_r3194852664


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/utils/ShortcutUtils.java:
##########
@@ -169,6 +177,70 @@ public static boolean isFunctionKind(SqlOperator operator, 
FunctionKind kind) {
         return functionDefinition != null && functionDefinition.getKind() == 
kind;
     }
 
+    public static boolean isOneOfFunctionDefinitions(
+            RexNode rexNode, FunctionDefinition... expectedDefinitions) {
+        if (!(rexNode instanceof RexCall)) {
+            return false;
+        }
+        final RexCall call = (RexCall) rexNode;
+        final FunctionDefinition unwrapped = unwrapFunctionDefinition(call);
+        final String operatorName = call.getOperator().getName();
+        for (FunctionDefinition expected : expectedDefinitions) {
+            if (unwrapped != null && unwrapped == expected) {
+                return true;
+            }
+            if (expected instanceof BuiltInFunctionDefinition
+                    && ((BuiltInFunctionDefinition) expected)
+                            .getName()
+                            .equalsIgnoreCase(operatorName)) {

Review Comment:
   replaced with usage of `FunctionDefinitionQueryable`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to