You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "snuyanzin (via GitHub)" <gi...@apache.org> on 2026/08/23 08:41:30 UTC
[PR] [CALCITE-7734] `MATCH_RECOGNIZE` with an unqualified column in `MEASURES`/`DEFINE` produces an unusable plan [calcite]
snuyanzin opened a new pull request, #5210:
URL: https://github.com/apache/calcite/pull/5210
## Jira Link
[CALCITE-7734](https://issues.apache.org/jira/browse/CALCITE-7734)
## Changes Proposed
The PR fixes plan for `MATCH_RECOGNIZE` broken while CALCITE-7480
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7734] `MATCH_RECOGNIZE` with an unqualified column in `MEASURES`/`DEFINE` produces an unusable plan [calcite]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #5210:
URL: https://github.com/apache/calcite/pull/5210#discussion_r3876214145
##########
core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java:
##########
@@ -4934,6 +4934,11 @@ private RexNode convertIdentifier(
String pv = null;
if (bb.isPatternVarRef && identifier.names.size() > 1) {
pv = identifier.names.get(0);
+ // A qualifier that is not a declared pattern variable denotes the universal variable "*".
+ if (bb.scope instanceof MatchRecognizeScope
+ && !((MatchRecognizeScope) bb.scope).getPatternVars().contains(pv)) {
Review Comment:
yeah, you are right, good catch
updated PR and added a couple of more tests around this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7734] `MATCH_RECOGNIZE` with an unqualified column in `MEASURES`/`DEFINE` produces an unusable plan [calcite]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on PR #5210:
URL: https://github.com/apache/calcite/pull/5210#issuecomment-5460850328
rebased and squashed before merging
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7734] `MATCH_RECOGNIZE` with an unqualified column in `MEASURES`/`DEFINE` produces an unusable plan [calcite]
Posted by "zzwqqq (via GitHub)" <gi...@apache.org>.
zzwqqq commented on code in PR #5210:
URL: https://github.com/apache/calcite/pull/5210#discussion_r3869470531
##########
core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java:
##########
@@ -4934,6 +4934,11 @@ private RexNode convertIdentifier(
String pv = null;
if (bb.isPatternVarRef && identifier.names.size() > 1) {
pv = identifier.names.get(0);
+ // A qualifier that is not a declared pattern variable denotes the universal variable "*".
+ if (bb.scope instanceof MatchRecognizeScope
+ && !((MatchRecognizeScope) bb.scope).getPatternVars().contains(pv)) {
Review Comment:
Would this be handled correctly if the input table alias has the same name as a pattern variable? For example:
```
FROM a_source AS A
MATCH_RECOGNIZE (
MEASURES commission AS c
PATTERN (A B)
DEFINE
A AS A.empid >= 0,
B AS B.empid < 0
)
```
Here, `A` is both the input table alias and a pattern variable. I am not sure whether Calcite considers this case valid.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7734] `MATCH_RECOGNIZE` with an unqualified column in `MEASURES`/`DEFINE` produces an unusable plan [calcite]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin merged PR #5210:
URL: https://github.com/apache/calcite/pull/5210
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7734] `MATCH_RECOGNIZE` with an unqualified column in `MEASURES`/`DEFINE` produces an unusable plan [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5210:
URL: https://github.com/apache/calcite/pull/5210#issuecomment-5460845789
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5210) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5210&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5210&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5210&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [87.5% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5210&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5210&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5210)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7734] `MATCH_RECOGNIZE` with an unqualified column in `MEASURES`/`DEFINE` produces an unusable plan [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5210:
URL: https://github.com/apache/calcite/pull/5210#issuecomment-5385202975
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5210) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5210&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5210&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5210&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [90.9% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5210&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5210&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5210)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7734] `MATCH_RECOGNIZE` with an unqualified column in `MEASURES`/`DEFINE` produces an unusable plan [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5210:
URL: https://github.com/apache/calcite/pull/5210#issuecomment-5445822747
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5210) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5210&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5210&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5210&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [87.5% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5210&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5210&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5210)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org