This is an automated email from the ASF dual-hosted git repository.
wenchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new f355293f8bc8 [SPARK-50801][SQL] Improve `PlanLogger.logPlanResolution`
so it shows just unresolved and resolved plans
f355293f8bc8 is described below
commit f355293f8bc82fc5bd56f34e1eb2518c8b47e483
Author: mihailoale-db <[email protected]>
AuthorDate: Tue Jan 14 17:43:17 2025 +0800
[SPARK-50801][SQL] Improve `PlanLogger.logPlanResolution` so it shows just
unresolved and resolved plans
### What changes were proposed in this pull request?
Improve `PlanLogger.logPlanResolution` so it shows just unresolved and
resolved plans.
### Why are the changes needed?
Currently `PlanLogger` dumps
`unresolvedPlan.withNewChildren(resolvedPlan.children` and `resolvedPlan` in
`logPlanResolution` method. This leads to internal errors because in
`withNewChildren` we have `children.size == newChildren.size` check which can
fail sometimes (e.g when `UnresolvedRelation` is substituted with
`SubqueryAlias(..., child, ...)`).
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing tests with the `ANALYZER_DUAL_RUN_LEGACY_AND_SINGLE_PASS_RESOLVER`
value set to `true`.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #49468 from mihailoale-db/mihailo-aleksic_data/master.
Authored-by: mihailoale-db <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
---
.../org/apache/spark/sql/catalyst/analysis/resolver/PlanLogger.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/resolver/PlanLogger.scala
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/resolver/PlanLogger.scala
index 8870befede4f..f778915008db 100644
---
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/resolver/PlanLogger.scala
+++
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/resolver/PlanLogger.scala
@@ -46,7 +46,7 @@ class PlanLogger extends Logging {
|${MDC(
QUERY_PLAN,
sideBySide(
-
unresolvedPlan.withNewChildren(resolvedPlan.children).treeString,
+ unresolvedPlan.treeString,
resolvedPlan.treeString
).mkString("\n")
)}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]