You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Andy Grove (Jira)" <ji...@apache.org> on 2021/06/15 16:14:00 UTC

[jira] [Updated] (SPARK-35767) [SQL] CoalesceExec can execute child plan twice

     [ https://issues.apache.org/jira/browse/SPARK-35767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Grove updated SPARK-35767:
-------------------------------
    Priority: Minor  (was: Major)

> [SQL] CoalesceExec can execute child plan twice
> -----------------------------------------------
>
>                 Key: SPARK-35767
>                 URL: https://issues.apache.org/jira/browse/SPARK-35767
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.2, 3.1.2
>            Reporter: Andy Grove
>            Priority: Minor
>
> CoalesceExec calls `child.execute()` in the if condition and throws away the results, then calls `child.execute()` again in the else condition. This could cause a section of the plan to be executed twice.
> {code:java}
> protected override def doExecute(): RDD[InternalRow] = {
>   if (numPartitions == 1 && child.execute().getNumPartitions < 1) {
>     // Make sure we don't output an RDD with 0 partitions, when claiming that we have a
>     // `SinglePartition`.
>     new CoalesceExec.EmptyRDDWithPartitions(sparkContext, numPartitions)
>   } else {
>     child.execute().coalesce(numPartitions, shuffle = false)
>   }
> } {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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