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


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/bridging/BridgingSqlFunction.java:
##########
@@ -228,6 +229,27 @@ public boolean isDeterministic() {
         return resolvedFunction.getDefinition().isDeterministic();
     }
 
+    /**
+     * Compares the function identifier in addition to Calcite's class, name, 
and kind. The name is
+     * only the simple name, so without the identifier the catalog functions 
{@code db1.f} and
+     * {@code db2.f} would be equal, and calls to them with the same operands 
would be merged into
+     * one common sub-expression. Inline functions have no identifier and are 
compared by their
+     * generated name.
+     */
+    @Override
+    public boolean equals(@Nullable Object o) {
+        if (!super.equals(o)) {
+            return false;
+        }
+        final BridgingSqlFunction that = (BridgingSqlFunction) o;

Review Comment:
   there is no check for class before casting.
   Calcite does `getClass` check however nobody guarantees it will hold after 
version update
   also there is no comment about this right before this line



-- 
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