autophagy commented on code in PR #28326:
URL: https://github.com/apache/flink/pull/28326#discussion_r3382094328


##########
flink-table/flink-table-test-utils/src/main/java/org/apache/flink/table/runtime/functions/ProcessTableFunctionTestHarness.java:
##########
@@ -823,49 +1351,78 @@ private Method findEvalMethod() throws 
NoSuchMethodException {
                         "Multiple eval() methods found in "
                                 + functionClass.getSimpleName()
                                 + ". ProcessTableFunction must have exactly 
one eval() method.");
-            } else {
-                return evalMethod;
             }
-        }
 
-        /**
-         * Validates that the eval() method doesn't use unsupported features. 
Temporary, until
-         * context is supported.
-         */
-        private void validateEvalMethodSupported(Method evalMethod, 
List<ArgumentInfo> arguments) {
-            Parameter[] parameters = evalMethod.getParameters();
+            return evalMethod;
+        }
 
-            for (int i = 0; i < parameters.length; i++) {
-                Parameter param = parameters[i];
-                Class<?> paramType = param.getType();
+        @Nullable
+        private static Method findOnTimerMethod(
+                Class<?> functionClass, List<ArgumentInfo> arguments) {
+            List<Method> candidates = 
ExtractionUtils.collectMethods(functionClass, "onTimer");
+            if (candidates.isEmpty()) {

Review Comment:
   Yep, looking at `UserDefinedFunctionHelper.validateClassForRuntime`, it 
basically tries to see if any of the ontimer methods match with `.anyMatch()`. 
The runtime tries to find a method with the context & state parameters, if it 
doesnt find one it tries just with the state params, and then fails. The 
harness works the same way - we _could_ output a warning if theres multiple 
`onTimer` methods but failing would diverge from what the runtime does



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