|
@@ -680,14 +680,14 @@ class HiveServerClient:
|
|
|
return res, schema
|
|
return res, schema
|
|
|
|
|
|
|
|
|
|
|
|
|
- def fetch_result(self, operation_handle, orientation=TFetchOrientation.FETCH_NEXT, max_rows=1000):
|
|
|
|
|
|
|
+ def fetch_result(self, operation_handle, orientation=TFetchOrientation.FETCH_FIRST, max_rows=1000):
|
|
|
if operation_handle.hasResultSet:
|
|
if operation_handle.hasResultSet:
|
|
|
fetch_req = TFetchResultsReq(operationHandle=operation_handle, orientation=orientation, maxRows=max_rows)
|
|
fetch_req = TFetchResultsReq(operationHandle=operation_handle, orientation=orientation, maxRows=max_rows)
|
|
|
res = self.call(self._client.FetchResults, fetch_req)
|
|
res = self.call(self._client.FetchResults, fetch_req)
|
|
|
else:
|
|
else:
|
|
|
res = TFetchResultsResp(results=TRowSet(startRowOffset=0, rows=[], columns=[]))
|
|
res = TFetchResultsResp(results=TRowSet(startRowOffset=0, rows=[], columns=[]))
|
|
|
|
|
|
|
|
- if operation_handle.hasResultSet:
|
|
|
|
|
|
|
+ if operation_handle.hasResultSet and TFetchOrientation.FETCH_FIRST: # Only fetch for the first call that should be with start_over
|
|
|
meta_req = TGetResultSetMetadataReq(operationHandle=operation_handle)
|
|
meta_req = TGetResultSetMetadataReq(operationHandle=operation_handle)
|
|
|
schema = self.call(self._client.GetResultSetMetadata, meta_req)
|
|
schema = self.call(self._client.GetResultSetMetadata, meta_req)
|
|
|
else:
|
|
else:
|