cloud-fan commented on a change in pull request #27685: [SPARK-30940][SQL] 
Remove attributeId in auto-generated arguments when Explain SQL query
URL: https://github.com/apache/spark/pull/27685#discussion_r389649319
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
 ##########
 @@ -265,14 +265,21 @@ abstract class Expression extends TreeNode[Expression] {
     case single => single :: Nil
   }
 
+  protected def flatArgumentStrings: Iterator[String] = flatArguments.map {
+    case e: Expression => e.argumentString
+    case arg => s"$arg"
+  }
+
   // Marks this as final, Expression.verboseString should never be called, and 
thus shouldn't be
   // overridden by concrete classes.
   final override def verboseString(maxFields: Int): String = 
simpleString(maxFields)
 
   override def simpleString(maxFields: Int): String = toString
 
   override def toString: String = prettyName + truncatedString(
-    flatArguments.toSeq, "(", ", ", ")", SQLConf.get.maxToStringFields)
+    flatArgumentStrings.toSeq, "(", ", ", ")", SQLConf.get.maxToStringFields)
+
+  def argumentString: String = toString
 
 Review comment:
   is it possible to only add one method? I'm worried about adding to many 
methods to the framework.

----------------------------------------------------------------
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]

Reply via email to