From dbe1597779514801055acc5890e9aa3207d9adf3 Mon Sep 17 00:00:00 2001 From: Ashutosh Chauhan Date: Tue, 17 Nov 2015 10:46:45 -0800 Subject: [PATCH] HIVE-12436 : Default hive.metastore.schema.verification to true --- beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java | 1 + beeline/src/test/resources/hive-site.xml | 5 +++++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java | 2 +- data/conf/hive-site.xml | 5 +++++ data/conf/llap/hive-site.xml | 5 +++++ data/conf/spark/standalone/hive-site.xml | 5 +++++ data/conf/spark/yarn-client/hive-site.xml | 4 ++++ data/conf/tez/hive-site.xml | 5 +++++ .../util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java | 8 ++------ 9 files changed, 33 insertions(+), 7 deletions(-) diff --git a/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java b/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java index 21ba690..53dfa1d 100644 --- a/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java +++ b/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java @@ -278,6 +278,7 @@ private File generateTmpFile(String context) { public void setup() { System.setProperty("datanucleus.fixedDatastore", "false"); System.setProperty("datanucleus.autoCreateSchema", "true"); + System.setProperty("hive.metastore.schema.verification", "false"); cli = new HiveCli(); redirectOutputStream(); initFromFile(); diff --git a/beeline/src/test/resources/hive-site.xml b/beeline/src/test/resources/hive-site.xml index b2347c7..615d4ed 100644 --- a/beeline/src/test/resources/hive-site.xml +++ b/beeline/src/test/resources/hive-site.xml @@ -34,6 +34,11 @@ false + + hive.metastore.schema.verification + false + + javax.jdo.option.ConnectionURL jdbc:derby:;databaseName=${test.tmp.dir}/metastore_db;create=true diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 838f25c..7b68040 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -547,7 +547,7 @@ public void setSparkConfigUpdated(boolean isSparkConfigUpdated) { METASTORE_AUTO_CREATE_SCHEMA("datanucleus.autoCreateSchema", false, "creates necessary schema on a startup if one doesn't exist. set this to false, after creating it once"), METASTORE_FIXED_DATASTORE("datanucleus.fixedDatastore", true, "Dictates whether to allow updates to schema or not."), - METASTORE_SCHEMA_VERIFICATION("hive.metastore.schema.verification", false, + METASTORE_SCHEMA_VERIFICATION("hive.metastore.schema.verification", true, "Enforce metastore schema version consistency.\n" + "True: Verify that version information stored in metastore matches with one from Hive jars. Also disable automatic\n" + " schema migration attempt. Users are required to manually migrate schema after Hive upgrade which ensures\n" + diff --git a/data/conf/hive-site.xml b/data/conf/hive-site.xml index d15cc17..2ebb1c4 100644 --- a/data/conf/hive-site.xml +++ b/data/conf/hive-site.xml @@ -69,6 +69,11 @@ + hive.metastore.schema.verification + false + + + javax.jdo.option.ConnectionURL jdbc:derby:;databaseName=${test.tmp.dir}/junit_metastore_db;create=true diff --git a/data/conf/llap/hive-site.xml b/data/conf/llap/hive-site.xml index becb5b2..9e15eda 100644 --- a/data/conf/llap/hive-site.xml +++ b/data/conf/llap/hive-site.xml @@ -79,6 +79,11 @@ + hive.metastore.schema.verification + false + + + javax.jdo.option.ConnectionURL jdbc:derby:;databaseName=${test.tmp.dir}/junit_metastore_db;create=true diff --git a/data/conf/spark/standalone/hive-site.xml b/data/conf/spark/standalone/hive-site.xml index 38d0832..1a45274 100644 --- a/data/conf/spark/standalone/hive-site.xml +++ b/data/conf/spark/standalone/hive-site.xml @@ -55,6 +55,11 @@ + hive.metastore.schema.verification + false + + + javax.jdo.option.ConnectionURL jdbc:derby:;databaseName=${test.tmp.dir}/junit_metastore_db;create=true diff --git a/data/conf/spark/yarn-client/hive-site.xml b/data/conf/spark/yarn-client/hive-site.xml index ada3f3b..346c248 100644 --- a/data/conf/spark/yarn-client/hive-site.xml +++ b/data/conf/spark/yarn-client/hive-site.xml @@ -54,6 +54,10 @@ false + + hive.metastore.schema.verification + false + javax.jdo.option.ConnectionURL diff --git a/data/conf/tez/hive-site.xml b/data/conf/tez/hive-site.xml index d008ad1..9e8b04f 100644 --- a/data/conf/tez/hive-site.xml +++ b/data/conf/tez/hive-site.xml @@ -73,6 +73,11 @@ + hive.metastore.schema.verification + false + + + hive.exec.local.scratchdir ${test.tmp.dir}/localscratchdir/ Local scratch space for Hive jobs diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java index bf6bea7..36762af 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java @@ -106,10 +106,10 @@ import org.apache.zookeeper.WatchedEvent; import org.apache.zookeeper.Watcher; import org.apache.zookeeper.ZooKeeper; +import org.junit.Assert; import com.google.common.collect.ImmutableList; -import junit.framework.Assert; import junit.framework.TestSuite; /** @@ -155,7 +155,6 @@ private HadoopShims.MiniMrShim mr = null; private HadoopShims.MiniDFSShim dfs = null; private HadoopShims.HdfsEncryptionShim hes = null; - private final boolean miniMr = false; private String hadoopVer = null; private QTestSetup setup = null; private TezSessionState tezSessionState = null; @@ -906,11 +905,8 @@ public void createSources(String tname) throws Exception { } public void init() throws Exception { - // System.out.println(conf.toString()); - testWarehouse = conf.getVar(HiveConf.ConfVars.METASTOREWAREHOUSE); - // conf.logVars(System.out); - // System.out.flush(); + testWarehouse = conf.getVar(HiveConf.ConfVars.METASTOREWAREHOUSE); String execEngine = conf.get("hive.execution.engine"); conf.set("hive.execution.engine", "mr"); SessionState.start(conf); -- 1.7.12.4 (Apple Git-37)