MaxGekk commented on a change in pull request #24159: [SPARK-27221][SQL]Improve 
the assert error message in TreeNode.parseToJson
URL: https://github.com/apache/spark/pull/24159#discussion_r267517557
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala
 ##########
 @@ -683,7 +683,8 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] 
extends Product {
       try {
         val fieldNames = getConstructorParameterNames(p.getClass)
         val fieldValues = p.productIterator.toSeq
-        assert(fieldNames.length == fieldValues.length)
+        assert(fieldNames.length == fieldValues.length, 
s"${getClass.getSimpleName} fields: " +
+          fieldNames.mkString(", ") + s", values: " + 
fieldValues.map(_.toString).mkString(", "))
 
 Review comment:
   `mkString` should convert elements to `String`. I guess `map(_.toString)` is 
not necessary.

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