|
@@ -29,7 +29,7 @@ from TCLIService.ttypes import TOpenSessionReq, TGetTablesReq, TFetchResultsReq,
|
|
|
TStatusCode, TGetResultSetMetadataReq, TGetColumnsReq, TTypeId,\
|
|
TStatusCode, TGetResultSetMetadataReq, TGetColumnsReq, TTypeId,\
|
|
|
TExecuteStatementReq, TGetOperationStatusReq, TFetchOrientation,\
|
|
TExecuteStatementReq, TGetOperationStatusReq, TFetchOrientation,\
|
|
|
TCloseSessionReq, TGetSchemasReq, TGetLogReq, TCancelOperationReq,\
|
|
TCloseSessionReq, TGetSchemasReq, TGetLogReq, TCancelOperationReq,\
|
|
|
- TCloseOperationReq
|
|
|
|
|
|
|
+ TCloseOperationReq, TFetchResultsResp, TRowSet
|
|
|
|
|
|
|
|
from beeswax import conf as beeswax_conf
|
|
from beeswax import conf as beeswax_conf
|
|
|
from beeswax import hive_site
|
|
from beeswax import hive_site
|
|
@@ -548,8 +548,11 @@ class HiveServerClient:
|
|
|
|
|
|
|
|
|
|
|
|
|
def fetch_result(self, operation_handle, orientation=TFetchOrientation.FETCH_NEXT, max_rows=1000):
|
|
def fetch_result(self, operation_handle, orientation=TFetchOrientation.FETCH_NEXT, max_rows=1000):
|
|
|
- fetch_req = TFetchResultsReq(operationHandle=operation_handle, orientation=orientation, maxRows=max_rows)
|
|
|
|
|
- res = self.call(self._client.FetchResults, fetch_req)
|
|
|
|
|
|
|
+ if operation_handle.hasResultSet:
|
|
|
|
|
+ fetch_req = TFetchResultsReq(operationHandle=operation_handle, orientation=orientation, maxRows=max_rows)
|
|
|
|
|
+ res = self.call(self._client.FetchResults, fetch_req)
|
|
|
|
|
+ else:
|
|
|
|
|
+ res = TFetchResultsResp(results=TRowSet(startRowOffset=0, rows=[], columns=[]))
|
|
|
|
|
|
|
|
if operation_handle.hasResultSet:
|
|
if operation_handle.hasResultSet:
|
|
|
meta_req = TGetResultSetMetadataReq(operationHandle=operation_handle)
|
|
meta_req = TGetResultSetMetadataReq(operationHandle=operation_handle)
|