Browse Source

[beeswax] Handle case where a PartitionKey includes extra ','s or ':'s

Erick Tryzelaar 11 years ago
parent
commit
653ea10
1 changed files with 4 additions and 4 deletions
  1. 4 4
      apps/beeswax/src/beeswax/server/hive_server2_lib.py

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

@@ -676,10 +676,10 @@ class PartitionKeyCompatible:
 
 
   def __init__(self, partition):
   def __init__(self, partition):
     # Parses: ['name:datehour, type:int, comment:null']
     # Parses: ['name:datehour, type:int, comment:null']
-    name, type, comment = partition.split(', ')
-    self.name = name.split(':')[1]
-    self.type = type.split(':')[1]
-    self.comment = comment.split(':')[1]
+    name, type, comment = partition.split(', ', 2)
+    self.name = name.split(':', 1)[1]
+    self.type = type.split(':', 1)[1]
+    self.comment = comment.split(':', 1)[1]
 
 
 
 
 class PartitionValueCompatible:
 class PartitionValueCompatible: