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

FoldApplyWindowFunction is not properly initialized

    XMLWordPrintableJSON

Details

    • Important

    Description

      FoldApplyWindowFunction's outputtype is not set.

      We're using constructions like (excerpt):
      .keyBy(0)
      .countWindow(10, 5)
      .fold(...)
      Running this stream gives an runtime exception in FoldApplyWindowFunction:
      "No initial value was serialized for the fold window function. Probably the setOutputType method was not called."

      This can be easily fixed in WindowedStream.java by (around line# 449):
      FoldApplyWindowFunction foldApplyWindowFunction = new FoldApplyWindowFunction<>(initialValue, foldFunction, function);
      foldApplyWindowFunction.setOutputType(resultType, input.getExecutionConfig());

      operator = new EvictingWindowOperator<>(windowAssigner,
      windowAssigner.getWindowSerializer(getExecutionEnvironment().getConfig()),
      keySel,
      input.getKeyType().createSerializer(getExecutionEnvironment().getConfig()),
      stateDesc,
      new InternalIterableWindowFunction<>(foldApplyWindowFunction),
      trigger,
      evictor);

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rvdwenden RWenden
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Time Spent - 10m Remaining Estimate - 50m
                  50m
                  Logged:
                  Time Spent - 10m Remaining Estimate - 50m
                  10m