zabetak commented on a change in pull request #1331:
URL: https://github.com/apache/hive/pull/1331#discussion_r464505336



##########
File path: 
itests/util/src/main/java/org/apache/hadoop/hive/ql/dataset/QTestDatasetHandler.java
##########
@@ -84,23 +83,25 @@ public boolean initDataset(String table, CliDriver 
cliDriver) throws Exception {
 
     try {
       CommandProcessorResponse result = cliDriver.processLine(commands);
-      LOG.info("Result from cliDrriver.processLine in initFromDatasets=" + 
result);
+      LOG.info("Result from cliDrriver.processLine in initDataset=" + result);
     } catch (CommandProcessorException e) {
-      Assert.fail("Failed during initFromDatasets processLine with code=" + e);
+      throw new RuntimeException("Failed while loading table " + table, e);
     }
-
-    return true;
+    // Add the talbe in sources if it is loaded sucessfully
+    addSrcTable(table);
   }
 
-  public boolean unloadDataset(String table, CliDriver cliDriver) throws 
Exception {
+  private void unloadDataset(String table, CliDriver cliDriver) {
     try {
+      // Remove table from sources otherwise the following command will fail 
due to EnforceReadOnlyTables.
+      removeSrcTable(table);
       CommandProcessorResponse result = cliDriver.processLine("drop table " + 
table);
-      LOG.info("Result from cliDrriver.processLine in initFromDatasets=" + 
result);
+      LOG.info("Result from cliDrriver.processLine in unloadDataset=" + 
result);
     } catch (CommandProcessorException e) {
-      Assert.fail("Failed during initFromDatasets processLine with code=" + e);
+      // If the unloading fails for any reason then add again the table to 
sources since it is still there.
+      addSrcTable(table);
+      throw new RuntimeException("Failed while unloading table " + table, e);

Review comment:
       Given that there are no test failures I would say no but let's wait to 
see what @kgyrtkirk has to say :) On the other hand, as I noted in the JIRA 
there is code that does not work well if an assertion is thrown here. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to