def get_log(service, operation_handle): req = TGetLogReq(operationHandle=operation_handle) log.debug('get_log: req=%s', req) resp = service.GetLog(req) log.debug('get_log: resp=%s', resp) err_if_rpc_not_ok(resp) return resp.log
def get_log(self, max_rows=1024, orientation=TFetchOrientation.FETCH_NEXT): try: req = TGetLogReq(operationHandle=self.handle) log = self._rpc('GetLog', req).log except TApplicationException as e: # raised if Hive is used if not e.type == TApplicationException.UNKNOWN_METHOD: raise req = TFetchResultsReq(operationHandle=self.handle, orientation=orientation, maxRows=max_rows, fetchType=1) resp = self._rpc('FetchResults', req) schema = [('Log', 'STRING', None, None, None, None, None)] log = self._wrap_results(resp.results, schema, convert_types=True) log = '\n'.join(l[0] for l in log) return log
def get_log(self): req = TGetLogReq(operationHandle=self.handle) return self._rpc('GetLog', req).log