Github user dawidwys commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4039#discussion_r120412137
  
    --- Diff: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java
 ---
    @@ -507,12 +505,41 @@ public AllWindowedStream(DataStream<T> input,
                TypeInformation<V> aggResultType = 
TypeExtractor.getAggregateFunctionReturnType(
                                aggFunction, input.getType(), null, false);
     
    -           TypeInformation<R> resultType = 
TypeExtractor.getUnaryOperatorReturnType(
    -                           windowFunction, AllWindowFunction.class, true, 
true, aggResultType, null, false);
    +           TypeInformation<R> resultType = 
getAllWindowFunctionReturnType(windowFunction, aggResultType);
     
                return aggregate(aggFunction, windowFunction, accumulatorType, 
aggResultType, resultType);
        }
     
    +   private static <IN, OUT> TypeInformation<OUT> 
getAllWindowFunctionReturnType(
    +                   AllWindowFunction<IN, OUT, ?> function,
    +                   TypeInformation<IN> inType) {
    +           return TypeExtractor.getUnaryOperatorReturnType(
    +                   function,
    +                   AllWindowFunction.class,
    +                   0,
    +                   1,
    +                   new int[]{1, 0},
    +                   new int[]{2, 0},
    +                   inType,
    +                   null,
    +                   false);
    +   }
    +
    +   private static <IN, OUT> TypeInformation<OUT> 
getProcessAllWindowFunctionReturnType(
    +                   ProcessAllWindowFunction<IN, OUT, ?> function,
    +                   TypeInformation<IN> inType) {
    +           return TypeExtractor.getUnaryOperatorReturnType(
    +                   function,
    +                   ProcessAllWindowFunction.class,
    +                   0,
    +                   1,
    +                   new int[]{1, 0},
    --- End diff --
    
    I think `ProcessAllWindowFunction` is a `FunctionalInterface`. The only 
abstract method `process`. All other methods have default implementation, so 
you can pass lambda as `ProcessAllWindowFunction`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to