Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-fan committed Jul 21, 2015
1 parent 8ce15ca commit 3912f84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ object PushPredicateThroughProject extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
case filter @ Filter(condition, project @ Project(fields, grandChild)) =>
// Create a map of Aliases to their values from the child projection.
// e.g., 'SELECT a + b AS c, d ...' produces Map(c -> Alias(a + b, c)).
// e.g., 'SELECT a + b AS c, d ...' produces Map(c -> a + b).
val aliasMap = AttributeMap(fields.collect {
case a: Alias => (a.toAttribute, a.child)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ class FilterPushdownSuite extends PlanTest {

test("nondeterministic: can't push down filter through project") {
val originalQuery = testRelation
.select(Rand(10).as('rand))
.where('rand > 5)
.select(Rand(10).as('rand), 'a)
.where('rand > 5 && 'a > 5)
.analyze

val optimized = Optimize.execute(originalQuery)
Expand Down

0 comments on commit 3912f84

Please sign in to comment.