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_r381960043
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala
 ##########
 @@ -189,9 +189,16 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] 
extends TreeNode[PlanT
     val codegenIdStr =
       getTagValue(QueryPlan.CODEGEN_ID_TAG).map(id => s"[codegen id : 
$id]").getOrElse("")
     val operatorId = getTagValue(QueryPlan.OP_ID_TAG).map(id => 
s"$id").getOrElse("unknown")
-    s"""
+    val argumentString = argString(SQLConf.get.maxToStringFields)
+
+    val result = s"""
        |($operatorId) $nodeName $codegenIdStr
      """.stripMargin
+    if (argumentString != null && !argumentString.isEmpty) {
+      s"""${result} |Arguments: $argumentString\n""".stripMargin
 
 Review comment:
   This is too hard to read. How about
   ```
   val result = s"($operatorId) $nodeName $codegenIdStr\n"
   if (argumentString.nonEmpty) {
     result + s"Arguments: $argumentString\n"
   } else {
     result
   }
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to