You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "NobiGo (via GitHub)" <gi...@apache.org> on 2025/03/17 06:39:12 UTC
[PR] [CALCITE-6875] EnumerableFilterRule/EnumerableProjectRule should not … [calcite]
NobiGo opened a new pull request, #4250:
URL: https://github.com/apache/calcite/pull/4250
…convert a Logical Filter/Project to Enumerable Filter/Project when it contains Subquery
--
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-6875] EnumerableFilterRule/EnumerableProjectRule should not … [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4250:
URL: https://github.com/apache/calcite/pull/4250#discussion_r2000560539
##########
core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java:
##########
@@ -135,9 +133,7 @@ public static LogicalFilter create(final RelNode input, RexNode condition,
final RelMetadataQuery mq = cluster.getMetadataQuery();
final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE)
.replaceIfs(RelCollationTraitDef.INSTANCE,
- () -> RelMdCollation.filter(mq, input))
- .replaceIf(RelDistributionTraitDef.INSTANCE,
- () -> RelMdDistribution.filter(mq, input));
+ () -> RelMdCollation.filter(mq, input));
Review Comment:
I try to remove `p.addRelTraitDef(RelDistributionTraitDef.INSTANCE)`, error can not throw.
--
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-6875] EnumerableFilterRule/EnumerableProjectRule should not … [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on code in PR #4250:
URL: https://github.com/apache/calcite/pull/4250#discussion_r2000360541
##########
core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java:
##########
@@ -135,9 +133,7 @@ public static LogicalFilter create(final RelNode input, RexNode condition,
final RelMetadataQuery mq = cluster.getMetadataQuery();
final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE)
.replaceIfs(RelCollationTraitDef.INSTANCE,
- () -> RelMdCollation.filter(mq, input))
- .replaceIf(RelDistributionTraitDef.INSTANCE,
- () -> RelMdDistribution.filter(mq, input));
+ () -> RelMdCollation.filter(mq, input));
Review Comment:
If we don't do this.
testEnumerableFilterRule will throw an exception:
```
There are not enough rules to produce a node with desired properties: convention=ENUMERABLE, dist=any.
Missing conversion is LogicalFilter[convention: NONE -> ENUMERABLE]
There is 1 empty subset: rel#39:RelSubset#1.ENUMERABLE.broadcast, the relevant part of the original plan is as follows
14:LogicalFilter(condition=[NOT(<= SOME($5, {
LogicalProject(COMM=[$6])
LogicalTableScan(table=[[CATALOG, SALES, EMP]])
}))])
8:LogicalTableScan(subset=[rel#13:RelSubset#0.NONE.any], table=[[CATALOG, SALES, EMP]])
```
The mismatch of Trait information leads to the invalidity of the transformed plan.
--
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-6875] EnumerableFilterRule/EnumerableProjectRule should not … [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on code in PR #4250:
URL: https://github.com/apache/calcite/pull/4250#discussion_r2000845332
##########
core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java:
##########
@@ -135,9 +133,7 @@ public static LogicalFilter create(final RelNode input, RexNode condition,
final RelMetadataQuery mq = cluster.getMetadataQuery();
final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE)
.replaceIfs(RelCollationTraitDef.INSTANCE,
- () -> RelMdCollation.filter(mq, input))
- .replaceIf(RelDistributionTraitDef.INSTANCE,
- () -> RelMdDistribution.filter(mq, input));
+ () -> RelMdCollation.filter(mq, input));
Review Comment:
@xiedeyantu We can discuss this issue in CALCITE-6899
--
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-6875] EnumerableFilterRule/EnumerableProjectRule should not … [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on code in PR #4250:
URL: https://github.com/apache/calcite/pull/4250#discussion_r2000845332
##########
core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java:
##########
@@ -135,9 +133,7 @@ public static LogicalFilter create(final RelNode input, RexNode condition,
final RelMetadataQuery mq = cluster.getMetadataQuery();
final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE)
.replaceIfs(RelCollationTraitDef.INSTANCE,
- () -> RelMdCollation.filter(mq, input))
- .replaceIf(RelDistributionTraitDef.INSTANCE,
- () -> RelMdDistribution.filter(mq, input));
+ () -> RelMdCollation.filter(mq, input));
Review Comment:
@xiedeyantu We can discuss this issue in CAICITE-6899
--
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-6875] EnumerableFilterRule/EnumerableProjectRule should not … [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4250:
URL: https://github.com/apache/calcite/pull/4250#issuecomment-2728539400
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4250) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4250&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4250&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4250&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [94.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4250&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4250&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4250)
--
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-6875] EnumerableFilterRule/EnumerableProjectRule should not … [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on code in PR #4250:
URL: https://github.com/apache/calcite/pull/4250#discussion_r2000493302
##########
core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java:
##########
@@ -135,9 +133,7 @@ public static LogicalFilter create(final RelNode input, RexNode condition,
final RelMetadataQuery mq = cluster.getMetadataQuery();
final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE)
.replaceIfs(RelCollationTraitDef.INSTANCE,
- () -> RelMdCollation.filter(mq, input))
- .replaceIf(RelDistributionTraitDef.INSTANCE,
- () -> RelMdDistribution.filter(mq, input));
+ () -> RelMdCollation.filter(mq, input));
Review Comment:
Create CALCITE-6899 to log this issue and use a dynamic table without RelDistributionTraitDef to ensure the test passes.
--
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-6875] EnumerableFilterRule/EnumerableProjectRule should not … [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4250:
URL: https://github.com/apache/calcite/pull/4250#discussion_r1999100632
##########
core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java:
##########
@@ -135,9 +133,7 @@ public static LogicalFilter create(final RelNode input, RexNode condition,
final RelMetadataQuery mq = cluster.getMetadataQuery();
final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE)
.replaceIfs(RelCollationTraitDef.INSTANCE,
- () -> RelMdCollation.filter(mq, input))
- .replaceIf(RelDistributionTraitDef.INSTANCE,
- () -> RelMdDistribution.filter(mq, input));
+ () -> RelMdCollation.filter(mq, input));
Review Comment:
I don't know how this change is related.
--
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-6875] EnumerableFilterRule/EnumerableProjectRule should not … [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo merged PR #4250:
URL: https://github.com/apache/calcite/pull/4250
--
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-6875] EnumerableFilterRule/EnumerableProjectRule should not … [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on code in PR #4250:
URL: https://github.com/apache/calcite/pull/4250#discussion_r2000361644
##########
core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java:
##########
@@ -135,9 +133,7 @@ public static LogicalFilter create(final RelNode input, RexNode condition,
final RelMetadataQuery mq = cluster.getMetadataQuery();
final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE)
.replaceIfs(RelCollationTraitDef.INSTANCE,
- () -> RelMdCollation.filter(mq, input))
- .replaceIf(RelDistributionTraitDef.INSTANCE,
- () -> RelMdDistribution.filter(mq, input));
+ () -> RelMdCollation.filter(mq, input));
Review Comment:
I'm not sure if this is a correct modification because no other test cases cover this point.
--
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