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

Fix the issue of interval join java case content in the official document case

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 1.8.0, 1.9.0, 1.10.0, 1.11.0, 1.12.0, 1.13.0, 1.14.0
    • 1.14.0
    • API / DataStream
    • Patch

    Description

      Fix the interval join java case in the official document case:

      Take the flink1.14.0 version document link as an example:
      https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/dev/datastream/operators/joining/#interval-join

      1、Your case is:
      import org.apache.flink.api.java.functions.KeySelector;
      import org.apache.flink.streaming.api.functions.co.ProcessJoinFunction;
      import org.apache.flink.streaming.api.windowing.time.Time;

      ...

      DataStream<Integer> orangeStream = ...
      DataStream<Integer> greenStream = ...

      orangeStream
      .keyBy(<KeySelector>)
      .intervalJoin(greenStream.keyBy(<KeySelector>))
      .between(Time.milliseconds(-2), Time.milliseconds(1))
      .process (new ProcessJoinFunction<Integer, Integer, String(){

      @Override
      public void processElement(Integer left, Integer right, Context ctx, Collector<String> out)

      { out.collect(first + "," + second); }

      });

      2、After repair:
      import org.apache.flink.api.java.functions.KeySelector;
      import org.apache.flink.streaming.api.functions.co.ProcessJoinFunction;
      import org.apache.flink.streaming.api.windowing.time.Time;

      ...

      DataStream<Integer> orangeStream = ...
      DataStream<Integer> greenStream = ...

      orangeStream
      .keyBy(<KeySelector>)
      .intervalJoin(greenStream.keyBy(<KeySelector>))
      .between(Time.milliseconds(-2), Time.milliseconds(1))
      .process (new ProcessJoinFunction<Integer, Integer, String(){

      @Override
      public void processElement(Integer left, Integer right, Context ctx, Collector<String> out)

      { out.collect(left + "," + right); }

      });

      Attachments

        1. case.png
          159 kB
          XiaShengSheng

        Issue Links

          Activity

            People

              Unassigned Unassigned
              XiaShengSheng XiaShengSheng
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified