You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "xiedeyantu (via GitHub)" <gi...@apache.org> on 2025/04/12 04:06:07 UTC
[PR] [CALCITE-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
xiedeyantu opened a new pull request, #4301:
URL: https://github.com/apache/calcite/pull/4301
(no comment)
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2043177130
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set update-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
Review Comment:
let's call this "planner-rules" instead of "update-rules"
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2047030358
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,89 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+
+# The following line is used to update the default planner rules.
Review Comment:
Added some instructions
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2807926274
> > Updating the process of Rules in Planner makes it seem very complicated. We can't just construct a new Planner directly?
>
> The planner has a lot of rules, I don't expect you want to insert them all by hand. All the enumerable rules are needed to generate running code.
If you directly rebuild a default Planner, it will come with default Rules. Is it because I misunderstood somewhere?
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2045178436
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -59,9 +59,9 @@ EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[sem
EnumerableValues(tuples=[[{ 0 }, { 1 }]])
!plan
-!set reset-rules ""
+!set planner-rules original
-# Test reset-rules can reset init rules
+# Test that rules set by "!set planner-rules original" are sticky
Review Comment:
"sticky" means that they can be reused across multiple tests.
this is not what you are testing here.
you are really testing that this brings back the original rules (to some degree)
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2800666798
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4301) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4301&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4301&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4301&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [89.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4301&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4301&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4301)
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2043176782
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set update-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
+
+# Test INTERSECT_TO_SEMI_JOIN
+with t (i) as (values (0), (1))
+select * from t as t1
+intersect
+select * from t as t2 where t2.i > 0;
++---+
+| I |
++---+
+| 1 |
++---+
+(1 row)
+
+!ok
+
+EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[semi])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+ EnumerableCalc(expr#0=[{inputs}], expr#1=[0], expr#2=[>($t0, $t1)], EXPR$0=[$t0], $condition=[$t2])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+!plan
+
+# Test no reset-rules can keep rules
+with t (i) as (values (0), (1))
+select * from t as t1
+intersect
+select * from t as t2 where t2.i > 0;
++---+
+| I |
++---+
+| 1 |
++---+
+(1 row)
+
+!ok
+
+EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[semi])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+ EnumerableCalc(expr#0=[{inputs}], expr#1=[0], expr#2=[>($t0, $t1)], EXPR$0=[$t0], $condition=[$t2])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+!plan
+
+!set reset-rules ""
Review Comment:
this is a bit ugly
if you want to reuse "!set", maybe you can say "!set optimization-rules original".
Here "original" is not the name of any rule
##########
testkit/src/main/java/org/apache/calcite/test/QuidemTest.java:
##########
@@ -71,6 +77,9 @@ public abstract class QuidemTest {
private static final Pattern PATTERN = Pattern.compile("\\.iq$");
+ // cache original rules
Review Comment:
"Saved original planner rules".
##########
testkit/src/main/java/org/apache/calcite/test/QuidemTest.java:
##########
@@ -171,6 +182,33 @@ protected void checkRun(String path) throws Exception {
int thresholdValue = ((BigDecimal) value).intValue();
closer.add(Prepare.THREAD_INSUBQUERY_THRESHOLD.push(thresholdValue));
}
+ if (propertyName.equals("rules")) {
+ parseRules((String) value);
+ closer.add(
+ Hook.PLANNER.addThread((Consumer<RelOptPlanner>)
+ planner -> {
+ for (RelOptRule rule : addRulesCache) {
+ planner.addRule(rule);
+ }
+ for (RelOptRule rule : removeRulesCache) {
+ planner.removeRule(rule);
+ }
+ }));
+ }
+ if (propertyName.equals("reset-rules")) {
Review Comment:
can you write a test to verify that the planner rules are the same after a reset?
you don't have to do it from the quidem tests, it can be a separate test that just uses the hook
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set update-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
Review Comment:
let's call this "optimization-rules" instead of "update-rules"
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set update-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
+
+# Test INTERSECT_TO_SEMI_JOIN
+with t (i) as (values (0), (1))
+select * from t as t1
+intersect
+select * from t as t2 where t2.i > 0;
++---+
+| I |
++---+
+| 1 |
++---+
+(1 row)
+
+!ok
+
+EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[semi])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+ EnumerableCalc(expr#0=[{inputs}], expr#1=[0], expr#2=[>($t0, $t1)], EXPR$0=[$t0], $condition=[$t2])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+!plan
+
+# Test no reset-rules can keep rules
Review Comment:
test that rules set by "!set update-rules" are sticky
##########
testkit/src/main/java/org/apache/calcite/test/QuidemTest.java:
##########
@@ -187,6 +209,57 @@ protected void checkRun(String path) throws Exception {
}
}
+ private void updatePlanner(RelOptPlanner planner, String value) {
+ List<RelOptRule> rulesAdd = new ArrayList<>();
+ List<RelOptRule> rulesRemove = new ArrayList<>();
+ parseRules(value, rulesAdd, rulesRemove);
+ rulesAdd.forEach(planner::addRule);
+ rulesRemove.forEach(planner::removeRule);
Review Comment:
I don't know if the order of rules in the planner matters.
but just in case, perhaps it's safer to first remove, then add
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2047773653
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,89 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+
+# The following line is used to update the default planner rules.
Review Comment:
I'm very sorry, so I left a mark to make up for my mistake.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2822902367
@NobiGo Sorry to bother you again, is there anything else I can do?
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2829175039
> I think he suggested for you to test locally using a snapshot. Did you do that?
I have tested it locally and it works.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2798497255
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4301) **Quality Gate passed**
Issues
 [3 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4301&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4301&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4301&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [84.7% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4301&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4301&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4301)
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2807915801
> Updating the process of Rules in Planner makes it seem very complicated. We can't just construct a new Planner directly?
The planner has a lot of rules, I don't expect you want to insert them all by hand. All the enumerable rules are needed to generate running code.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2046963721
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set planner-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
Review Comment:
@NobiGo This is a good suggestion, I will add a usage note to the `planner.iq` file. WDYT?
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2041280887
##########
core/src/test/resources/sql/test.iq:
##########
@@ -0,0 +1,63 @@
+# test.iq - Join query tests
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set rules "-CoreRules.INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
+
+# Test one
+with t (i) as (values (0), (1))
+select * from t as t1
+intersect
+select * from t as t2 where t2.i > 0;
++---+
+| I |
++---+
+| 1 |
++---+
+(1 row)
+
+!ok
+
+EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[semi])
Review Comment:
you should have two tests after setting the rules, so we can check whether the rules set apply to the end of the file
##########
core/src/test/resources/sql/test.iq:
##########
@@ -0,0 +1,63 @@
+# test.iq - Join query tests
Review Comment:
you should probably call this file something else, perhaps planner.iq?
the comment is no longer accurate
##########
core/src/test/resources/sql/test.iq:
##########
@@ -0,0 +1,63 @@
+# test.iq - Join query tests
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set rules "-CoreRules.INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
Review Comment:
this doesn't really "set" the rules, it updates them
##########
core/src/test/resources/sql/test.iq:
##########
@@ -0,0 +1,63 @@
+# test.iq - Join query tests
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set rules "-CoreRules.INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
+
+# Test one
+with t (i) as (values (0), (1))
+select * from t as t1
+intersect
+select * from t as t2 where t2.i > 0;
++---+
+| I |
++---+
+| 1 |
++---+
+(1 row)
+
+!ok
+
+EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[semi])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+ EnumerableCalc(expr#0=[{inputs}], expr#1=[0], expr#2=[>($t0, $t1)], EXPR$0=[$t0], $condition=[$t2])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+!plan
+!set reset-rules ""
Review Comment:
this should probably be called "!reset rules"
##########
testkit/src/main/java/org/apache/calcite/test/QuidemTest.java:
##########
@@ -171,6 +182,33 @@ protected void checkRun(String path) throws Exception {
int thresholdValue = ((BigDecimal) value).intValue();
closer.add(Prepare.THREAD_INSUBQUERY_THRESHOLD.push(thresholdValue));
}
+ if (propertyName.equals("rules")) {
+ parseRules((String) value);
+ closer.add(
+ Hook.PLANNER.addThread((Consumer<RelOptPlanner>)
+ planner -> {
+ for (RelOptRule rule : addRulesCache) {
+ planner.addRule(rule);
+ }
+ for (RelOptRule rule : removeRulesCache) {
+ planner.removeRule(rule);
+ }
+ }));
+ }
+ if (propertyName.equals("reset-rules")) {
Review Comment:
I am not sure this undoes the effect of the previous.
In particular, I don't know what the order of the rules is in the planner, and where in the planner the inserted rules will be
Ideally you can save the entire list of planner rules and restore it. I don't know if the hooks allow that
##########
testkit/src/main/java/org/apache/calcite/test/QuidemTest.java:
##########
@@ -71,6 +78,10 @@ public abstract class QuidemTest {
private static final Pattern PATTERN = Pattern.compile("\\.iq$");
+ private List<RelOptRule> addRulesCache = new ArrayList<>();
Review Comment:
even though these are private, I would still document them.
##########
testkit/src/main/java/org/apache/calcite/test/QuidemTest.java:
##########
@@ -187,6 +225,41 @@ protected void checkRun(String path) throws Exception {
}
}
+ private void parseRules(String value) {
+ Pattern pattern = Pattern.compile("([+-])(CoreRules|EnumerableRules)\\.(\\w+)");
+ Matcher matcher = pattern.matcher(value);
+
+ while (matcher.find()) {
+ char operation = matcher.group(1).charAt(0);
+ String ruleSource = matcher.group(2);
+ String ruleName = matcher.group(3);
+
+ try {
+ if (ruleSource.equals("CoreRules")) {
Review Comment:
Maybe this can be the default - if no source is specified, to make the specification of rules shorter
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2802358809
the most important must-have feature is "reset". otherwise you essentially need to create one file per set of rules you want to test
when you add rules, are they inserted in front of the existing ones? how does the hook work?
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2803270157
> the most important must-have feature is "reset". otherwise you essentially need to create one file per set of rules you want to test when you add rules, are they inserted in front of the existing ones? how does the hook work?
The logic here is consistent with that of Hook.PLANNER in JdbcTest. Hook added rules will be added at the end. Hook.PLANNER is entered after all rules are loaded, and it will contain all default rules. In this PR, I record the original default rules when I modify the rule group for the first time, so that I can reset it.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2045808746
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set planner-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
Review Comment:
I suggested to have that prefix implicit, because it makes the text shorter.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2045672906
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -59,9 +59,9 @@ EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[sem
EnumerableValues(tuples=[[{ 0 }, { 1 }]])
!plan
-!set reset-rules ""
+!set planner-rules original
-# Test reset-rules can reset init rules
+# Test that rules set by "!set planner-rules original" are sticky
Review Comment:
Sorry, I fixed this. When I was developing, I found that multiple SQL statements would be affected by the changed rules if I didn't reset them. So I specifically verified this problem when debugging.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2809785358
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4301) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4301&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4301&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4301&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [89.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4301&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4301&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4301)
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2807978488
> > > Updating the process of Rules in Planner makes it seem very complicated. We can't just construct a new Planner directly?
> >
> >
> > The planner has a lot of rules, I don't expect you want to insert them all by hand. All the enumerable rules are needed to generate running code.
>
> If you directly rebuild a default Planner, it will come with default Rules. Is it because I misunderstood somewhere?
When executing the `.iq` file, the planner is no longer rebuild for each SQL statement. The planner is now reused within each connection. We may need to refactor this framework to achieve rebuilding the planner every time.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2047029226
##########
testkit/src/main/java/org/apache/calcite/test/QuidemTest.java:
##########
@@ -171,6 +180,26 @@ protected void checkRun(String path) throws Exception {
int thresholdValue = ((BigDecimal) value).intValue();
closer.add(Prepare.THREAD_INSUBQUERY_THRESHOLD.push(thresholdValue));
}
+ // Configures query planner rules via "!set planner-rules" command.
Review Comment:
Added some instructions
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2047779325
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,89 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+
+# The following line is used to update the default planner rules.
+# "+" means add a rule, "-" means remove a rule. Only the "CoreRules." can be omitted.
+!set planner-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
Review Comment:
It is still needed at this stage. If there are no double quotes, the reading will be considered to end when a comma is encountered.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2830891223
Ok, let's merge this as is, and we can edit once we have multi-line strings.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu merged PR #4301:
URL: https://github.com/apache/calcite/pull/4301
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2829035745
I think he suggested for you to test locally using a snapshot. Did you do that?
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2829054789
> I think he suggested for you to test locally using a snapshot. Did you do that?
Oh, sorry, maybe I misunderstood. I previously modified the `Quidem.java` file directly in calcite for validation, so I will use 0.12-SNAPSHOT for local validation.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2041289037
##########
core/src/test/resources/sql/test.iq:
##########
@@ -0,0 +1,63 @@
+# test.iq - Join query tests
Review Comment:
Good point! I didn’t think that far ahead when writing the demo.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2807742317
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4301) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4301&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4301&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4301&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [89.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4301&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4301&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4301)
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2810243879
Since I have approved, I will wait for @NobiGo to approve 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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2828358042
Another question is whether we wait for a new release of Quidem to pick up the multi-line strings.
Then you can include the upgrade in this PR.
But we should merge this soon, it will be very useful.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2045802385
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set planner-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
Review Comment:
Why not use the prefix "CoreRules." about INTERSECT_TO_DISTINCT?
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set planner-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
+
+# Test INTERSECT_TO_SEMI_JOIN
+with t (i) as (values (0), (1))
+select * from t as t1
+intersect
+select * from t as t2 where t2.i > 0;
++---+
+| I |
++---+
+| 1 |
++---+
+(1 row)
+
+!ok
+
+EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[semi])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+ EnumerableCalc(expr#0=[{inputs}], expr#1=[0], expr#2=[>($t0, $t1)], EXPR$0=[$t0], $condition=[$t2])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+!plan
+
+# Test that rules set by "!set planner-rules" are sticky
Review Comment:
What is the difference between this test case and the previous one?
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2045813970
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set planner-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
Review Comment:
If both CoreRules and EnumerableRules can be omitted, I think there is no problem. But only omitting CoreRules seems a bit strange. However, the rules we usually test are CoreRules.
If we can only omit one of them, we need to add some explanations.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2046963721
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set planner-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
Review Comment:
@NobiGo This is a good suggestion, I have added a usage note to the `planner.iq` file and `QuidemTest.java` file. WDYT?
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2041292056
##########
core/src/test/resources/sql/test.iq:
##########
@@ -0,0 +1,63 @@
+# test.iq - Join query tests
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set rules "-CoreRules.INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
+
+# Test one
+with t (i) as (values (0), (1))
+select * from t as t1
+intersect
+select * from t as t2 where t2.i > 0;
++---+
+| I |
++---+
+| 1 |
++---+
+(1 row)
+
+!ok
+
+EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[semi])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+ EnumerableCalc(expr#0=[{inputs}], expr#1=[0], expr#2=[>($t0, $t1)], EXPR$0=[$t0], $condition=[$t2])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+!plan
+!set reset-rules ""
Review Comment:
I took a shortcut here by piggybacking on the existing logic for 'set'. We could probably extend it with custom commands like !update-rules and !reset-rules, though that might be a bit more work. If needed, I can try implementing it!
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2044312543
##########
testkit/src/main/java/org/apache/calcite/test/QuidemTest.java:
##########
@@ -171,6 +182,33 @@ protected void checkRun(String path) throws Exception {
int thresholdValue = ((BigDecimal) value).intValue();
closer.add(Prepare.THREAD_INSUBQUERY_THRESHOLD.push(thresholdValue));
}
+ if (propertyName.equals("rules")) {
+ parseRules((String) value);
+ closer.add(
+ Hook.PLANNER.addThread((Consumer<RelOptPlanner>)
+ planner -> {
+ for (RelOptRule rule : addRulesCache) {
+ planner.addRule(rule);
+ }
+ for (RelOptRule rule : removeRulesCache) {
+ planner.removeRule(rule);
+ }
+ }));
+ }
+ if (propertyName.equals("reset-rules")) {
Review Comment:
Sorry, I have been thinking for a long time and I don't have a good way. In my opinion, the internal logic is to set the original rule set back when it is reset. If it is not set back, then test3 should not have intersect. I can easily verify this problem by logging locally. But I can't think of a good way to write the test.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2041290124
##########
testkit/src/main/java/org/apache/calcite/test/QuidemTest.java:
##########
@@ -171,6 +182,33 @@ protected void checkRun(String path) throws Exception {
int thresholdValue = ((BigDecimal) value).intValue();
closer.add(Prepare.THREAD_INSUBQUERY_THRESHOLD.push(thresholdValue));
}
+ if (propertyName.equals("rules")) {
+ parseRules((String) value);
+ closer.add(
+ Hook.PLANNER.addThread((Consumer<RelOptPlanner>)
+ planner -> {
+ for (RelOptRule rule : addRulesCache) {
+ planner.addRule(rule);
+ }
+ for (RelOptRule rule : removeRulesCache) {
+ planner.removeRule(rule);
+ }
+ }));
+ }
+ if (propertyName.equals("reset-rules")) {
Review Comment:
Good catch! I’ll have to give this some more thought.
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2807925714
I expect most tests will just insert corerules
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2045808984
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set planner-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
+
+# Test INTERSECT_TO_SEMI_JOIN
+with t (i) as (values (0), (1))
+select * from t as t1
+intersect
+select * from t as t2 where t2.i > 0;
++---+
+| I |
++---+
+| 1 |
++---+
+(1 row)
+
+!ok
+
+EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[semi])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+ EnumerableCalc(expr#0=[{inputs}], expr#1=[0], expr#2=[>($t0, $t1)], EXPR$0=[$t0], $condition=[$t2])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+!plan
+
+# Test that rules set by "!set planner-rules" are sticky
Review Comment:
no different, it just tests that the planner rules are not reset from test to test
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2829034185
> Another question is whether we wait for a new release of Quidem to pick up the multi-line strings. Then you can include the upgrade in this PR. But we should merge this soon, it will be very useful.
I suggest that if this PR only lacks multi-line strings, can it be merged first. CALCITE-6975 may need to provide a 0.12-SNAPSHOT version for validation, otherwise Julian may not release version 0.12. WDYT?
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2047406966
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,89 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+
+# The following line is used to update the default planner rules.
+# "+" means add a rule, "-" means remove a rule. Only the "CoreRules." can be omitted.
+!set planner-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
Review Comment:
I suspect the quotes are actually not necessary, is that right?
but maybe it's useful to keep them, since we may change Quidem to allow multi-line strings
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2047405901
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,89 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+
+# The following line is used to update the default planner rules.
Review Comment:
in general, if you make changes you should use new commits, which are squashed before merging. This makes it easier to see what is new for reviewers
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2815260828
@NobiGo Hi, please take a look, if there some suggestions for me?
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4301:
URL: https://github.com/apache/calcite/pull/4301#issuecomment-2803790453
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4301) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4301&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4301&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4301&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [89.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4301&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4301&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4301)
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2046963721
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set planner-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
Review Comment:
@NobiGo This is a good suggestion, I will add a usage note to the `planner.iq` file and `QuidemTest.java` file. WDYT?
--
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-6335] Quidem tests should allow specifying optimization passes to apply to programs [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4301:
URL: https://github.com/apache/calcite/pull/4301#discussion_r2043176782
##########
core/src/test/resources/sql/planner.iq:
##########
@@ -0,0 +1,84 @@
+# planner.iq - planner tests can customizable optimization rules
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+!use post
+!set outputformat mysql
+!set update-rules "-INTERSECT_TO_DISTINCT,-EnumerableRules.ENUMERABLE_INTERSECT_RULE,+CoreRules.INTERSECT_TO_SEMI_JOIN"
+
+# Test INTERSECT_TO_SEMI_JOIN
+with t (i) as (values (0), (1))
+select * from t as t1
+intersect
+select * from t as t2 where t2.i > 0;
++---+
+| I |
++---+
+| 1 |
++---+
+(1 row)
+
+!ok
+
+EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[semi])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+ EnumerableCalc(expr#0=[{inputs}], expr#1=[0], expr#2=[>($t0, $t1)], EXPR$0=[$t0], $condition=[$t2])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+!plan
+
+# Test no reset-rules can keep rules
+with t (i) as (values (0), (1))
+select * from t as t1
+intersect
+select * from t as t2 where t2.i > 0;
++---+
+| I |
++---+
+| 1 |
++---+
+(1 row)
+
+!ok
+
+EnumerableNestedLoopJoin(condition=[IS NOT DISTINCT FROM($0, $1)], joinType=[semi])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+ EnumerableCalc(expr#0=[{inputs}], expr#1=[0], expr#2=[>($t0, $t1)], EXPR$0=[$t0], $condition=[$t2])
+ EnumerableValues(tuples=[[{ 0 }, { 1 }]])
+!plan
+
+!set reset-rules ""
Review Comment:
this is a bit ugly
if you want to reuse "!set", maybe you can say "!set planner-rules original".
Here "original" is not the name of any rule
--
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