From c464025ca8cccd0b31c0b3014d945f78870238ff Mon Sep 17 00:00:00 2001 From: Ashutosh Chauhan Date: Thu, 12 Nov 2015 16:27:02 -0800 Subject: [PATCH] HIVE-1841 : datanucleus.fixedDatastore should be true and autoCreate should be false by default --- beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java | 7 ++++--- beeline/src/test/resources/hive-site.xml | 11 +++++++++++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java | 4 ++-- data/conf/hive-site.xml | 10 ++++++++++ data/conf/llap/hive-site.xml | 10 ++++++++++ data/conf/spark/standalone/hive-site.xml | 10 ++++++++++ data/conf/spark/yarn-client/hive-site.xml | 11 +++++++++++ data/conf/tez/hive-site.xml | 10 ++++++++++ 8 files changed, 68 insertions(+), 5 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 e1a565b..21ba690 100644 --- a/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java +++ b/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java @@ -17,11 +17,11 @@ */ package org.apache.hive.beeline.cli; -import junit.framework.Assert; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -38,7 +38,6 @@ private static final Logger LOG = LoggerFactory.getLogger(TestHiveCli.class.getName()); private static final int ERRNO_OK = 0; private static final int ERRNO_ARGS = 1; - private static final int ERRNO_OTHER = 2; private final static String SOURCE_CONTEXT = "create table if not exists test.testSrcTbl(sc1 string);"; @@ -277,9 +276,11 @@ private File generateTmpFile(String context) { @Before public void setup() { + System.setProperty("datanucleus.fixedDatastore", "false"); + System.setProperty("datanucleus.autoCreateSchema", "true"); cli = new HiveCli(); - initFromFile(); redirectOutputStream(); + initFromFile(); } @After diff --git a/beeline/src/test/resources/hive-site.xml b/beeline/src/test/resources/hive-site.xml index d2df03c..b2347c7 100644 --- a/beeline/src/test/resources/hive-site.xml +++ b/beeline/src/test/resources/hive-site.xml @@ -23,6 +23,17 @@ true Internal marker for test. Used for masking env-dependent values + + + datanucleus.autoCreateSchema + true + + + + datanucleus.fixedDatastore + 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 01cd731..425c7d9 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -544,9 +544,9 @@ public void setSparkConfigUpdated(boolean isSparkConfigUpdated) { METASTORE_VALIDATE_CONSTRAINTS("datanucleus.validateConstraints", false, "validates existing schema against code. turn this on if you want to verify existing schema"), METASTORE_STORE_MANAGER_TYPE("datanucleus.storeManagerType", "rdbms", "metadata store type"), - METASTORE_AUTO_CREATE_SCHEMA("datanucleus.autoCreateSchema", true, + 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", false, ""), + METASTORE_FIXED_DATASTORE("datanucleus.fixedDatastore", true, "Dictates whether to allow updates to schema or not."), METASTORE_SCHEMA_VERIFICATION("hive.metastore.schema.verification", false, "Enforce metastore schema version consistency.\n" + "True: Verify that version information stored in metastore matches with one from Hive jars. Also disable automatic\n" + diff --git a/data/conf/hive-site.xml b/data/conf/hive-site.xml index 1b2359b..d15cc17 100644 --- a/data/conf/hive-site.xml +++ b/data/conf/hive-site.xml @@ -59,6 +59,16 @@ + datanucleus.autoCreateSchema + true + + + + datanucleus.fixedDatastore + 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 77f6945..becb5b2 100644 --- a/data/conf/llap/hive-site.xml +++ b/data/conf/llap/hive-site.xml @@ -69,6 +69,16 @@ + datanucleus.autoCreateSchema + true + + + + datanucleus.fixedDatastore + 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 759f3f7..38d0832 100644 --- a/data/conf/spark/standalone/hive-site.xml +++ b/data/conf/spark/standalone/hive-site.xml @@ -45,6 +45,16 @@ + datanucleus.autoCreateSchema + true + + + + datanucleus.fixedDatastore + 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 40ff688..ada3f3b 100644 --- a/data/conf/spark/yarn-client/hive-site.xml +++ b/data/conf/spark/yarn-client/hive-site.xml @@ -45,6 +45,17 @@ + datanucleus.autoCreateSchema + true + + + + datanucleus.fixedDatastore + false + + + + javax.jdo.option.ConnectionURL jdbc:derby:;databaseName=${test.tmp.dir}/junit_metastore_db;create=true diff --git a/data/conf/tez/hive-site.xml b/data/conf/tez/hive-site.xml index 5074427..d008ad1 100644 --- a/data/conf/tez/hive-site.xml +++ b/data/conf/tez/hive-site.xml @@ -63,6 +63,16 @@ + datanucleus.autoCreateSchema + true + + + + datanucleus.fixedDatastore + false + + + hive.exec.local.scratchdir ${test.tmp.dir}/localscratchdir/ Local scratch space for Hive jobs -- 1.7.12.4 (Apple Git-37)