cloud-fan commented on a change in pull request #27509: [SPARK-30764][SQL]
Improve the readability of EXPLAIN FORMATTED style
URL: https://github.com/apache/spark/pull/27509#discussion_r381961568
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkPlan.scala
##########
@@ -512,10 +513,16 @@ trait LeafExecNode extends SparkPlan {
override final def children: Seq[SparkPlan] = Nil
override def producedAttributes: AttributeSet = outputSet
override def verboseStringWithOperatorId(): String = {
- s"""
- |(${ExplainUtils.getOpId(this)}) $nodeName
${ExplainUtils.getCodegenId(this)}
- |Output: ${producedAttributes.mkString("[", ", ", "]")}
- """.stripMargin
+ val argumentString = argString(SQLConf.get.maxToStringFields)
+ val result = s"""
+ |(${ExplainUtils.getOpId(this)}) $nodeName
${ExplainUtils.getCodegenId(this)}
+ |${ExplainUtils.generateFieldString("Output", producedAttributes)}
+ """.stripMargin
+ if (argumentString != null && !argumentString.isEmpty) {
+ s"""${result} |Arguments: $argumentString\n""".stripMargin
Review comment:
same as https://github.com/apache/spark/pull/27509/files#r381960043
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]