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

Incorrect ordering of matched state events in Flink CEP

    XMLWordPrintableJSON

Details

    Description

      I've stumbled across an unexepected ordering of the matched state events.

      Pattern:

      Pattern<String, ?> pattern = Pattern
          .<String>begin("start")
              .where(new IterativeCondition<String>() {
                  @Override
                  public boolean filter(String s, Context<String> context) throws Exception {
                      return s.startsWith("a-");
                  }
              }).times(4).allowCombinations()
          .followedByAny("end")
              .where(new IterativeCondition<String>() {
                  public boolean filter(String s, Context<String> context) throws Exception {
                      return s.startsWith("b-");
                  }
          }).times(3).consecutive();
      

      Input event sequence:
      a-1, a-2, a-3, a-4, b-1, b-2, b-3

      On b-3 a matched pattern would be triggered.

      Now, in the Map<String, List<IN>> map passed via select in PatternSelectFunction, the list for the "end" state is:
      b-3, b-1, b-2.

      Based on the timestamp of the events (simply using processing time), the correct order should be b-1, b-2, b-3.

      Attachments

        Issue Links

          Activity

            People

              kkl0u Kostas Kloudas
              tzulitai Tzu-Li (Gordon) Tai
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: