Browse Source

HUE-2528 [beeswax] Partitions limit gets capped to 1000 despite configuration

Harsh 11 năm trước cách đây
mục cha
commit
d8be58d
1 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 7 2
      apps/beeswax/src/beeswax/server/hive_server2_lib.py

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

@@ -640,8 +640,13 @@ class HiveServerClient:
 
   def get_partitions(self, database, table_name, max_parts):
     table = self.get_table(database, table_name)
-    # TODO: do a 'use DB' ?
-    partitionTable = self.execute_query_statement('SHOW PARTITIONS %s' % table_name) # DB prefix not supported
+
+    if max_parts is None or max_parts <= 0:
+      max_rows = 10000
+    else:
+      max_rows = 1000 if max_parts <= 250 else max_parts
+
+    partitionTable = self.execute_query_statement('SHOW PARTITIONS %s' % table_name, max_rows=max_rows) # DB prefix supported since Hive 0.13
     return [PartitionValueCompatible(partition, table) for partition in partitionTable.rows()][-max_parts:]