ソースを参照

[hive] Perform fetch metadata call only when start_over is true

This cuts all the extra calls in the infinite scroll or download.
Romain Rigaux 10 年 前
コミット
0c0588dd78
1 ファイル変更2 行追加2 行削除
  1. 2 2
      apps/beeswax/src/beeswax/server/hive_server2_lib.py

+ 2 - 2
apps/beeswax/src/beeswax/server/hive_server2_lib.py

@@ -680,14 +680,14 @@ class HiveServerClient:
     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:
       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 and TFetchOrientation.FETCH_FIRST: # Only fetch for the first call that should be with start_over
       meta_req = TGetResultSetMetadataReq(operationHandle=operation_handle)
       schema = self.call(self._client.GetResultSetMetadata, meta_req)
     else: