You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/12/16 15:32:34 UTC

[GitHub] [hive] zabetak opened a new pull request #2887: HIVE-25816: Log CBO plan after rule application for debugging purposes

zabetak opened a new pull request #2887:
URL: https://github.com/apache/hive/pull/2887


   ### What changes were proposed in this pull request?
   Add new listener to the CBO planner to log the plan produced after a rule invocation
   
   ### Why are the changes needed?
   Greatly, facilitates debugging of problems in rule invocations.
   
   ### Does this PR introduce _any_ user-facing change?
   No, unless they change their logging configuration.
   
   ### How was this patch tested?
   Manual tests:
   1. `mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile=cbo_join.q`
   2. Inspect `target/tmp/log/hive.log`
   3. Modify `hive-log4j2.properties`
   4. Repeat


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zabetak closed pull request #2887: HIVE-25816: Log CBO plan after rule application for debugging purposes

Posted by GitBox <gi...@apache.org>.
zabetak closed pull request #2887:
URL: https://github.com/apache/hive/pull/2887


   


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz commented on a change in pull request #2887: HIVE-25816: Log CBO plan after rule application for debugging purposes

Posted by GitBox <gi...@apache.org>.
kasakrisz commented on a change in pull request #2887:
URL: https://github.com/apache/hive/pull/2887#discussion_r773846196



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
##########
@@ -2427,7 +2430,7 @@ protected RelNode executeProgram(RelNode basePlan, HepProgram program,
       // Create planner and copy context
       HepPlanner planner = new HepPlanner(program,
           basePlan.getCluster().getPlanner().getContext());
-
+      planner.addListener(new RuleEventLogger());

Review comment:
       If that's the case you can leave it is as is.




-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz commented on a change in pull request #2887: HIVE-25816: Log CBO plan after rule application for debugging purposes

Posted by GitBox <gi...@apache.org>.
kasakrisz commented on a change in pull request #2887:
URL: https://github.com/apache/hive/pull/2887#discussion_r770684249



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
##########
@@ -2427,7 +2430,7 @@ protected RelNode executeProgram(RelNode basePlan, HepProgram program,
       // Create planner and copy context
       HepPlanner planner = new HepPlanner(program,
           basePlan.getCluster().getPlanner().getContext());
-
+      planner.addListener(new RuleEventLogger());

Review comment:
       Should we add a check the log level setting before adding this listener like
   ```
   if (LOG.isDebugEnabled()) {
     planner.addListener(new RuleEventLogger());
   }
   ```
   It may seems to be a preliminary optimization, what do you think?




-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zabetak commented on a change in pull request #2887: HIVE-25816: Log CBO plan after rule application for debugging purposes

Posted by GitBox <gi...@apache.org>.
zabetak commented on a change in pull request #2887:
URL: https://github.com/apache/hive/pull/2887#discussion_r771826595



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
##########
@@ -2427,7 +2430,7 @@ protected RelNode executeProgram(RelNode basePlan, HepProgram program,
       // Create planner and copy context
       HepPlanner planner = new HepPlanner(program,
           basePlan.getCluster().getPlanner().getContext());
-
+      planner.addListener(new RuleEventLogger());

Review comment:
       `RuleEventLogger` is using a different logger (not LOG) so cannot easily put this check here. Moreover, the performance benefit is unclear so it might be better to leave it is as is. 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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org