private TGetOperationStatusResp waitForResultSetStatus() throws SQLException {
    TGetOperationStatusReq statusReq = new TGetOperationStatusReq(stmtHandle.get());
    TGetOperationStatusResp statusResp = null;

    while (statusResp == null || !statusResp.isSetHasResultSet()) {
      try {
        statusResp = client.GetOperationStatus(statusReq);
      } catch (TException e) {
        isLogBeingGenerated = false;
        throw new SQLException("Failed to wait for result set status", "08S01", e);
      }
    }

    return statusResp;
  }
Poll the result set status by checking if isSetHasResultSet is set
@return
@throws SQLException
jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java