You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dian Fu (Jira)" <ji...@apache.org> on 2020/10/27 02:08:00 UTC
[jira] [Updated] (FLINK-19755) Fix CEP documentation error of the
example in 'After Match Strategy' sectio
[ https://issues.apache.org/jira/browse/FLINK-19755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dian Fu updated FLINK-19755:
----------------------------
Summary: Fix CEP documentation error of the example in 'After Match Strategy' sectio (was: flink cep docs exist looping match when coming to 17, 14 using AFTER MATCH SKIP TO LAST A )
> Fix CEP documentation error of the example in 'After Match Strategy' sectio
> ---------------------------------------------------------------------------
>
> Key: FLINK-19755
> URL: https://issues.apache.org/jira/browse/FLINK-19755
> Project: Flink
> Issue Type: Bug
> Components: Documentation, Library / CEP
> Affects Versions: 1.11.0
> Reporter: jackylau
> Assignee: jackylau
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.12.0, 1.11.3
>
> Attachments: 0F2917C8-6C35-43a9-BDD1-FD506906257E.png, 7CA31459-B125-4cea-8C75-3D101C27A9F9.png
>
>
> {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)