You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "jackylau (Jira)" <ji...@apache.org> on 2020/10/23 02:42:00 UTC

[jira] [Commented] (FLINK-19755) flink cep docs exist looping match when coming to 17, 14 using AFTER MATCH SKIP TO LAST A 

    [ https://issues.apache.org/jira/browse/FLINK-19755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17219422#comment-17219422 ] 

jackylau commented on FLINK-19755:
----------------------------------

hi [~jark] [~dianfu], i modify the data to solve the looping match, could you please review it ,thanks?

> flink cep docs exist looping match when coming to 17, 14 using AFTER MATCH SKIP TO LAST A 
> ------------------------------------------------------------------------------------------
>
>                 Key: FLINK-19755
>                 URL: https://issues.apache.org/jira/browse/FLINK-19755
>             Project: Flink
>          Issue Type: Bug
>          Components: Library / CEP
>    Affects Versions: 1.11.0
>            Reporter: jackylau
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.12.0
>
>
> {code:java}
>  symbol   tax   price         rowtime
> ======== ===== ======= =====================
>  XYZ      1     7       2018-09-17 10:00:01
>  XYZ      2     9       2018-09-17 10:00:02
>  XYZ      1     10      2018-09-17 10:00:03
>  XYZ      2     5       2018-09-17 10:00:04
>  XYZ      2     17      2018-09-17 10:00:05
>  XYZ      2     14      2018-09-17 10:00:06
> SELECT *
> FROM Ticker
>     MATCH_RECOGNIZE(
>         PARTITION BY symbol
>         ORDER BY rowtime
>         MEASURES
>             SUM(A.price) AS sumPrice,
>             FIRST(rowtime) AS startTime,
>             LAST(rowtime) AS endTime
>         ONE ROW PER MATCH
>         [AFTER MATCH STRATEGY]
>         PATTERN (A+ C)
>         DEFINE
>             A AS SUM(A.price) < 30
>     )
>  
> {code}
> {code:java}
> AFTER MATCH SKIP TO LAST A 
> symbol   sumPrice        startTime              endTime
> ======== ========== ===================== =====================
>  XYZ      26         2018-09-17 10:00:01   2018-09-17 10:00:04
>  XYZ      15         2018-09-17 10:00:03   2018-09-17 10:00:05
>  XYZ      22         2018-09-17 10:00:04   2018-09-17 10:00:06
>  XYZ      17         2018-09-17 10:00:05   2018-09-17 10:00:06
> Again, the first result matched against the rows #1, #2, #3, #4.Compared to the previous strategy, the next match includes only row #3 (mapped to A) again for the next matching.
> Therefore, the second result matched against the rows #3, #4, #5.
> The third result matched against the rows #4, #5, #6.
> The last result matched against the rows #5, #6.{code}
> h5. i think it will exist looping match when coming to 17, 14 using "AFTER MATCH SKIP TO LAST A "



--
This message was sent by Atlassian Jira
(v8.3.4#803005)