[ https://issues.apache.org/jira/browse/CALCITE-1871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16126861#comment-16126861 ]
Dian Fu commented on CALCITE-1871: ---------------------------------- Hi [~ransom], just found that this patch disabled {{NavigationExpander}} and {{NavigationReplacer}}, will we add them back in the future? > Nesting LAST within PREV is not parsed correctly for MATCH_RECOGNIZE > -------------------------------------------------------------------- > > Key: CALCITE-1871 > URL: https://issues.apache.org/jira/browse/CALCITE-1871 > Project: Calcite > Issue Type: Bug > Reporter: Dian Fu > Assignee: Zhiqiang He > Labels: match > Fix For: 1.14.0 > > > For table {{Ticker}}: > {code} > symbol: string > tstamp: long > price: int > {code} > , the {{UP}} in the following sql > {code} > SELECT * > FROM Ticker > MATCH_RECOGNIZE ( > MEASURES > STRT.tstamp AS start_tstamp, > LAST(DOWN.tstamp) AS bottom_tstamp, > LAST(UP.tstamp) AS end_tstamp > ONE ROW PER MATCH > PATTERN (STRT DOWN+ UP+) > DEFINE > DOWN AS DOWN.price < PREV(DOWN.price), > UP AS UP.price > PREV(LAST(DOWN.price, 1), 1) > ) AS T > {code} > is parsed as follows: > {code} > ">(PREV(UP.$2, 0), LAST(DOWN.$2, 1))" > {code} > I think this is not as expected. According to the documentation about > MATCH_RECOGNIZE, it supports nesting {{LAST}}/{{FIRST}} within > {{PREV}}/{{NEXT}} and we should not just ignore the {{PREV}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)