You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2016/06/25 09:27:54 UTC

[jira] [Commented] (SPARK-16208) Add `CollapseEmptyPlan` optimizer

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

Apache Spark commented on SPARK-16208:
--------------------------------------

User 'dongjoon-hyun' has created a pull request for this issue:
https://github.com/apache/spark/pull/13905

> Add `CollapseEmptyPlan` optimizer
> ---------------------------------
>
>                 Key: SPARK-16208
>                 URL: https://issues.apache.org/jira/browse/SPARK-16208
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Dongjoon Hyun
>            Priority: Minor
>
> This issue adds a new logical optimizer, `CollapseEmptyPlan`, to collapse a logical plain consisting of only empty LocalRelations.
> **Before**
> {code}
> scala> sql("select a from (select explode(array(1,2,3)) a) where 1=0 group by a having count(*)>1 order by a").explain
> == Physical Plan ==
> *Sort [a#15 ASC], true, 0
> +- Exchange rangepartitioning(a#15 ASC, 200)
>    +- *Project [a#15]
>       +- *Filter (count(1)#17L > 1)
>          +- *HashAggregate(keys=[a#15], functions=[count(1)])
>             +- Exchange hashpartitioning(a#15, 200)
>                +- *HashAggregate(keys=[a#15], functions=[partial_count(1)])
>                   +- Generate explode([1,2,3]), false, false, [a#15]
>                      +- LocalTableScan <empty>
> {code}
> **After**
> {code}
> scala> sql("select a from (select explode(array(1,2,3)) a) where 1=0 group by a having count(*)>1 order by a").explain
> == Physical Plan ==
> LocalTableScan <empty>, [a#15]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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