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_r332941127
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
 ##########
 @@ -311,9 +310,10 @@ private PlanFragment createPlanFragment(String query, 
ApplicationId splitsAppId)
     DriverCleanup driverCleanup = new DriverCleanup(driver, txnManager, 
splitsAppId.toString());
     boolean needsCleanup = true;
     try {
-      CommandProcessorResponse cpr = driver.compileAndRespond(query, false);
-      if (cpr.getResponseCode() != 0) {
-        throw new HiveException("Failed to compile query: " + 
cpr.getException());
+      try {
+        driver.compileAndRespond(query, false);
+      } catch (CommandProcessorException e) {
+        throw new HiveException("Failed to compile query: " + 
e.getException());
 
 Review comment:
   I think we shouldn't call e.getException() 
   use it directly - as it contains usefull
   and also pass e as the parent exception ; so we will get a full backtrace 
not just a hiveexception coming from this line
   

----------------------------------------------------------------
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