Index: webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClientHMSImpl.java =================================================================== --- webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClientHMSImpl.java (revision 1376806) +++ webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClientHMSImpl.java (working copy) @@ -238,7 +238,7 @@ 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( Index: webhcat/java-client/src/test/java/org/apache/hcatalog/api/TestHCatClient.java =================================================================== --- webhcat/java-client/src/test/java/org/apache/hcatalog/api/TestHCatClient.java (revision 1376806) +++ webhcat/java-client/src/test/java/org/apache/hcatalog/api/TestHCatClient.java (working copy) @@ -352,4 +352,22 @@ 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); + } + } }