Github user MaxGekk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22429#discussion_r217928631
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala 
---
    @@ -469,7 +470,17 @@ abstract class TreeNode[BaseType <: 
TreeNode[BaseType]] extends Product {
       def treeString: String = treeString(verbose = true)
     
       def treeString(verbose: Boolean, addSuffix: Boolean = false): String = {
    -    generateTreeString(0, Nil, new StringBuilder, verbose = verbose, 
addSuffix = addSuffix).toString
    +    val baos = new ByteArrayOutputStream()
    --- End diff --
    
    In this particular method, there is no benefits. This was changed to reused 
the method which accepts `OutputStream` instead of `StringBuilder`. Benefit of 
`OutputStream` over `StringBuilder` is no full materialization in memory and no 
string size limit.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to