Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-3809][SQL] Fixes test suites in hive-thriftserver #2675

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
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
Minor code cleanup, restore the logging level hack in TestHive.scala
  • Loading branch information
liancheng committed Oct 11, 2014
commit 1c384b7bc8b0b8d5b9b6bf294f399de5bb8a9976
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,10 @@ import org.apache.spark.sql.catalyst.util.getTempFilePath
class HiveThriftServer2Suite extends FunSuite with Logging {
Class.forName(classOf[HiveDriver].getCanonicalName)

val verbose = Option(System.getenv("SPARK_SQL_TEST_VERBOSE")).isDefined

def startThriftServerWithin(timeout: FiniteDuration = 1.minute)(f: Statement => Unit) {
Thread.sleep(5000)

val startScript = "../../sbin/start-thriftserver.sh".split("/").mkString(File.separator)
val stopScript = "../../sbin/stop-thriftserver.sh".split("/").mkString(File.separator)

val warehousePath = getTempFilePath("warehouse")
val metastorePath = getTempFilePath("metastore")
val metastoreJdbcUri = s"jdbc:derby:;databaseName=$metastorePath;create=true"
Expand Down Expand Up @@ -94,8 +91,9 @@ class HiveThriftServer2Suite extends FunSuite with Logging {
.run(ProcessLogger(captureLogOutput, _ => ()))
}
}
// reset SPARK_TESTING to avoid loading Log4J configurations in testing class paths
Process(command, None, ("SPARK_TESTING", "0")).run(ProcessLogger(

// Resets SPARK_TESTING to avoid loading Log4J configurations in testing class paths
Process(command, None, "SPARK_TESTING" -> "0").run(ProcessLogger(
captureThriftServerOutput("stdout"),
captureThriftServerOutput("stderr")))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ class TestHiveContext(sc: SparkContext) extends HiveContext(sc) {
*/
def reset() {
try {
// HACK: Hive is too noisy by default.
org.apache.log4j.LogManager.getCurrentLoggers.foreach { log =>
log.asInstanceOf[org.apache.log4j.Logger].setLevel(org.apache.log4j.Level.WARN)
}

clearCache()
loadedTables.clear()
catalog.client.getAllTables("default").foreach { t =>
Expand Down