This is an automated email from the ASF dual-hosted git repository.
hyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite.git
The following commit(s) were added to refs/heads/master by this push:
new ab97af3 [CALCITE-3257] RelMetadataQuery cache is not invalidated when
log trace is enabled (Xiening Dai)
ab97af3 is described below
commit ab97af39bd9438420cb5b212b95b23d9cb798f0d
Author: Xiening Dai <[email protected]>
AuthorDate: Fri Aug 16 13:05:46 2019 -0700
[CALCITE-3257] RelMetadataQuery cache is not invalidated when log trace is
enabled (Xiening Dai)
Based on current design, RelMetadataQuery.map needs to be cleared between
each
rule firing. This is achieved through
RelOptCluster.invalidateMetadataQuery()
by VolcanoRuleCall.transformTo(). But when trace is enabled, the dump
process
would actually rebuild the meta data cache from previous rel tree. Then the
subsequent rule firing doesn't get a chance to update rel node cost as it's
been in the cache.
A simple fix will just add a call to RelOptCluster.invalidateMetadataQuery()
after dumping rel nodes.
Close #1385
---
core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java
b/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java
index 25135f0..1b37e7d 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java
@@ -405,6 +405,7 @@ class RuleQueue {
dump(pw);
pw.flush();
LOGGER.trace(sw.toString());
+ planner.getRoot().getCluster().invalidateMetadataQuery();
}
}