PlanChangeLogger¶
PlanChangeLogger is a logging utility for rule executors to log plan changes (at rule and batch level).
Creating Instance¶
PlanChangeLogger takes no arguments to be created.
PlanChangeLogger is created when:
RuleExecutoris requested to execute rulesQueryExecutionis requested to prepare for executionAdaptiveSparkPlanExecphysical operator is created
TreeType¶
PlanChangeLogger is a Scala type constructor (generic class) with TreeType type alias of a subclass of TreeNode.
Logging Plan Changes by Rule¶
logRule prints out the following message to the logs when the given newPlan and oldPlan are different and the ruleName is included in the spark.sql.planChangeLog.rules configuration property.
logRule is used when:
RuleExecutoris requested to executeQueryExecutionis requested to prepare for executionAdaptiveSparkPlanExecphysical operator is requested to applyPhysicalRules
Logging Plan Changes by Batch¶
logBatch prints out one of the following messages to the logs when the given batchName is included in the spark.sql.planChangeLog.batches configuration property.
When the given oldPlan and newPlan are different, logBatch prints out the following message:
Otherwise, logBatch prints out the following message:
logBatch is used when:
RuleExecutoris requested to executeQueryExecutionis requested to prepare for executionAdaptiveSparkPlanExecphysical operator is requested to applyPhysicalRules
Logging Metrics¶
logMetrics prints out the following message to the logs:
=== Metrics of Executed Rules ===
Total number of runs: [numRuns]
Total time: [totalTime] seconds
Total number of effective runs: [numEffectiveRuns]
Total time of effective runs: [totalTimeEffective] seconds
logMetrics is used when:
RuleExecutoris requested to execute
logBasedOnLevel¶
logBasedOnLevel uses the spark.sql.planChangeLog.level configuration property for the log level and prints out the given f message to the logs.