Skip to content

Commit

Permalink
Fixed metastore JDBC URI quotation
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed Aug 19, 2014
1 parent cd0720c commit e5aa31a
Showing 1 changed file with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ class HiveThriftServer2Suite extends FunSuite with BeforeAndAfterAll with TestUt
port
}

// If verbose is true, the test program will print all outputs coming from the Hive Thrift server.
val VERBOSE = Option(System.getenv("SPARK_SQL_TEST_VERBOSE")).getOrElse("false").toBoolean

Class.forName(DRIVER_NAME)

override def beforeAll() { launchServer() }
Expand All @@ -68,17 +65,14 @@ class HiveThriftServer2Suite extends FunSuite with BeforeAndAfterAll with TestUt
val command =
s"""../../sbin/start-thriftserver.sh
| --master local
| --hiveconf hive.root.logger=INFO,console
| --hiveconf ${ConfVars.METASTORECONNECTURLKEY}="$jdbcUrl"
| --hiveconf ${ConfVars.METASTORECONNECTURLKEY}=$jdbcUrl
| --hiveconf ${ConfVars.METASTOREWAREHOUSE}=$METASTORE_PATH
| --hiveconf ${ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST}=$HOST
| --hiveconf ${ConfVars.HIVE_SERVER2_THRIFT_PORT}=$PORT
""".stripMargin.split("\\s+")

val pb = new ProcessBuilder(command ++ args: _*)
val environment = pb.environment()
environment.put("HIVE_SERVER2_THRIFT_PORT", PORT.toString)
environment.put("HIVE_SERVER2_THRIFT_BIND_HOST", HOST)
process = pb.start()
inputReader = new BufferedReader(new InputStreamReader(process.getInputStream))
errorReader = new BufferedReader(new InputStreamReader(process.getErrorStream))
Expand All @@ -91,12 +85,8 @@ class HiveThriftServer2Suite extends FunSuite with BeforeAndAfterAll with TestUt
while (true) {
val stdout = readFrom(inputReader)
val stderr = readFrom(errorReader)
if (VERBOSE && stdout.length > 0) {
println(stdout)
}
if (VERBOSE && stderr.length > 0) {
println(stderr)
}
print(stdout)
print(stderr)
Thread.sleep(50)
}
}
Expand Down

0 comments on commit e5aa31a

Please sign in to comment.