jerrypeng commented on a change in pull request #1758: Windowing for Pulsar 
Functions
URL: https://github.com/apache/incubator-pulsar/pull/1758#discussion_r187530714
 
 

 ##########
 File path: 
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstance.java
 ##########
 @@ -61,8 +67,21 @@ public JavaInstance(InstanceConfig config, Object 
userClassObject,
         // create the functions
         if (userClassObject instanceof Function) {
             this.function = (Function) userClassObject;
-        } else {
-            this.javaUtilFunction = (java.util.function.Function) 
userClassObject;
+        } else if (userClassObject instanceof java.util.function.Function) {
+            Class<?>[] typeArgs = TypeResolver.resolveRawArguments(
+                    java.util.function.Function.class, 
userClassObject.getClass());
+            // check if window function
+            if (typeArgs[0].equals(Collection.class)) {
 
 Review comment:
   yup good catch!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to