korlov42 commented on code in PR #2690:
URL: https://github.com/apache/ignite-3/pull/2690#discussion_r1366962152
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItFunctionsTest.java:
##########
@@ -344,6 +351,193 @@ public void testSubstr() {
assertThrowsWithCause(() -> sql("SELECT SUBSTR('1234567', 1, -3)"),
IgniteException.class, "negative substring length");
}
+ /** Test cases for ROUND function that accepts integral numeric types. */
+ @TestFactory
+ public Stream<DynamicTest> testRoundIntegral() {
Review Comment:
please rewrite these tests without TestFactory. You don't need `TestFactory`
until you are working on a test framework.
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/IgniteMethod.java:
##########
@@ -122,6 +128,25 @@ public enum IgniteMethod {
method = Types.lookupMethod(clazz, methodName, argumentTypes);
}
+ /**
+ * Constructor that allows to specify overloaded methods as SQL function
implementations.
+ *
+ * @param clazz Class where to lookup method.
+ * @param methodName Method name.
+ * @param overloadedMethod If {@code true} to looks up overloaded methods,
otherwise looks up a method w/o parameters.
+ */
+ IgniteMethod(Class<?> clazz, String methodName, boolean overloadedMethod) {
+ if (overloadedMethod) {
+ // Allow calcite to select appropriate method at a call site.
+ this.method = Arrays.stream(IgniteSqlFunctions.class.getMethods())
Review Comment:
that's kinda strange decision: you have particular class as input argument,
yet you are using `IgniteSqlFunctions.class`
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/RexImpTable.java:
##########
@@ -1145,6 +1146,11 @@ private void defineMethod(SqlOperator operator, Method
method,
map.put(operator, new MethodImplementor(method, nullPolicy, false));
}
+ private void defineIgniteMethod(SqlOperator operator, String method,
Review Comment:
I think, this can be deleted
--
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]