aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala7
-rw-r--r--sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUtilsSuite.scala36
2 files changed, 43 insertions, 0 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala
index bdec611453..39d71e164b 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala
@@ -394,6 +394,13 @@ private[spark] object HiveUtils extends Logging {
// hive.metastore.uris is not set.
propMap.put(ConfVars.METASTOREURIS.varname, "")
+ // The execution client will generate garbage events, therefore the listeners that are generated
+ // for the execution clients are useless. In order to not output garbage, we don't generate
+ // these listeners.
+ propMap.put(ConfVars.METASTORE_PRE_EVENT_LISTENERS.varname, "")
+ propMap.put(ConfVars.METASTORE_EVENT_LISTENERS.varname, "")
+ propMap.put(ConfVars.METASTORE_END_FUNCTION_LISTENERS.varname, "")
+
propMap.toMap
}
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUtilsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUtilsSuite.scala
new file mode 100644
index 0000000000..667a7ddd8b
--- /dev/null
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUtilsSuite.scala
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.hive
+
+import org.apache.hadoop.hive.conf.HiveConf.ConfVars
+
+import org.apache.spark.sql.hive.test.TestHiveSingleton
+import org.apache.spark.sql.test.SQLTestUtils
+import org.apache.spark.sql.QueryTest
+
+class HiveUtilsSuite extends QueryTest with SQLTestUtils with TestHiveSingleton {
+
+ test("newTemporaryConfiguration overwrites listener configurations") {
+ Seq(true, false).foreach { useInMemoryDerby =>
+ val conf = HiveUtils.newTemporaryConfiguration(useInMemoryDerby)
+ assert(conf(ConfVars.METASTORE_PRE_EVENT_LISTENERS.varname) === "")
+ assert(conf(ConfVars.METASTORE_EVENT_LISTENERS.varname) === "")
+ assert(conf(ConfVars.METASTORE_END_FUNCTION_LISTENERS.varname) === "")
+ }
+ }
+}