[ 
https://issues.apache.org/jira/browse/SPARK-23904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16745454#comment-16745454
 ] 

Izek Greenfield commented on SPARK-23904:
-----------------------------------------

[~staslos] The plan description is created in any case buy this code: 
`queryExecution.toString`

{code:java}
object SQLExecution {
...
withSQLConfPropagated(sparkSession) {
        sc.listenerBus.post(SparkListenerSQLExecutionStart(
          executionId, callSite.shortForm, callSite.longForm, 
queryExecution.toString,
          SparkPlanInfo.fromSparkPlan(queryExecution.executedPlan), 
System.currentTimeMillis()))
        try {
          body
        } finally {
          sc.listenerBus.post(SparkListenerSQLExecutionEnd(
            executionId, System.currentTimeMillis()))
        }
      }
    } finally {
      executionIdToQueryExecution.remove(executionId)
      sc.setLocalProperty(EXECUTION_ID_KEY, oldExecutionId)
    }
...
}
{code}

so the new PR will solve one issue: Memory usage. but the working down the tree 
to create unneeded string will still happen and waste the time of execution... 

can't this be lazily created if needed?

> Big execution plan cause OOM
> ----------------------------
>
>                 Key: SPARK-23904
>                 URL: https://issues.apache.org/jira/browse/SPARK-23904
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.2.1
>            Reporter: Izek Greenfield
>            Priority: Major
>              Labels: SQL, query
>
> I create a question in 
> [StackOverflow|https://stackoverflow.com/questions/49508683/spark-physicalplandescription-string-is-to-big]
>  
> Spark create the text representation of query in any case even if I don't 
> need it.
> That causes many garbage object and unneeded GC... 
>  [Gist with code to 
> reproduce|https://gist.github.com/igreenfield/584c3336f03ba7d63e9026774eaf5e23]
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to