Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove the new dep
  • Loading branch information
Feng Liu committed Mar 1, 2018
commit d0eacc2048cf07193aca20f8011b677099884278
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,17 @@ package org.apache.spark.sql.hive

import org.apache.spark.SparkFunSuite
import org.apache.spark.sql.{AnalysisException, SparkSession}
import org.apache.spark.sql.test.SQLTestUtilsBase
import org.apache.spark.util.Utils

class HiveMetastoreLazyInitializationSuite extends SparkFunSuite with SQLTestUtilsBase {
class HiveMetastoreLazyInitializationSuite extends SparkFunSuite {

override def spark: SparkSession = SparkSession.builder()
test("lazily initialize Hive client") {
val spark = SparkSession.builder()
.appName("HiveMetastoreLazyInitializationSuite")
.master("local[2]")
.enableHiveSupport()
.config("spark.hadoop.hive.metastore.uris", "thrift://127.0.0.1:11111")
.getOrCreate()

test("lazily initialize Hive client") {
val originalLevel = org.apache.log4j.Logger.getRootLogger().getLevel
try {
// Avoid outputting a lot of expected warning logs
Expand All @@ -45,9 +43,13 @@ class HiveMetastoreLazyInitializationSuite extends SparkFunSuite with SQLTestUti
assert(spark.range(0, 1).count() === 1)

// We should be able to use fs
withTempPath { dir =>
spark.range(0, 1).write.parquet(dir.getAbsolutePath)
assert(spark.read.parquet(dir.getAbsolutePath).count() === 1)
val path = Utils.createTempDir()
path.delete()
try {
spark.range(0, 1).write.parquet(path.getAbsolutePath)
assert(spark.read.parquet(path.getAbsolutePath).count() === 1)
} finally {
Utils.deleteRecursively(path)
}

// Make sure that we are not using the local derby metastore.
Expand Down