This is an automated email from the ASF dual-hosted git repository.
mbudiu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git
The following commit(s) were added to refs/heads/main by this push:
new 50d1a26b56 Reduced the number of type checks
50d1a26b56 is described below
commit 50d1a26b56c95ca5c5ed90e90deb93db0d6db94b
Author: ClownXC <[email protected]>
AuthorDate: Thu Nov 7 12:42:12 2024 +0800
Reduced the number of type checks
---
.../src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
index a5cf48e2af..aaf939f2e6 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
@@ -421,14 +421,14 @@ public class VolcanoPlanner extends AbstractRelOptPlanner
{
return false;
}
+ final boolean isTransFormRule = rule instanceof TransformationRule;
// Each of this rule's operands is an 'entry point' for a rule call.
// Register each operand against all concrete sub-classes that could match
// it.
for (RelOptRuleOperand operand : rule.getOperands()) {
for (Class<? extends RelNode> subClass
: subClasses(operand.getMatchedClass())) {
- if (PhysicalNode.class.isAssignableFrom(subClass)
- && rule instanceof TransformationRule) {
+ if (isTransFormRule && PhysicalNode.class.isAssignableFrom(subClass)) {
continue;
}
classOperands.put(subClass, operand);