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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]