You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by za...@apache.org on 2021/12/14 17:53:24 UTC

[calcite] branch master updated: Improve debug message in IterativeRuleDriver

This is an automated email from the ASF dual-hosted git repository.

zabetak 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 96f4a73  Improve debug message in IterativeRuleDriver
96f4a73 is described below

commit 96f4a734417d044552a94d8969fd368b57ff9e8b
Author: Stamatis Zampetakis <za...@gmail.com>
AuthorDate: Mon Dec 13 17:41:28 2021 +0100

    Improve debug message in IterativeRuleDriver
    
    Remove PLANNER logging from the message and better formulate at which
    point during the rule matching the cost is printed.
    
    The original message is misleading cause it is not the planner that is
    printed but the queue. Moreover, IterativeRuleDriver#toString just
    prints the class name and hashcode of the instance which is useless.
    Class name might be useful but can be obtained by changing the logger
    configuration (pattern layout).
---
 .../java/org/apache/calcite/plan/volcano/IterativeRuleDriver.java   | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleDriver.java b/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleDriver.java
index ed6a379..a43a500 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleDriver.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleDriver.java
@@ -21,8 +21,6 @@ import org.apache.calcite.util.trace.CalciteTrace;
 
 import org.slf4j.Logger;
 
-import static java.util.Objects.requireNonNull;
-
 /***
  * <p>The algorithm executes repeatedly. The exact rules
  * that may be fired varies.
@@ -48,8 +46,8 @@ class IterativeRuleDriver implements RuleDriver {
 
   @Override public void drive() {
     while (true) {
-      LOGGER.debug("PLANNER = {}; COST = {}", this,
-          requireNonNull(planner.root, "planner.root").bestCost);
+      assert planner.root != null : "RelSubset must not be null at this point";
+      LOGGER.debug("Best cost before rule match: {}", planner.root.bestCost);
 
       VolcanoRuleMatch match = ruleQueue.popMatch();
       if (match == null) {