diff options
author | Davies Liu <davies@databricks.com> | 2014-12-15 22:58:26 -0800 |
---|---|---|
committer | Josh Rosen <joshrosen@databricks.com> | 2014-12-15 22:58:26 -0800 |
commit | c246b95dd2f565043db429c38c6cc029a0b870c1 (patch) | |
tree | dfaabaae0428a63eff807510c918e932f0bb5df3 /python/pyspark/serializers.py | |
parent | c7628771da9a7d4bd4d7abfdede37ce1568dcd01 (diff) | |
download | spark-c246b95dd2f565043db429c38c6cc029a0b870c1.tar.gz spark-c246b95dd2f565043db429c38c6cc029a0b870c1.tar.bz2 spark-c246b95dd2f565043db429c38c6cc029a0b870c1.zip |
[SPARK-4841] fix zip with textFile()
UTF8Deserializer can not be used in BatchedSerializer, so always use PickleSerializer() when change batchSize in zip().
Also, if two RDD have the same batch size already, they did not need re-serialize any more.
Author: Davies Liu <davies@databricks.com>
Closes #3706 from davies/fix_4841 and squashes the following commits:
20ce3a3 [Davies Liu] fix bug in _reserialize()
e3ebf7c [Davies Liu] add comment
379d2c8 [Davies Liu] fix zip with textFile()
Diffstat (limited to 'python/pyspark/serializers.py')
-rw-r--r-- | python/pyspark/serializers.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/python/pyspark/serializers.py b/python/pyspark/serializers.py index 33aa55f7f1..bd08c9a6d2 100644 --- a/python/pyspark/serializers.py +++ b/python/pyspark/serializers.py @@ -463,6 +463,9 @@ class CompressedSerializer(FramedSerializer): def loads(self, obj): return self.serializer.loads(zlib.decompress(obj)) + def __eq__(self, other): + return isinstance(other, CompressedSerializer) and self.serializer == other.serializer + class UTF8Deserializer(Serializer): @@ -489,6 +492,9 @@ class UTF8Deserializer(Serializer): except EOFError: return + def __eq__(self, other): + return isinstance(other, UTF8Deserializer) and self.use_unicode == other.use_unicode + def read_long(stream): length = stream.read(8) |