hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject hive git commit: HIVE-14279 : fix mvn test TestHiveMetaStore.testTransactionalValidation (Zoltan Haindrich via Ashutosh Chauhan)
Date Thu, 21 Jul 2016 01:03:37 GMT
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 <hashutosh@apache.org>


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 <kirk@rxd.hu>
Authored: Wed Jul 20 18:02:30 2016 -0700
Committer: Ashutosh Chauhan <hashutosh@apache.org>
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<String, String> fields = new HashMap<String, String>();
@@ -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<String> bucketCols = new ArrayList<String>();
       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)));
   }
 


Mime
View raw message