You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Patrick Wendell (JIRA)" <ji...@apache.org> on 2015/05/14 03:07:00 UTC

[jira] [Updated] (SPARK-7303) push down project if possible when the child is sort

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

Patrick Wendell updated SPARK-7303:
-----------------------------------
    Fix Version/s: 1.4.0

> push down project if possible when the child is sort
> ----------------------------------------------------
>
>                 Key: SPARK-7303
>                 URL: https://issues.apache.org/jira/browse/SPARK-7303
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.3.1
>            Reporter: Fei Wang
>             Fix For: 1.4.0
>
>
> Optimize the case of `project(_, sort)` , a example is:
> `select key from (select * from testData order by key) t`
> optimize it from
> ```
> == Parsed Logical Plan ==
> 'Project ['key]
>  'Subquery t
>   'Sort ['key ASC], true
>    'Project [*]
>     'UnresolvedRelation [testData], None
> == Analyzed Logical Plan ==
> Project [key#0]
>  Subquery t
>   Sort [key#0 ASC], true
>    Project [key#0,value#1]
>     Subquery testData
>      LogicalRDD [key#0,value#1], MapPartitionsRDD[1]
> == Optimized Logical Plan ==
> Project [key#0]
>  Sort [key#0 ASC], true
>   LogicalRDD [key#0,value#1], MapPartitionsRDD[1] 
> == Physical Plan ==
> Project [key#0]
>  Sort [key#0 ASC], true
>   Exchange (RangePartitioning [key#0 ASC], 5), []
>    PhysicalRDD [key#0,value#1], MapPartitionsRDD[1] 
> ```
> to 
> ```
> == Parsed Logical Plan ==
> 'Project ['key]
>  'Subquery t
>   'Sort ['key ASC], true
>    'Project [*]
>     'UnresolvedRelation [testData], None
> == Analyzed Logical Plan ==
> Project [key#0]
>  Subquery t
>   Sort [key#0 ASC], true
>    Project [key#0,value#1]
>     Subquery testData
>      LogicalRDD [key#0,value#1], MapPartitionsRDD[1] 
> == Optimized Logical Plan ==
> Sort [key#0 ASC], true
>  Project [key#0]
>   LogicalRDD [key#0,value#1], MapPartitionsRDD[1] 
> == Physical Plan ==
> Sort [key#0 ASC], true
>  Exchange (RangePartitioning [key#0 ASC], 5), []
>   Project [key#0]
>    PhysicalRDD [key#0,value#1], MapPartitionsRDD[1] 
> ```



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