Browse Source

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

thinker0 12 years ago
parent
commit
80eda27
1 changed files with 6 additions and 2 deletions
  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:
 
   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)),})