Skip to content
Snippets Groups Projects
Commit 5c9fdf74 authored by Michael Armbrust's avatar Michael Armbrust
Browse files

[SPARK-10998] [SQL] Show non-children in default Expression.toString

Its pretty hard to debug problems with expressions when you can't see all the arguments.

Before: `invoke()`
After: `invoke(inputObject#1, intField, IntegerType)`

Author: Michael Armbrust <michael@databricks.com>

Closes #9022 from marmbrus/expressionToString.
parent e8f90d9d
No related branches found
No related tags found
No related merge requests found
......@@ -174,7 +174,13 @@ abstract class Expression extends TreeNode[Expression] {
}.toString
}
override def toString: String = prettyName + children.mkString("(", ",", ")")
private def flatArguments = productIterator.flatMap {
case t: Traversable[_] => t
case single => single :: Nil
}
override def toString: String = prettyName + flatArguments.mkString("(", ",", ")")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment