Sergey Nuyanzin created CALCITE-7734:
----------------------------------------
Summary: MATCH_RECOGNIZE with an unqualified column in
MEASURES/DEFINE produces an unusable plan
Key: CALCITE-7734
URL: https://issues.apache.org/jira/browse/CALCITE-7734
Project: Calcite
Issue Type: Bug
Components: core
Environment: An unqualified {{MEASURES}}/{{DEFINE}} column is expanded
to {{<table>.<col>}}, so the pattern-variable alpha becomes the table name
(e.g. {{LAST(emps.$4)}}) instead of the universal row pattern variable *
({{LAST(*.$4)}}). A table name is not
a pattern variable, so the plan cannot be implemented.
for instance
{code:sql}
SELECT * FROM "hr"."emps" match_recognize (
ORDER BY "empid" DESC
MEASURES "commission" AS c
PATTERN (s up)
DEFINE up AS "commission" < prev("commission"))
{code}
produces plan containing
{{LAST(emps.$4, ...)}} instead of {{LAST(*.$4, ...)}}
Reporter: Sergey Nuyanzin
Assignee: Sergey Nuyanzin
--
This message was sent by Atlassian Jira
(v8.20.10#820010)