Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1951#discussion_r16445015
  
    --- Diff: python/pyspark/serializers.py ---
    @@ -409,18 +409,25 @@ class UTF8Deserializer(Serializer):
         Deserializes streams written by String.getBytes.
         """
     
    +    def __init__(self, use_unicode=False):
    +        self.use_unicode = use_unicode
    +
         def loads(self, stream):
             length = read_int(stream)
    -        return stream.read(length).decode('utf8')
    --- End diff --
    
    I don't know how we'll we've stuck to this convention in the existing code, 
but my original intention was that loads(loaded a single record and load_stream 
loaded a stream of records.  If you wanted, we could conditionally define 
`loads` based on whether we've set `use_unicode`, which would allow the 
serializer to be used to deserialize an individual element or a stream.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to