You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by ru...@apache.org on 2023/04/29 18:15:36 UTC
[calcite] branch main updated: [CALCITE-5679] HepPlanner#buildFinalPlan: do not clear metadata cache if RelNode has not changed
This is an automated email from the ASF dual-hosted git repository.
rubenql 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 a833bd626c [CALCITE-5679] HepPlanner#buildFinalPlan: do not clear metadata cache if RelNode has not changed
a833bd626c is described below
commit a833bd626c5e781ccc27bd6fab1c636a3b944907
Author: rubenada <ru...@gmail.com>
AuthorDate: Fri Apr 28 15:22:28 2023 +0100
[CALCITE-5679] HepPlanner#buildFinalPlan: do not clear metadata cache if RelNode has not changed
---
core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java b/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java
index 7e39b4399f..fc2f557c0b 100644
--- a/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java
+++ b/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java
@@ -944,6 +944,7 @@ public class HepPlanner extends AbstractRelOptPlanner {
// Recursively process children, replacing this rel's inputs
// with corresponding child rels.
List<RelNode> inputs = rel.getInputs();
+ boolean changed = false;
for (int i = 0; i < inputs.size(); ++i) {
RelNode child = inputs.get(i);
if (!(child instanceof HepRelVertex)) {
@@ -952,9 +953,12 @@ public class HepPlanner extends AbstractRelOptPlanner {
}
child = buildFinalPlan((HepRelVertex) child);
rel.replaceInput(i, child);
+ changed = true;
+ }
+ if (changed) {
+ RelMdUtil.clearCache(rel);
+ rel.recomputeDigest();
}
- RelMdUtil.clearCache(rel);
- rel.recomputeDigest();
return rel;
}