viirya commented on code in PR #38692:
URL: https://github.com/apache/spark/pull/38692#discussion_r1026181826
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala:
##########
@@ -105,12 +105,30 @@ class QueryExecution(
case other => other
}
+ lazy val normalized: LogicalPlan = {
+ val normalizationRules = sparkSession.sessionState.planNormalizationRules
+ if (normalizationRules.isEmpty) {
+ commandExecuted
+ } else {
+ val planChangeLogger = new PlanChangeLogger[LogicalPlan]()
+ val normalized = normalizationRules.foldLeft(commandExecuted)((p, rule)
=> {
+ val result = rule.apply(p)
+ planChangeLogger.logRule(rule.ruleName, p, result)
+ result
+ })
+ if (normalizationRules.nonEmpty) {
Review Comment:
I think entering this `else` block means `normalizationRules` is non empty,
no?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]