dongjoon-hyun commented on code in PR #45488:
URL: https://github.com/apache/spark/pull/45488#discussion_r1534165007
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala:
##########
@@ -464,6 +464,60 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]]
s"($opId) $nodeName$codegenId"
}
+ def extensionsInfo(mode: String = "simple"): String = {
+ mode match {
+ case "simple" =>
+ summaryExtensionsInfoSimple().mkString("\n")
+ case _ =>
+ val sb = new StringBuilder
+ summaryExtensionsInfo(0, sb)
+ sb.toString
+ }
+ }
+
+ def summaryExtensionsInfo(indent: Int, sb: StringBuilder): Unit = {
+ var indentLevel = indent
+ sb.append(
+ getTagValue(QueryPlan.EXPLAIN_PLAN_INFO).map(t => {
+ indentLevel = indentLevel + 1
+ " " * indentLevel + t + "\n"
+ }).getOrElse("")
+ )
+ if (innerChildren.nonEmpty) {
+ innerChildren.foreach(_.summaryExtensionsInfo(indentLevel, sb))
+ }
+ if (children.nonEmpty) {
+ children.foreach(_.summaryExtensionsInfo(indentLevel, sb))
+ }
+ }
+
+ // Sometimes all that is needed is the root level information
+ // (especially with errors during planning)
+ def summaryExtensionsInfoSimple(): mutable.Set[String] = {
+ val sb = mutable.Set[String]() // don't allow duplicates
Review Comment:
The name `sb` looks misleading because we use it for StringBiuilder.
--
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]