You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/04/18 12:09:00 UTC

[jira] [Updated] (FLINK-31841) Redundant local variables in AllWindowedStream#reduce

     [ https://issues.apache.org/jira/browse/FLINK-31841?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated FLINK-31841:
-----------------------------------
    Labels: pull-request-available  (was: )

> Redundant local variables in AllWindowedStream#reduce
> -----------------------------------------------------
>
>                 Key: FLINK-31841
>                 URL: https://issues.apache.org/jira/browse/FLINK-31841
>             Project: Flink
>          Issue Type: Improvement
>          Components: API / DataStream
>    Affects Versions: 1.18.0
>            Reporter: Wencong Liu
>            Assignee: Wencong Liu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.18.0
>
>
> Currently, there is two redundant local variables in AllWindowedStream#reduce.
> {code:java}
> public SingleOutputStreamOperator<T> reduce(ReduceFunction<T> function) {
>     if (function instanceof RichFunction) {
>         throw new UnsupportedOperationException(
>                 "ReduceFunction of reduce can not be a RichFunction. "
>                         + "Please use reduce(ReduceFunction, WindowFunction) instead.");
>     }
>     // clean the closure
>     function = input.getExecutionEnvironment().clean(function);
>     String callLocation = Utils.getCallLocationName();
>     String udfName = "AllWindowedStream." + callLocation;
>     return reduce(function, new PassThroughAllWindowFunction<W, T>());
> } {code}
> `callLocation` and `udfName` are not used.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)