[
https://issues.apache.org/jira/browse/FLINK-3521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15169694#comment-15169694
]
ASF GitHub Bot commented on FLINK-3521:
---------------------------------------
Github user StephanEwen commented on the pull request:
https://github.com/apache/flink/pull/1723#issuecomment-189459860
I like this, especially the natural Scala path. Some concerns, though:
1. As noted before, the fold function in the non-keyed window is not
space constant. That is quite a serious issue, if people count heavy streams in
large windows. That should be fixed.
2. The `reduce(...)` code on the `WindowedStream` creates a pass-through
window function over Iterable, instead of an pass-through internal window
function. The result is that for reduced windows, the single result value is
wrapped and unwrapped, instead of simply passed through. That should be a quite
simple fix.
3. Minor comment, more for future code, (and that applies to virtually
all Scala API code): The code creates function objects in line a lot. As a
result, we have for example at least 10 classes that implement a Flink
ReduceFunction and call a Scala Function2. I would suggest to define that class
once externally (not inline), because it reduces number of subclasses of the
reduce function and that may actually have a positive impact on the JIT
friendliness of some programs (if the number of loaded implementations of
ReduceFunction at any point becomes reasonably small)
> Make Iterable part of method signature for WindowFunction
> ---------------------------------------------------------
>
> Key: FLINK-3521
> URL: https://issues.apache.org/jira/browse/FLINK-3521
> Project: Flink
> Issue Type: Improvement
> Components: Streaming
> Reporter: Aljoscha Krettek
> Assignee: Aljoscha Krettek
> Priority: Blocker
>
> After discussion with [~StephanEwen],[~rmetzger], [~fhueske] it was decided
> that the signature of WindowFunction should be changed.
> Right now, the signature is {{WindowFunction<IN, OUT, KEY, WINDOW>}}. With
> the decision of whether the input is an {{Iterable}} nor not residing in the
> signature of the method on {{WindowedStream}}, for example:
> - {{WindowedStream.apply(WindowFunction<Iterable<IN>>, OUT, KEY, WINDOW>}}
> - {{WindowedStream.apply(ReduceFunction, WindowFunction<IN, OUT, KEY,
> WINDOW>}}
> The {{Iterable<>}} should be moved into the signature of the {{apply}}
> method, so that it is:
> {{void apply(KEY key, W window, Iterable<IN> input, Collector<OUT> out)}}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)