[
https://issues.apache.org/jira/browse/CALCITE-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18075914#comment-18075914
]
Sergey Nuyanzin commented on CALCITE-7486:
------------------------------------------
Merged as
[bda5286d5a2d5dbf505b062b48f537b511bc7b3f|https://github.com/apache/calcite/commit/bda5286d5a2d5dbf505b062b48f537b511bc7b3f]
> Operators in MATCH_RECOGNIZE don't support SqlLiterals
> ------------------------------------------------------
>
> Key: CALCITE-7486
> URL: https://issues.apache.org/jira/browse/CALCITE-7486
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Sergey Nuyanzin
> Assignee: Sergey Nuyanzin
> Priority: Major
> Labels: pull-request-available
>
> Issue is same for {{LAST}}, {{FIRST}}, {{PREV}}, {{NEXT}}
> example of query
> {code:sql}
> SELECT *
> FROM emp
> MATCH_RECOGNIZE (
> MEASURES
> FIRST(DOWN.empno + DOWN.deptno + 1) AS bottom_total
> PATTERN (DOWN{2,})
> DEFINE
> DOWN AS EMP.EMPNO < 1
> )
> {code}
> while unparsing it will be unparsed as
> {code:sql}
> SELECT `EXPR$0`.`BOTTOM_TOTAL`
> FROM `CATALOG`.`SALES`.`EMP` AS `EMP` MATCH_RECOGNIZE(
> MEASURES FINAL (FIRST(`DOWN`.`EMPNO` + `DOWN`.`DEPTNO`, 0) + FIRST(1, 0)) AS
> `BOTTOM_TOTAL`
> PATTERN (`DOWN` { 2, })
> DEFINE `DOWN` AS `EMP`.`EMPNO` < 1) AS `EXPR$0
> {code}
> the problematic part is {{FIRST(1, 0)}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)