Skip to content

Commit

Permalink
Update FilterPushdownSuite.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
AngersZhuuuu committed Nov 9, 2020
1 parent c3ec848 commit 803bf0a
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1212,28 +1212,22 @@ class FilterPushdownSuite extends PlanTest {
test("push down predicate through expand") {
val input = LocalRelation('a.int, 'b.string, 'c.double)
val query =
Aggregate(
Seq('a, 'b),
Seq(sum('c).as("sum")),
Filter('a > 1,
Expand(
Seq(
Seq('a, 'b, 'c, Literal.create(null, StringType), 1),
Seq('a, 'b, 'c, 'a, 2)),
Seq('a, 'b, 'c),
input))).analyze
input)).analyze
val optimized = Optimize.execute(query)

val expected =
Aggregate(
Seq('a, 'b),
Seq(sum('c).as("sum")),
Expand(
Seq(
Seq('a, 'b, 'c, Literal.create(null, StringType), 1),
Seq('a, 'b, 'c, 'a, 2)),
Seq('a, 'b, 'c),
Filter('a > 1, input))).analyze
Filter('a > 1, input)).analyze

comparePlans(optimized, expected)
}
Expand Down

0 comments on commit 803bf0a

Please sign in to comment.