def async_state(handles)
      response = @client.GetOperationStatus(
        Hive2::Thrift::TGetOperationStatusReq.new(operationHandle: prepare_operation_handle(handles))
      )

      case response.operationState
      when Hive2::Thrift::TOperationState::FINISHED_STATE
        return :finished
      when Hive2::Thrift::TOperationState::INITIALIZED_STATE
        return :initialized
      when Hive2::Thrift::TOperationState::RUNNING_STATE
        return :running
      when Hive2::Thrift::TOperationState::CANCELED_STATE
        return :cancelled
      when Hive2::Thrift::TOperationState::CLOSED_STATE
        return :closed
      when Hive2::Thrift::TOperationState::ERROR_STATE
        return :error
      when Hive2::Thrift::TOperationState::UKNOWN_STATE
        return :unknown
      when Hive2::Thrift::TOperationState::PENDING_STATE
        return :pending
      when nil
        raise "No operation state found for handles - has the session been closed?"
      else
        return :state_not_in_protocol
      end
    end
def async_state(handles)
      response = @client.GetOperationStatus(
        Hive2::Thrift::TGetOperationStatusReq.new(operationHandle: prepare_operation_handle(handles))
      )

      case response.operationState
      when Hive2::Thrift::TOperationState::FINISHED_STATE
        return :finished
      when Hive2::Thrift::TOperationState::INITIALIZED_STATE
        return :initialized
      when Hive2::Thrift::TOperationState::RUNNING_STATE
        return :running
      when Hive2::Thrift::TOperationState::CANCELED_STATE
        return :cancelled
      when Hive2::Thrift::TOperationState::CLOSED_STATE
        return :closed
      when Hive2::Thrift::TOperationState::ERROR_STATE
        return :error
      when Hive2::Thrift::TOperationState::UKNOWN_STATE
        return :unknown
      when Hive2::Thrift::TOperationState::PENDING_STATE
        return :pending
      when nil
        raise "No operation state found for handles - has the session been closed?"
      else
        return :state_not_in_protocol
      end
    end
Map states to symbols