浏览代码

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

Erick Tryzelaar 11 年之前
父节点
当前提交
653ea10
共有 1 个文件被更改,包括 4 次插入4 次删除
  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):
     # 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: