Преглед изворни кода

[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: