Martijn Visser created FLINK-41693:
--------------------------------------
Summary: MATCH_RECOGNIZE optional variable behaves reluctantly
Key: FLINK-41693
URL: https://issues.apache.org/jira/browse/FLINK-41693
Project: Flink
Issue Type: Bug
Components: Library / CEP
Reporter: Martijn Visser
The docs list the greedy optional quantifier as supported, but {{A?}} behaves
reluctantly: Flink emits the match without A as soon as the next variable
accepts the row. With {{PATTERN (A? B)}}, both conditions true and two rows,
Trino returns one match with A=1, B=2 and Flink returns two matches that only
contain B. {{A\{0,1\}}} behaves the same.
{{MatchRecognizeITCase#testAggregates}} asserts this for its {{D?}}, so its
expected output changes with the fix. The fix depends on FLINK-D1, since
{{greedy()}} does not backtrack. FLINK-33538 describes the same early emission
in the Pattern API.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)