incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avand...@apache.org
Subject svn commit: r1377014 - in /incubator/hcatalog/trunk: CHANGES.txt webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClientHMSImpl.java webhcat/java-client/src/test/java/org/apache/hcatalog/api/TestHCatClient.java
Date Fri, 24 Aug 2012 18:00:51 GMT
Author: avandana
Date: Fri Aug 24 18:00:51 2012
New Revision: 1377014

URL: http://svn.apache.org/viewvc?rev=1377014&view=rev
Log:
HCAT-477 Drop table API in webhcat client does not respect the ifExists parameter.

Modified:
    incubator/hcatalog/trunk/CHANGES.txt
    incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClientHMSImpl.java
    incubator/hcatalog/trunk/webhcat/java-client/src/test/java/org/apache/hcatalog/api/TestHCatClient.java

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1377014&r1=1377013&r2=1377014&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Fri Aug 24 18:00:51 2012
@@ -83,6 +83,8 @@ Trunk (unreleased changes)
   OPTIMIZATIONS
 
   BUG FIXES
+  HCAT-477 Drop table API in webhcat client does not respect the "ifExists" parameter.
+
   HCAT-471 Test HCat_ShowDes_1[1-3] fails (vikram.dixit via gates)
 
   HCAT-470 Update HCat version numbers in Templeton doc set (lefty via gates)

Modified: incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClientHMSImpl.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClientHMSImpl.java?rev=1377014&r1=1377013&r2=1377014&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClientHMSImpl.java
(original)
+++ incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClientHMSImpl.java
Fri Aug 24 18:00:51 2012
@@ -238,7 +238,7 @@ public class HCatClientHMSImpl extends H
     public void dropTable(String dbName, String tableName, boolean ifExists)
             throws HCatException, ConnectionFailureException {
         try {
-            hmsClient.dropTable(checkDB(dbName), tableName);
+            hmsClient.dropTable(checkDB(dbName), tableName,true, ifExists);
         } catch (NoSuchObjectException e) {
             if (!ifExists) {
                 throw new HCatException(

Modified: incubator/hcatalog/trunk/webhcat/java-client/src/test/java/org/apache/hcatalog/api/TestHCatClient.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/java-client/src/test/java/org/apache/hcatalog/api/TestHCatClient.java?rev=1377014&r1=1377013&r2=1377014&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/java-client/src/test/java/org/apache/hcatalog/api/TestHCatClient.java
(original)
+++ incubator/hcatalog/trunk/webhcat/java-client/src/test/java/org/apache/hcatalog/api/TestHCatClient.java
Fri Aug 24 18:00:51 2012
@@ -352,4 +352,22 @@ public class TestHCatClient {
             assertTrue("The expected exception was never thrown.", isExceptionCaught);
         }
     }
+
+    @Test
+    public void testDropTableException() throws Exception {
+        HCatClient client = HCatClient.create(new Configuration(hcatConf));
+        String tableName = "tableToBeDropped";
+        boolean isExceptionCaught = false;
+        client.dropTable(null, tableName, true);
+        try {
+            client.dropTable(null, tableName, false);
+        } catch (Exception exp) {
+            isExceptionCaught = true;
+            assertTrue(exp instanceof HCatException);
+            LOG.info("Drop Table Exception: " + exp.getCause());
+        } finally {
+            client.close();
+            assertTrue("The expected exception was never thrown.", isExceptionCaught);
+        }
+    }
 }



Mime
View raw message