You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Peter Toth (Jira)" <ji...@apache.org> on 2020/07/09 12:41:00 UTC

[jira] [Updated] (SPARK-32241) Remove empty children of union

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

Peter Toth updated SPARK-32241:
-------------------------------
    Description: 
Empty relation children of a union can be removed.
e.g. the plan of
{noformat}
SELECT c AS x FROM t1 UNION ALL SELECT * FROM t1 WHERE FALSE{noformat}
is currently:
{noformat}
== Physical Plan ==
Union
:- *(1) Project [value#219 AS c#222]
:  +- *(1) LocalTableScan [value#219]
+- LocalTableScan <empty>, [c#224]{noformat}
but it could be improved as: 
{noformat}
== Physical Plan ==
*(1) Project [value#219 AS c#222]
+- *(1) LocalTableScan [value#219]{noformat}

  was:
Empty relation children of a union can be removed.

e.g. the plan of

 
{noformat}
SELECT c AS x FROM t1 UNION ALL SELECT * FROM t1 WHERE FALSE{noformat}
is currently:

 

 
{noformat}
== Physical Plan ==
Union
:- *(1) Project [value#219 AS c#222]
:  +- *(1) LocalTableScan [value#219]
+- LocalTableScan <empty>, [c#224]{noformat}
but it could be improved as:

 
{noformat}
== Physical Plan ==
*(1) Project [value#219 AS c#222]
+- *(1) LocalTableScan [value#219]{noformat}


> Remove empty children of union
> ------------------------------
>
>                 Key: SPARK-32241
>                 URL: https://issues.apache.org/jira/browse/SPARK-32241
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.1.0
>            Reporter: Peter Toth
>            Priority: Minor
>
> Empty relation children of a union can be removed.
> e.g. the plan of
> {noformat}
> SELECT c AS x FROM t1 UNION ALL SELECT * FROM t1 WHERE FALSE{noformat}
> is currently:
> {noformat}
> == Physical Plan ==
> Union
> :- *(1) Project [value#219 AS c#222]
> :  +- *(1) LocalTableScan [value#219]
> +- LocalTableScan <empty>, [c#224]{noformat}
> but it could be improved as: 
> {noformat}
> == Physical Plan ==
> *(1) Project [value#219 AS c#222]
> +- *(1) LocalTableScan [value#219]{noformat}



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