[
https://issues.apache.org/jira/browse/CALCITE-2746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16724798#comment-16724798
]
Dawid Wysakowicz commented on CALCITE-2746:
-------------------------------------------
I understand it wouldn't be hard to support expressions in {{PARTITION BY}},
though I am not sure if we should. SQL standard unfortunately says nothing what
is supported in PARTITION BY. Oracle throws exception in this case:
{{ORA-00904: : invalid identifier}}
> Cryptic exception when expression used in PARTITION BY clause in
> MATCH_RECOGNIZE
> --------------------------------------------------------------------------------
>
> Key: CALCITE-2746
> URL: https://issues.apache.org/jira/browse/CALCITE-2746
> Project: Calcite
> Issue Type: Bug
> Reporter: Dawid Wysakowicz
> Assignee: Julian Hyde
> Priority: Major
> Labels: match
>
> Query:
> {code}
> SELECT *
> FROM MyTable
> MATCH_RECOGNIZE (
> PARTITION BY (id + 2)
> ORDER BY proctime
> MEASURES
> A.id AS id
> PATTERN (A)
> DEFINE
> A AS name = 'a'
> ) AS T
> {code}
> results in exception:
> {code}
> Caused by: java.lang.ClassCastException: org.apache.calcite.sql.SqlBasicCall
> cannot be cast to org.apache.calcite.sql.SqlIdentifier
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateMatchRecognize(SqlValidatorImpl.java:4885)
> at
> org.apache.calcite.sql.validate.MatchRecognizeNamespace.validateImpl(MatchRecognizeNamespace.java:38)
> at
> org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:972)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:948)
> {code}
> I suggest improving it to give a proper hint that only input reference is
> supported.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)