Bläddra i källkod

HUE-2838 [metastore] Limit the number of partitions after sorting them

Romain Rigaux 10 år sedan
förälder
incheckning
449566c
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      apps/beeswax/src/beeswax/server/hive_server2_lib.py

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

@@ -771,12 +771,12 @@ class HiveServerClient:
 
     partition_table = self.execute_query_statement(query, max_rows=max_rows)
 
-    partitions = [PartitionValueCompatible(partition, table) for partition in partition_table.rows()][-max_parts:]
+    partitions = [PartitionValueCompatible(partition, table) for partition in partition_table.rows()]
 
     if reverse_sort:
       partitions.reverse()
 
-    return partitions
+    return partitions[-max_parts:]
 
 
   def _get_query_configuration(self, query):