Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4991

Improve RuleEventLogger to also print input rels in FULL_PLAN mode

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.29.0
    • 1.30.0
    • core

    Description

      After using for some time now the new plan logging capabilities introduced via RuleEventLogger in CALCITE-4704, only printing the new rel produced by a rule is not enough for complex cases, because the input rel(s) used by the rule are not printed, and sometimes they are nowhere in the logs, making it hard to understand what situation caused the appearance of a given plan of interest.

      The present ticket aims at additionally printing, for FULL_PLAN marker, the input rels used by a given rule, before printing the output rel produced by the rule application.

      The output logs would evolve from:

      022-01-21T02:41:27,466 DEBUG [02c3a9eb-0565-404f-9c56-a2bbb556c827 main] calcite.RuleEventLogger: call#5: Apply rule [HiveProjectFilterPullUpConstantsRule] to [rel#45:HiveProject,rel#56:HiveFilter]
      
      2022-01-21T02:41:27,468 DEBUG [02c3a9eb-0565-404f-9c56-a2bbb556c827 main] calcite.RuleEventLogger: call#5: Rule [HiveProjectFilterPullUpConstantsRule] produced [rel#58:HiveProject]
      2022-01-21T02:41:27,468 DEBUG [02c3a9eb-0565-404f-9c56-a2bbb556c827 main] calcite.RuleEventLogger: call#5: Full plan for [rel#58:HiveProject]:
      HiveProject(month=[CAST(202110):INTEGER])
        HiveFilter(condition=[=($0, 202110)])
          HiveTableScan(table=[[default, test2]], table:alias=[test2])
      

      to:

      022-01-21T02:41:27,466 DEBUG [02c3a9eb-0565-404f-9c56-a2bbb556c827 main] calcite.RuleEventLogger: call#5: Apply rule [HiveProjectFilterPullUpConstantsRule] to [rel#45:HiveProject,rel#56:HiveFilter]
      2022-01-21T02:41:27,468 DEBUG [02c3a9eb-0565-404f-9c56-a2bbb556c827 main] calcite.RuleEventLogger: call#5: Full plan for rule input [rel#45:HiveProject]:
      HiveProject(month=[$0])
        HiveFilter(condition=[=($0, 202110)])
          HiveTableScan(table=[[default, test2]], table:alias=[test2])
      
      2022-01-21T02:41:27,468 DEBUG [02c3a9eb-0565-404f-9c56-a2bbb556c827 main] calcite.RuleEventLogger: call#5: Full plan for rule input [rel#56:HiveFilter]:
      HiveFilter(condition=[=($0, 202110)])
        HiveTableScan(table=[[default, test2]], table:alias=[test2])
      
      2022-01-21T02:41:27,468 DEBUG [02c3a9eb-0565-404f-9c56-a2bbb556c827 main] calcite.RuleEventLogger: call#5: Rule [HiveProjectFilterPullUpConstantsRule] produced [rel#58:HiveProject]
      2022-01-21T02:41:27,468 DEBUG [02c3a9eb-0565-404f-9c56-a2bbb556c827 main] calcite.RuleEventLogger: call#5: Full plan for [rel#58:HiveProject]:
      HiveProject(month=[CAST(202110):INTEGER])
        HiveFilter(condition=[=($0, 202110)])
          HiveTableScan(table=[[default, test2]], table:alias=[test2])
      

      Attachments

        Issue Links

          Activity

            People

              asolimando Alessandro Solimando
              asolimando Alessandro Solimando
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m