File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
main/scala/org/apache/spark/sql/hive
test/scala/org/apache/spark/sql/hive/execution Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,7 @@ class TestHiveContext(sc: SparkContext) extends LocalHiveContext(sc) {
257257
258258 private val loadedTables = new collection.mutable.HashSet [String ]
259259
260+ var cacheTables : Boolean = false
260261 def loadTestTable (name : String ) {
261262 if (! (loadedTables contains name)) {
262263 // Marks the table as loaded first to prevent infite mutually recursive table loading.
@@ -265,6 +266,9 @@ class TestHiveContext(sc: SparkContext) extends LocalHiveContext(sc) {
265266 val createCmds =
266267 testTables.get(name).map(_.commands).getOrElse(sys.error(s " Unknown test table $name" ))
267268 createCmds.foreach(_())
269+
270+ if (cacheTables)
271+ cacheTable(name)
268272 }
269273 }
270274
Original file line number Diff line number Diff line change 1818package org .apache .spark .sql .hive .execution
1919
2020import org .apache .spark .sql .hive .TestHive
21+ import org .scalatest .BeforeAndAfter
22+
23+ class HiveInMemoryCompatibilitySuite extends HiveCompatibilitySuite with BeforeAndAfter {
24+ override def beforeAll () {
25+ TestHive .cacheTables = true
26+ }
27+
28+ override def afterAll () {
29+ TestHive .cacheTables = false
30+ }
31+ }
2132
2233/**
2334 * Runs the test cases that are included in the hive distribution.
You can’t perform that action at this time.
0 commit comments