Description
For table Ticker:
symbol: string tstamp: long price: int
, the UP in the following sql
SELECT * FROM Ticker MATCH_RECOGNIZE ( MEASURES STRT.tstamp AS start_tstamp, LAST(DOWN.tstamp) AS up_days, LAST(UP.tstamp) AS total_days PATTERN (STRT DOWN+ UP+) DEFINE DOWN AS DOWN.price < PREV(DOWN.price), UP AS UP.price > PREV(DOWN.price) ) AS T
is parsed as
">(PREV(UP.$2, 0), LAST(DOWN.$2, 1))"
I think this is not correct. PREV defines a physical offset, while LAST defines a logical offset.
Attachments
Issue Links
- duplicates
-
CALCITE-1871 Nesting LAST within PREV is not parsed correctly for MATCH_RECOGNIZE
- Closed