[ 
https://issues.apache.org/jira/browse/FLINK-33227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

xiaoran updated FLINK-33227:
----------------------------
    Description: 
Currently, the cep mode of the Flink API can support next, notNext, followedBy, 
followedByAny, and notFollowedBy semantics, but Flink SQL only supports next 
semantics. The remaining notNext and followedBy semantics are implemented by 
other alternatives, while the notFollowedBy semantics are not currently 
implemented. At present, this semantics is generally implemented in business 
scenarios, such as judging that a user has placed an order within 15 minutes 
without paying. Therefore, I suggest to provide new functionality to support 
notFollowedBy in sql mode, along with the other three semantics

 

The syntax of enhanced MATCH_RECOGNIZE is proposed as follows:
{code:sql}
MATCH_RECOGNIZE (
    [ PARTITION BY <expr> [, ... ] ]
    [ ORDER BY <expr> [, ... ] ]
    [ MEASURES <expr> [AS] <alias> [, ... ] ]
    [ ONE ROW PER MATCH [ { SHOW TIMEOUT MATCHES } ] |
      ALL ROWS PER MATCH [ { SHOW TIMEOUT MATCHES } ]
    ]
    [ AFTER MATCH SKIP
          {
          PAST LAST ROW   |
          TO NEXT ROW   |
          TO [ { FIRST | LAST} ] <symbol>
          }
    ]
    PATTERN ( <pattern> )
    DEFINE <symbol> AS <expr> [, ... ]
)
{code}
 * [^ <symbol>] is proposed in <pattern> to express the notNext semantic. For 
example, A [^B] is translated to A.notNext(B).
 * {- <symbol> -} is proposed in <pattern> to express the followedBy semantic. 
For example, A \{ B*? -} C is translated to A.followedBy(C).
 * {- symbol1 -} with [^ <symbol2>] is proposed in <pattern> to express the 
notFollowedBy semantic. For example, A -{- B*? -} [^C] is translated to 
A.notFollwedBy(B).

  was:
Currently, the cep mode of the Flink API can support next, notNext, followedBy, 
followedByAny, and notFollowedBy semantics, but Flink SQL only supports next 
semantics. The remaining notNext and followedBy semantics are implemented by 
other alternatives, while the notFollowedBy semantics are not currently 
implemented. At present, this semantics is generally implemented in business 
scenarios, such as judging that a user has placed an order within 15 minutes 
without paying. Therefore, I suggest to provide new functionality to support 
notFollowedBy in sql mode, along with the other three semantics

 

The syntax of enhanced MATCH_RECOGNIZE is proposed as follows:
{code:sql}
MATCH_RECOGNIZE (
    [ PARTITION BY <expr> [, ... ] ]
    [ ORDER BY <expr> [, ... ] ]
    [ MEASURES <expr> [AS] <alias> [, ... ] ]
    [ ONE ROW PER MATCH [ { SHOW TIMEOUT MATCHES } ] |
      ALL ROWS PER MATCH [ { SHOW TIMEOUT MATCHES } ]
    ]
    [ AFTER MATCH SKIP
          {
          PAST LAST ROW   |
          TO NEXT ROW   |
          TO [ { FIRST | LAST} ] <symbol>
          }
    ]
    PATTERN ( <pattern> )
    DEFINE <symbol> AS <expr> [, ... ]
)
{code}
 * [^ <symbol>] is proposed in <pattern> to express the notNext semantic. For 
example, A [^B] is translated to A.notNext(B).
 * {- <symbol> -} is proposed in <pattern> to express the followedBy semantic. 
For example, A {- B*? -} C is translated to A.followedBy(C).
 * {- symbol1 -} with [^ <symbol2>] is proposed in <pattern> to express the 
notFollowedBy semantic. For example, A \{- B*? -} [^C] is translated to 
A.notFollwedBy(B).


> Flink SQL CEP support 'notFollowedBy' semantics
> -----------------------------------------------
>
>                 Key: FLINK-33227
>                 URL: https://issues.apache.org/jira/browse/FLINK-33227
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table SQL / API
>    Affects Versions: 1.16.0
>            Reporter: xiaoran
>            Priority: Major
>
> Currently, the cep mode of the Flink API can support next, notNext, 
> followedBy, followedByAny, and notFollowedBy semantics, but Flink SQL only 
> supports next semantics. The remaining notNext and followedBy semantics are 
> implemented by other alternatives, while the notFollowedBy semantics are not 
> currently implemented. At present, this semantics is generally implemented in 
> business scenarios, such as judging that a user has placed an order within 15 
> minutes without paying. Therefore, I suggest to provide new functionality to 
> support notFollowedBy in sql mode, along with the other three semantics
>  
> The syntax of enhanced MATCH_RECOGNIZE is proposed as follows:
> {code:sql}
> MATCH_RECOGNIZE (
>     [ PARTITION BY <expr> [, ... ] ]
>     [ ORDER BY <expr> [, ... ] ]
>     [ MEASURES <expr> [AS] <alias> [, ... ] ]
>     [ ONE ROW PER MATCH [ { SHOW TIMEOUT MATCHES } ] |
>       ALL ROWS PER MATCH [ { SHOW TIMEOUT MATCHES } ]
>     ]
>     [ AFTER MATCH SKIP
>           {
>           PAST LAST ROW   |
>           TO NEXT ROW   |
>           TO [ { FIRST | LAST} ] <symbol>
>           }
>     ]
>     PATTERN ( <pattern> )
>     DEFINE <symbol> AS <expr> [, ... ]
> )
> {code}
>  * [^ <symbol>] is proposed in <pattern> to express the notNext semantic. For 
> example, A [^B] is translated to A.notNext(B).
>  * {- <symbol> -} is proposed in <pattern> to express the followedBy 
> semantic. For example, A \{ B*? -} C is translated to A.followedBy(C).
>  * {- symbol1 -} with [^ <symbol2>] is proposed in <pattern> to express the 
> notFollowedBy semantic. For example, A -{- B*? -} [^C] is translated to 
> A.notFollwedBy(B).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to