[jira] [Work logged] (HIVE-22235) CommandProcessorResponse should not be an exception
[ https://issues.apache.org/jira/browse/HIVE-22235?focusedWorklogId=325678=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325678 ] ASF GitHub Bot logged work on HIVE-22235: - Author: ASF GitHub Bot Created on: 09/Oct/19 13:04 Start Date: 09/Oct/19 13:04 Worklog Time Spent: 10m Work Description: miklosgergely commented on pull request #784: HIVE-22235 CommandProcessorResponse should not be an exception URL: https://github.com/apache/hive/pull/784 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 Issue Time Tracking --- Worklog Id: (was: 325678) Time Spent: 1h 10m (was: 1h) > CommandProcessorResponse should not be an exception > --- > > Key: HIVE-22235 > URL: https://issues.apache.org/jira/browse/HIVE-22235 > Project: Hive > Issue Type: Sub-task > Components: Hive >Reporter: Miklos Gergely >Assignee: Miklos Gergely >Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Attachments: HIVE-22235.01.patch, HIVE-22235.02.patch, > HIVE-22235.03.patch, HIVE-22235.04.patch, HIVE-22235.05.patch, > HIVE-22235.06.patch, HIVE-22235.07.patch, HIVE-22235.08.patch > > Time Spent: 1h 10m > Remaining Estimate: 0h > > The CommandProcessorResponse class extends Exception. This may be convenient, > but it is wrong, as a response is not an exception. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (HIVE-22235) CommandProcessorResponse should not be an exception
[ https://issues.apache.org/jira/browse/HIVE-22235?focusedWorklogId=325628=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325628 ] ASF GitHub Bot logged work on HIVE-22235: - Author: ASF GitHub Bot Created on: 09/Oct/19 10:36 Start Date: 09/Oct/19 10:36 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on pull request #784: HIVE-22235 CommandProcessorResponse should not be an exception URL: https://github.com/apache/hive/pull/784#discussion_r332935605 ## File path: ql/src/java/org/apache/hadoop/hive/ql/DriverState.java ## @@ -86,16 +86,35 @@ public void compiling() { driverState = State.COMPILING; } + public void compilingWithLocking() { +lock(); +try { + driverState = State.COMPILING; +} finally { + unlock(); +} + } + public boolean isCompiling() { return driverState == State.COMPILING; } - public void compilationInterrupted(boolean deferClose) { -driverState = deferClose ? State.EXECUTING : State.ERROR; + public void compilationInterruptedWithLocking(boolean deferClose) { Review comment: I don't really see these methods really usefull how about a single method named "transition(newState)" then the control logic: "wasError" / "deferClose" can be left outside 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 Issue Time Tracking --- Worklog Id: (was: 325628) Time Spent: 40m (was: 0.5h) > CommandProcessorResponse should not be an exception > --- > > Key: HIVE-22235 > URL: https://issues.apache.org/jira/browse/HIVE-22235 > Project: Hive > Issue Type: Sub-task > Components: Hive >Reporter: Miklos Gergely >Assignee: Miklos Gergely >Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Attachments: HIVE-22235.01.patch, HIVE-22235.02.patch, > HIVE-22235.03.patch, HIVE-22235.04.patch, HIVE-22235.05.patch, > HIVE-22235.06.patch, HIVE-22235.07.patch, HIVE-22235.08.patch > > Time Spent: 40m > Remaining Estimate: 0h > > The CommandProcessorResponse class extends Exception. This may be convenient, > but it is wrong, as a response is not an exception. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (HIVE-22235) CommandProcessorResponse should not be an exception
[ https://issues.apache.org/jira/browse/HIVE-22235?focusedWorklogId=325627=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325627 ] ASF GitHub Bot logged work on HIVE-22235: - Author: ASF GitHub Bot Created on: 09/Oct/19 10:36 Start Date: 09/Oct/19 10:36 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on pull request #784: HIVE-22235 CommandProcessorResponse should not be an exception URL: https://github.com/apache/hive/pull/784#discussion_r332942002 ## 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()); Review comment: e.getException() => e 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 Issue Time Tracking --- Worklog Id: (was: 325627) Time Spent: 0.5h (was: 20m) > CommandProcessorResponse should not be an exception > --- > > Key: HIVE-22235 > URL: https://issues.apache.org/jira/browse/HIVE-22235 > Project: Hive > Issue Type: Sub-task > Components: Hive >Reporter: Miklos Gergely >Assignee: Miklos Gergely >Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Attachments: HIVE-22235.01.patch, HIVE-22235.02.patch, > HIVE-22235.03.patch, HIVE-22235.04.patch, HIVE-22235.05.patch, > HIVE-22235.06.patch, HIVE-22235.07.patch, HIVE-22235.08.patch > > Time Spent: 0.5h > Remaining Estimate: 0h > > The CommandProcessorResponse class extends Exception. This may be convenient, > but it is wrong, as a response is not an exception. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (HIVE-22235) CommandProcessorResponse should not be an exception
[ https://issues.apache.org/jira/browse/HIVE-22235?focusedWorklogId=325630=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325630 ] ASF GitHub Bot logged work on HIVE-22235: - Author: ASF GitHub Bot Created on: 09/Oct/19 10:36 Start Date: 09/Oct/19 10:36 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on 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())) { } -} 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325630) Time Spent: 1h (was: 50m) > CommandProcessorResponse should not be an exception > --- > > Key: HIVE-22235 > URL: https://issues.apache.org/jira/browse/HIVE-22235 > Project: Hive > Issue Type: Sub-task > Components: Hive >Reporter: Miklos Gergely >Assignee: Miklos Gergely >Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Attachments: HIVE-22235.01.patch, HIVE-22235.02.patch, > HIVE-22235.03.patch, HIVE-22235.04.patch, HIVE-22235.05.patch, > HIVE-22235.06.patch, HIVE-22235.07.patch, HIVE-22235.08.patch > > Time Spent: 1h > Remaining Estimate: 0h > > The CommandProcessorResponse class extends Exception. This may be convenient, > but it is wrong, as a response is not an exception. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (HIVE-22235) CommandProcessorResponse should not be an exception
[ https://issues.apache.org/jira/browse/HIVE-22235?focusedWorklogId=325631=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325631 ] ASF GitHub Bot logged work on HIVE-22235: - Author: ASF GitHub Bot Created on: 09/Oct/19 10:36 Start Date: 09/Oct/19 10:36 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on pull request #784: HIVE-22235 CommandProcessorResponse should not be an exception URL: https://github.com/apache/hive/pull/784#discussion_r332941305 ## File path: ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java ## @@ -345,17 +345,18 @@ private PlanFragment createPlanFragment(String query, ApplicationId splitsAppId) driver.releaseLocksAndCommitOrRollback(false); driver.releaseResources(); HiveConf.setVar(conf, ConfVars.HIVE_EXECUTION_MODE, originalMode); -cpr = driver.run(ctas, false); - -if(cpr.getResponseCode() != 0) { - throw new HiveException("Failed to create temp table: " + cpr.getException()); +try { + driver.run(ctas, false); +} catch (CommandProcessorException e) { + throw new HiveException("Failed to create temp table: " + 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325631) Time Spent: 1h (was: 50m) > CommandProcessorResponse should not be an exception > --- > > Key: HIVE-22235 > URL: https://issues.apache.org/jira/browse/HIVE-22235 > Project: Hive > Issue Type: Sub-task > Components: Hive >Reporter: Miklos Gergely >Assignee: Miklos Gergely >Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Attachments: HIVE-22235.01.patch, HIVE-22235.02.patch, > HIVE-22235.03.patch, HIVE-22235.04.patch, HIVE-22235.05.patch, > HIVE-22235.06.patch, HIVE-22235.07.patch, HIVE-22235.08.patch > > Time Spent: 1h > Remaining Estimate: 0h > > The CommandProcessorResponse class extends Exception. This may be convenient, > but it is wrong, as a response is not an exception. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (HIVE-22235) CommandProcessorResponse should not be an exception
[ https://issues.apache.org/jira/browse/HIVE-22235?focusedWorklogId=325626=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325626 ] ASF GitHub Bot logged work on HIVE-22235: - Author: ASF GitHub Bot Created on: 09/Oct/19 10:36 Start Date: 09/Oct/19 10:36 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325626) Time Spent: 20m (was: 10m) > CommandProcessorResponse should not be an exception > --- > > Key: HIVE-22235 > URL: https://issues.apache.org/jira/browse/HIVE-22235 > Project: Hive > Issue Type: Sub-task > Components: Hive >Reporter: Miklos Gergely >Assignee: Miklos Gergely >Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Attachments: HIVE-22235.01.patch, HIVE-22235.02.patch, > HIVE-22235.03.patch, HIVE-22235.04.patch, HIVE-22235.05.patch, > HIVE-22235.06.patch, HIVE-22235.07.patch, HIVE-22235.08.patch > > Time Spent: 20m > Remaining Estimate: 0h > > The CommandProcessorResponse class extends Exception. This may be convenient, > but it is wrong, as a response is not an exception. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (HIVE-22235) CommandProcessorResponse should not be an exception
[ https://issues.apache.org/jira/browse/HIVE-22235?focusedWorklogId=325629=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325629 ] ASF GitHub Bot logged work on HIVE-22235: - Author: ASF GitHub Bot Created on: 09/Oct/19 10:36 Start Date: 09/Oct/19 10:36 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325629) Time Spent: 50m (was: 40m) > CommandProcessorResponse should not be an exception > --- > > Key: HIVE-22235 > URL: https://issues.apache.org/jira/browse/HIVE-22235 > Project: Hive > Issue Type: Sub-task > Components: Hive >Reporter: Miklos Gergely >Assignee: Miklos Gergely >Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Attachments: HIVE-22235.01.patch, HIVE-22235.02.patch, > HIVE-22235.03.patch, HIVE-22235.04.patch, HIVE-22235.05.patch, > HIVE-22235.06.patch, HIVE-22235.07.patch, HIVE-22235.08.patch > > Time Spent: 50m > Remaining Estimate: 0h > > The CommandProcessorResponse class extends Exception. This may be convenient, > but it is wrong, as a response is not an exception. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (HIVE-22235) CommandProcessorResponse should not be an exception
[ https://issues.apache.org/jira/browse/HIVE-22235?focusedWorklogId=317447=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-317447 ] ASF GitHub Bot logged work on HIVE-22235: - Author: ASF GitHub Bot Created on: 24/Sep/19 12:33 Start Date: 24/Sep/19 12:33 Worklog Time Spent: 10m Work Description: miklosgergely commented on pull request #784: HIVE-22235 CommandProcessorResponse should not be an exception URL: https://github.com/apache/hive/pull/784 The CommandProcessorResponse class extends Exception. This may be convenient, but it is wrong, as a response is not an exception. 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 Issue Time Tracking --- Worklog Id: (was: 317447) Remaining Estimate: 0h Time Spent: 10m > CommandProcessorResponse should not be an exception > --- > > Key: HIVE-22235 > URL: https://issues.apache.org/jira/browse/HIVE-22235 > Project: Hive > Issue Type: Sub-task > Components: Hive >Reporter: Miklos Gergely >Assignee: Miklos Gergely >Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Attachments: HIVE-22235.01.patch > > Time Spent: 10m > Remaining Estimate: 0h > > The CommandProcessorResponse class extends Exception. This may be convenient, > but it is wrong, as a response is not an exception. -- This message was sent by Atlassian Jira (v8.3.4#803005)