17
17
18
18
package org .apache .spark .sql .hive .client
19
19
20
- import org .apache .spark .sql .hive .HiveContext
21
- import org .apache .spark .{Logging , SparkConf , SparkContext , SparkFunSuite }
20
+ import org .apache .spark .{Logging , SparkFunSuite }
22
21
import org .apache .spark .sql .catalyst .util .quietly
23
22
import org .apache .spark .util .Utils
24
23
@@ -38,48 +37,6 @@ class VersionsSuite extends SparkFunSuite with Logging {
38
37
" hive.metastore.warehouse.dir" -> warehousePath.toString)
39
38
}
40
39
41
- test(" SPARK-8020: successfully create a HiveContext with metastore settings in Spark conf." ) {
42
- val sparkConf =
43
- new SparkConf () {
44
- // We are not really clone it. We need to keep the custom getAll.
45
- override def clone : SparkConf = this
46
-
47
- override def getAll : Array [(String , String )] = {
48
- val allSettings = super .getAll
49
- val metastoreVersion = get(" spark.sql.hive.metastore.version" )
50
- val metastoreJars = get(" spark.sql.hive.metastore.jars" )
51
-
52
- val others = allSettings.filterNot { case (key, _) =>
53
- key == " spark.sql.hive.metastore.version" || key == " spark.sql.hive.metastore.jars"
54
- }
55
-
56
- // Put metastore.version to the first one. It is needed to trigger the exception
57
- // caused by SPARK-8020. Other problems triggered by SPARK-8020
58
- // (e.g. using Hive 0.13.1's metastore client to connect to the a 0.12 metastore)
59
- // are not easy to test.
60
- Array (
61
- (" spark.sql.hive.metastore.version" -> metastoreVersion),
62
- (" spark.sql.hive.metastore.jars" -> metastoreJars)) ++ others
63
- }
64
- }
65
- sparkConf
66
- .set(" spark.sql.hive.metastore.version" , " 12" )
67
- .set(" spark.sql.hive.metastore.jars" , " maven" )
68
-
69
- val hiveContext = new HiveContext (
70
- new SparkContext (
71
- " local[2]" ,
72
- " TestSQLContextInVersionsSuite" ,
73
- sparkConf)) {
74
-
75
- protected override def configure (): Map [String , String ] = buildConf
76
-
77
- }
78
-
79
- // Make sure all metastore related lazy vals got created.
80
- hiveContext.tables()
81
- }
82
-
83
40
test(" success sanity check" ) {
84
41
val badClient = IsolatedClientLoader .forVersion(" 13" , buildConf()).client
85
42
val db = new HiveDatabase (" default" , " " )
0 commit comments