spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cloud-fan <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-7267][SPARK-7289] add LimitPushDown rul...
Date Fri, 12 Jun 2015 09:17:28 GMT
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6780#discussion_r32301095
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
    @@ -107,6 +108,17 @@ object UnionPushdown extends Rule[LogicalPlan] {
       }
     }
     
    +object LimitPushDown extends Rule[LogicalPlan] {
    +  def apply(plan: LogicalPlan): LogicalPlan = plan transform {
    +    // Push down limit when the child is project on limit
    +    case Limit(expr, Project(projectList, l: Limit)) =>
    +      Project(projectList, Limit(expr, l))
    +
    +    // Push down limit when the child is project on sort
    +    case Limit(expr, Project(projectList, s: Sort)) =>
    +      Project(projectList, Limit(expr, s))
    +  }
    --- End diff --
    
    This is for SPARK-7289. As we discussed in https://github.com/apache/spark/pull/5821,
we need an optimize rule like this.
    cc @adrian-wang 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message