codehaus


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (CALCITE-2746) Cryptic exception when expression used in PARTITION BY clause in MATCH_RECOGNIZE


Dawid Wysakowicz created CALCITE-2746:
-----------------------------------------

             Summary: 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


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)