Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25812

GetResultSchema service called in ERROR state

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • CLI

    Description

      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:

       

        @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;
        }
      

       

      Adding ERROR to "assertState" should fix the problem.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              scarlin Steve Carlin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h