Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
dtenedor committed Apr 23, 2024
1 parent 748457e commit 9c0c945
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ object LogKey extends Enumeration {
val ESTIMATOR_PARAMETER_MAP = Value
val EVENT_LOOP = Value
val EVENT_QUEUE = Value
val EXCEPTION = Value
val EXECUTE_INFO = Value
val EXECUTE_KEY = Value
val EXECUTION_PLAN_LEAVES = Value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,10 @@ case class AdaptiveSparkPlanExec(
val newCost = costEvaluator.evaluateCost(newPhysicalPlan)
if (newCost < origCost ||
(newCost == origCost && currentPhysicalPlan != newPhysicalPlan)) {
logOnLevel("Plan changed:\n" +
sideBySide(currentPhysicalPlan.treeString, newPhysicalPlan.treeString).mkString("\n"))
val plans =
sideBySide(currentPhysicalPlan.treeString, newPhysicalPlan.treeString).mkString("\n")
logOnLevel(log"Plan changed:\n" +
log"${MDC(QUERY_PLAN, plans)}")
cleanUpTempTags(newPhysicalPlan)
currentPhysicalPlan = newPhysicalPlan
currentLogicalPlan = newLogicalPlan
Expand Down Expand Up @@ -389,7 +391,7 @@ case class AdaptiveSparkPlanExec(
if (shouldUpdatePlan && currentPhysicalPlan.exists(_.subqueries.nonEmpty)) {
getExecutionId.foreach(onUpdatePlan(_, Seq.empty))
}
logOnLevel(s"Final plan:\n$currentPhysicalPlan")
logOnLevel(log"Final plan:\n${MDC(QUERY_PLAN, currentPhysicalPlan)}")
}

override def executeCollect(): Array[InternalRow] = {
Expand Down Expand Up @@ -742,7 +744,7 @@ case class AdaptiveSparkPlanExec(
Some((finalPlan, optimized))
} catch {
case e: InvalidAQEPlanException[_] =>
logOnLevel(s"Re-optimize - ${e.getMessage()}:\n${e.plan}")
logOnLevel(log"Re-optimize - ${MDC(EXCEPTION, e.getMessage())}:\n${e.plan}")
None
}
}
Expand Down

0 comments on commit 9c0c945

Please sign in to comment.