Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-31841

Redundant local variables in AllWindowedStream#reduce

    XMLWordPrintableJSON

Details

    Description

      Currently, there is two redundant local variables in AllWindowedStream#reduce.

      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>());
      } 

      `callLocation` and `udfName` are not used.

      Attachments

        Issue Links

          Activity

            People

              Wencong Liu Wencong Liu
              Wencong Liu Wencong Liu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: