Exemplo n.º 1
0
 def close(self):
     if self.operationHandle is not None:
         req = TCloseOperationReq(operationHandle=self.operationHandle)
         self.client.CloseOperation(req) 
Exemplo n.º 2
0
 def close_operation(self, operation_handle):
   req = TCloseOperationReq(operationHandle=operation_handle)
   return self.call(self._client.CloseOperation, req)
Exemplo n.º 3
0
    ## 3) Show tables
    print "\n3) Try fetching table list..."
    query = TExecuteStatementReq(session,
                                 statement="show tables",
                                 confOverlay={})
    response = client.ExecuteStatement(query)
    opHandle = response.operationHandle

    fetchReq = TFetchResultsReq(operationHandle=opHandle,
                                orientation=TFetchOrientation.FETCH_NEXT,
                                maxRows=100)
    resultsRes = client.FetchResults(fetchReq)

    ## close operation && release lock
    req = TCloseOperationReq(operationHandle=opHandle)
    client.CloseOperation(req)

    print('-' * 32)
    for row in resultsRes.results.rows:
        print row.colVals[0].stringVal.value
    print('-' * 32)

    # 4) try execute HQL
    print "\n4) Executing Test HQL: %s..." % test_hql
    query = TExecuteStatementReq(session, statement=test_hql, confOverlay={})
    response = client.ExecuteStatement(query)
    opHandle = response.operationHandle

    print('-' * 32)
    meta = []