[ https://issues.apache.org/jira/browse/HIVE-25812?focusedWorklogId=698501&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-698501 ]
ASF GitHub Bot logged work on HIVE-25812: ----------------------------------------- Author: ASF GitHub Bot Created on: 20/Dec/21 08:18 Start Date: 20/Dec/21 08:18 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on a change in pull request #2883: URL: https://github.com/apache/hive/pull/2883#discussion_r772158224 ########## File path: service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java ########## @@ -451,7 +451,8 @@ public void close() throws HiveSQLException { public TableSchema getResultSetSchema() throws HiveSQLException { // Since compilation is always a blocking RPC call, and schema is ready after compilation, // we can return when are in the RUNNING state. - assertState(Arrays.asList(OperationState.RUNNING, OperationState.FINISHED)); + assertState(Arrays.asList(OperationState.RUNNING, OperationState.FINISHED, Review comment: I might be coming in from the other direction - but can't we remove `RUNNING` as well? as a matter of fact I think this method should only be called in "final" state - and the only final state in which this method makes sense is when the state is `FINISHED` from where this is being called when it causes 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. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 698501) Time Spent: 20m (was: 10m) > GetResultSchema service called in ERROR state > --------------------------------------------- > > Key: HIVE-25812 > URL: https://issues.apache.org/jira/browse/HIVE-25812 > Project: Hive > Issue Type: Improvement > Components: CLI > Reporter: Steve Carlin > Priority: Major > Labels: pull-request-available > Time Spent: 20m > Remaining Estimate: 0h > > After the "Execute" call is made from an HS2 client, the "GetResultsMetaData" > is called, followed by the "Fetch" call. > If the "Execute" sets the error state to "ERROR" before the > GetResultsMetaData has been called, an exception is thrown since it only > expects the state to be RUNNING or FINISHED. > The code affecting it is SQLOperation: > > {code:java} > @Override > public TableSchema getResultSetSchema() throws HiveSQLException { > // Since compilation is always a blocking RPC call, and schema is ready > after compilation, > // we can return when are in the RUNNING state. > assertState(Arrays.asList(OperationState.RUNNING, > OperationState.FINISHED)); > if (resultSchema == null) { > resultSchema = new TableSchema(driver.getSchema()); > } > return resultSchema; > } > {code} > > Adding ERROR to "assertState" should fix the problem. -- This message was sent by Atlassian Jira (v8.20.1#820001)