Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5B6E1200B5A for ; Thu, 21 Jul 2016 03:03:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 59F44160A89; Thu, 21 Jul 2016 01:03:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7AEA0160A64 for ; Thu, 21 Jul 2016 03:03:38 +0200 (CEST) Received: (qmail 66288 invoked by uid 500); 21 Jul 2016 01:03:37 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 66277 invoked by uid 99); 21 Jul 2016 01:03:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2016 01:03:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 83CFAE04BA; Thu, 21 Jul 2016 01:03:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hashutosh@apache.org To: commits@hive.apache.org Message-Id: <67b3459efea14b689e646967968fff2a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hive git commit: HIVE-14279 : fix mvn test TestHiveMetaStore.testTransactionalValidation (Zoltan Haindrich via Ashutosh Chauhan) Date: Thu, 21 Jul 2016 01:03:37 +0000 (UTC) archived-at: Thu, 21 Jul 2016 01:03:39 -0000 Repository: hive Updated Branches: refs/heads/master 8b8d83f8a -> 3390f5d48 HIVE-14279 : fix mvn test TestHiveMetaStore.testTransactionalValidation (Zoltan Haindrich via Ashutosh Chauhan) Signed-off-by: Ashutosh Chauhan Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/3390f5d4 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/3390f5d4 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/3390f5d4 Branch: refs/heads/master Commit: 3390f5d48fda6e86d36fce062c4ab98c15aefb0b Parents: 8b8d83f Author: Zoltan Haindrich Authored: Wed Jul 20 18:02:30 2016 -0700 Committer: Ashutosh Chauhan Committed: Wed Jul 20 18:03:11 2016 -0700 ---------------------------------------------------------------------- .../hive/metastore/TestHiveMetaStore.java | 25 ++++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/3390f5d4/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java ---------------------------------------------------------------------- diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java index d90085b..21d1b46 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java @@ -2874,6 +2874,11 @@ public abstract class TestHiveMetaStore extends TestCase { @Test public void testTransactionalValidation() throws Throwable { + String dbName = "acidDb"; + silentDropDatabase(dbName); + Database db = new Database(); + db.setName(dbName); + client.createDatabase(db); String tblName = "acidTable"; String owner = "acid"; Map fields = new HashMap(); @@ -2895,7 +2900,7 @@ public abstract class TestHiveMetaStore extends TestCase { // Fail - No "transactional" property is specified try { - Table t = createTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, owner, params, null, sd, 0); + Table t = createTable(dbName, tblName, owner, params, null, sd, 0); Assert.assertTrue("Expected exception", false); } catch (MetaException e) { Assert.assertEquals("'transactional' property of TBLPROPERTIES may only have value 'true'", e.getMessage()); @@ -2905,7 +2910,7 @@ public abstract class TestHiveMetaStore extends TestCase { try { params.clear(); params.put("transactional", "foobar"); - Table t = createTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, owner, params, null, sd, 0); + Table t = createTable(dbName, tblName, owner, params, null, sd, 0); Assert.assertTrue("Expected exception", false); } catch (MetaException e) { Assert.assertEquals("'transactional' property of TBLPROPERTIES may only have value 'true'", e.getMessage()); @@ -2915,7 +2920,7 @@ public abstract class TestHiveMetaStore extends TestCase { try { params.clear(); params.put("transactional", "true"); - Table t = createTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, owner, params, null, sd, 0); + Table t = createTable(dbName, tblName, owner, params, null, sd, 0); Assert.assertTrue("Expected exception", false); } catch (MetaException e) { Assert.assertEquals("The table must be bucketed and stored using an ACID compliant format (such as ORC)", e.getMessage()); @@ -2928,7 +2933,7 @@ public abstract class TestHiveMetaStore extends TestCase { List bucketCols = new ArrayList(); bucketCols.add("income"); sd.setBucketCols(bucketCols); - Table t = createTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, owner, params, null, sd, 0); + Table t = createTable(dbName, tblName, owner, params, null, sd, 0); Assert.assertTrue("Expected exception", false); } catch (MetaException e) { Assert.assertEquals("The table must be bucketed and stored using an ACID compliant format (such as ORC)", e.getMessage()); @@ -2942,7 +2947,7 @@ public abstract class TestHiveMetaStore extends TestCase { sd.setBucketCols(bucketCols); sd.setInputFormat("org.apache.hadoop.hive.ql.io.orc.OrcInputFormat"); sd.setOutputFormat("org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat"); - Table t = createTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, owner, params, null, sd, 0); + Table t = createTable(dbName, tblName, owner, params, null, sd, 0); Assert.assertTrue("CREATE TABLE should succeed", "true".equals(t.getParameters().get(hive_metastoreConstants.TABLE_IS_TRANSACTIONAL))); /// ALTER TABLE scenarios @@ -2953,7 +2958,7 @@ public abstract class TestHiveMetaStore extends TestCase { params.put("transactional", "false"); t = new Table(); t.setParameters(params); - client.alter_table(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, t); + client.alter_table(dbName, tblName, t); Assert.assertTrue("Expected exception", false); } catch (MetaException e) { Assert.assertEquals("TBLPROPERTIES with 'transactional'='true' cannot be unset", e.getMessage()); @@ -2964,10 +2969,10 @@ public abstract class TestHiveMetaStore extends TestCase { tblName += "1"; params.clear(); sd.unsetBucketCols(); - t = createTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, owner, params, null, sd, 0); + t = createTable(dbName, tblName, owner, params, null, sd, 0); params.put("transactional", "true"); t.setParameters(params); - client.alter_table(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, t); + client.alter_table(dbName, tblName, t); Assert.assertTrue("Expected exception", false); } catch (MetaException e) { Assert.assertEquals("The table must be bucketed and stored using an ACID compliant format (such as ORC)", e.getMessage()); @@ -2978,11 +2983,11 @@ public abstract class TestHiveMetaStore extends TestCase { params.clear(); sd.setNumBuckets(1); sd.setBucketCols(bucketCols); - t = createTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, owner, params, null, sd, 0); + t = createTable(dbName, tblName, owner, params, null, sd, 0); params.put("transactional", "true"); t.setParameters(params); t.setPartitionKeys(Collections.EMPTY_LIST); - client.alter_table(MetaStoreUtils.DEFAULT_DATABASE_NAME, tblName, t); + client.alter_table(dbName, tblName, t); Assert.assertTrue("ALTER TABLE should succeed", "true".equals(t.getParameters().get(hive_metastoreConstants.TABLE_IS_TRANSACTIONAL))); }