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

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

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

Dongjoon Hyun updated SPARK-35767:
----------------------------------
    Summary: CoalesceExec can execute child plan twice  (was: [SQL] CoalesceExec can execute child plan twice)

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