You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2019/10/09 10:36:51 UTC

[GitHub] [hive] kgyrtkirk commented on a change in pull request #784: HIVE-22235 CommandProcessorResponse should not be an exception

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_r332942091
 
 

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/parse/ExplainSemanticAnalyzer.java
 ##########
 @@ -148,15 +147,12 @@ public void analyzeInternal(ASTNode ast) throws SemanticException {
         runCtx = new Context(conf);
         // runCtx and ctx share the configuration, but not isExplainPlan()
         runCtx.setExplainConfig(config);
-        Driver driver = new Driver(conf, runCtx, queryState.getLineageState());
-        CommandProcessorResponse ret = driver.run(query);
-        if(ret.getResponseCode() == 0) {
-          // Note that we need to call getResults for simple fetch optimization.
-          // However, we need to skip all the results.
+        try (Driver driver = new Driver(conf, runCtx, queryState.getLineageState())) {
+          driver.run(query);
           while (driver.getResults(new ArrayList<String>())) {
           }
-        } else {
-          throw new SemanticException(ret.getErrorMessage(), ret.getException());
+        } catch (CommandProcessorException e) {
+          throw new SemanticException(e.getErrorMessage(), e.getException());
 
 Review comment:
   e.getException()

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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