kgyrtkirk commented on a change in pull request #784: HIVE-22235 
CommandProcessorResponse should not be an exception
URL: https://github.com/apache/hive/pull/784#discussion_r332941943
 
 

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/DriverUtils.java
 ##########
 @@ -51,10 +51,11 @@ public static void runOnDriver(HiveConf conf, String user,
       Driver driver = new Driver(qs, user, null, null);
       driver.setCompactionWriteIds(writeIds, compactorTxnId);
       try {
-        CommandProcessorResponse cpr = driver.run(query);
-        if (cpr.getResponseCode() != 0) {
-          LOG.error("Failed to run " + query, cpr.getException());
-          throw new HiveException("Failed to run " + query, 
cpr.getException());
+        try {
+          driver.run(query);
+        } catch (CommandProcessorException e) {
+          LOG.error("Failed to run " + query, e.getException());
+          throw new HiveException("Failed to run " + query, e.getException());
 
 Review comment:
   e.getException() => e
   as e contains some descriptive message - what is the issue

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to