tkalkirill commented on code in PR #13544:
URL: https://github.com/apache/ignite/pull/13544#discussion_r3923738230


##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/UserDefinedFunctionsIntegrationTest.java:
##########
@@ -94,6 +94,27 @@ public void testSameSignatureNotRegistered() throws 
Exception {
         assertEquals(1, schema.getFunctions("SAMESIGN").size());
     }
 
+    /** */
+    @Test
+    public void testOverloadedFunctions() {
+        client.getOrCreateCache(new CacheConfiguration<Integer, 
Object>("overloaded-functions")
+            .setSqlSchema("UDF")
+            .setSqlFunctionClasses(OverloadedFunctionsLibrary.class));
+
+        SchemaPlus schema = 
queryProcessor(client).schemaHolder().schema("UDF");
+
+        assertEquals(2, schema.getFunctions("OVERLOADED").size());
+        assertEquals(2, schema.getFunctions("OVERLOADED_TABLE").size());
+        assertEquals(1, schema.getFunctions("SQL_EQUIVALENT").size());

Review Comment:
   This behavior intentionally differs from Java because overload resolution 
uses SQL types. Both int and Integer correspond to SQL INTEGER, so Calcite 
cannot reliably distinguish these overloads and their resolution would depend 
on registration order.
   Therefore, overloads must have different SQL parameter types or parameter 
order. I’ve also documented this behavior in QuerySqlFunction and 
QuerySqlTableFunction.



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