Skip to content

Commit

Permalink
Add a test to check if DataFrame with plan overriding sameResult but …
Browse files Browse the repository at this point in the history
…not using subqueries eliminated plan to compare can cacheTable.
  • Loading branch information
ueshin committed Jun 14, 2016
1 parent be3c41b commit 9a1621a
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -506,4 +506,15 @@ class CachedTableSuite extends QueryTest with SQLTestUtils with SharedSQLContext
sqlContext.uncacheTable("t2")
}
}

test("SPARK-15915 Logical plans should use subqueries eliminated plan when override sameResult") {
val localRelation = sqlContext.createDataset(Seq(1, 2, 3)).toDF()
localRelation.registerTempTable("localRelation")

sqlContext.cacheTable("localRelation")
assert(
localRelation.queryExecution.withCachedData.collect {
case i: InMemoryRelation => i
}.size == 1)
}
}

0 comments on commit 9a1621a

Please sign in to comment.