You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/12/16 15:33:00 UTC

[jira] [Work logged] (HIVE-25816) Log CBO plan after rule application for debugging purposes

     [ https://issues.apache.org/jira/browse/HIVE-25816?focusedWorklogId=697304&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-697304 ]

ASF GitHub Bot logged work on HIVE-25816:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Dec/21 15:32
            Start Date: 16/Dec/21 15:32
    Worklog Time Spent: 10m 
      Work Description: 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


Issue Time Tracking
-------------------

            Worklog Id:     (was: 697304)
    Remaining Estimate: 0h
            Time Spent: 10m

> Log CBO plan after rule application for debugging purposes
> ----------------------------------------------------------
>
>                 Key: HIVE-25816
>                 URL: https://issues.apache.org/jira/browse/HIVE-25816
>             Project: Hive
>          Issue Type: Task
>          Components: CBO
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> In many cases, we want to identify which rule lead to a certain transformation in the plan or need to observe how the query plan evolves by applying some rules in order to fix some bug or find the right place to introduce another optimization step.
> Currently there are some logs during the application of a rule triggered by the [HepPlanner|https://github.com/apache/calcite/blob/e04f3b08dcfb6910ff4df3810772c346b25ed424/core/src/main/java/org/apache/calcite/plan/AbstractRelOptPlanner.java#L367] and [VolcanoPlanner|https://github.com/apache/calcite/blob/e04f3b08dcfb6910ff4df3810772c346b25ed424/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoRuleCall.java#L126] but they more or less display only the top operator of the transformation and not the whole subtree. 
> It would help if instead of displaying only the top operator we logged the equivalent of {{EXPLAIN CBO}} on the transformed sub-tree. 
> The change is going to be introduced soon by default in Calcite (CALCITE-4704) but till we update to that version it would help to have this functionality already in Hive.
> For more examples about the proposed change have a look in CALCITE-4704.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)