Explorar o código

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

thinker0 %!s(int64=12) %!d(string=hai) anos
pai
achega
80eda27
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  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)),})