Bläddra i källkod

HUE-1565 [beeswax] PartitionValueCompatible: add multiple partitions support

thinker0 12 år sedan
förälder
incheckning
80eda27
1 ändrade filer med 6 tillägg och 2 borttagningar
  1. 6 2
      apps/beeswax/src/beeswax/server/hive_server2_lib.py

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

@@ -554,8 +554,12 @@ class PartitionKeyCompatible:
 class PartitionValueCompatible:
 class PartitionValueCompatible:
 
 
   def __init__(self, partition, table):
   def __init__(self, partition, table):
-    # Parses: ['datehour=2013022516']
-    self.values = [part.split('=')[1] for part in partition]
+    # Parses: ['datehour=2013022516'] or ['month=2011-07/dt=2011-07-01/hr=12']
+    self.values = []
+    for part in partition:
+      parts = part.split('/')
+      for val in parts:
+        self.values.append(val.split('=')[1])
     self.sd = type('Sd', (object,), {'location': '%s/%s' % (table.path_location, ','.join(partition)),})
     self.sd = type('Sd', (object,), {'location': '%s/%s' % (table.path_location, ','.join(partition)),})