Skip to content

Commit dd57470

Browse files
committed
set hive.metastore.warehouse.dir
1 parent a031c47 commit dd57470

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientSuite.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ class HiveClientSuite(version: String)
4040
private val testPartitionCount = 3 * 5 * 4
4141

4242
private def init(tryDirectSql: Boolean): HiveClient = {
43-
val location = Some(Utils.createTempDir().toURI)
4443
val storageFormat = CatalogStorageFormat(
45-
locationUri = location,
44+
locationUri = None,
4645
inputFormat = None,
4746
outputFormat = None,
4847
serde = None,
@@ -51,16 +50,17 @@ class HiveClientSuite(version: String)
5150

5251
val hadoopConf = new Configuration()
5352
hadoopConf.setBoolean(tryDirectSqlKey, tryDirectSql)
53+
hadoopConf.set("hive.metastore.warehouse.dir", Utils.createTempDir().toURI().toString())
5454
val client = buildClient(hadoopConf)
5555
val tableSchema =
5656
new StructType().add("value", "int").add("ds", "int").add("h", "int").add("chunk", "string")
5757
val table = CatalogTable(
5858
identifier = TableIdentifier("test", Some("default")),
59-
tableType = CatalogTableType.EXTERNAL,
59+
tableType = CatalogTableType.MANAGED,
6060
schema = tableSchema,
6161
partitionColumnNames = Seq("ds", "h", "chunk"),
6262
storage = CatalogStorageFormat(
63-
locationUri = location,
63+
locationUri = None,
6464
inputFormat = Some(classOf[TextInputFormat].getName),
6565
outputFormat = Some(classOf[HiveIgnoreKeyTextOutputFormat[_, _]].getName),
6666
serde = Some(classOf[LazySimpleSerDe].getName()),

0 commit comments

Comments
 (0)