You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/08/03 20:35:44 UTC

[GitHub] [beam] lostluck commented on a change in pull request #12426: [BEAM-7996] Add support for MapType and Nulls in container types for Python RowCoder

lostluck commented on a change in pull request #12426:
URL: https://github.com/apache/beam/pull/12426#discussion_r464647966



##########
File path: sdks/python/apache_beam/coders/coder_impl.py
##########
@@ -530,6 +530,88 @@ def estimate_size(self, unused_value, nested=False):
     return 1
 
 
+class MapCoderImpl(StreamCoderImpl):
+  """For internal use only; no backwards-compatibility guarantees.
+
+  A coder for typing.Mapping objects."""
+  def __init__(
+      self,
+      key_coder,  # type: CoderImpl
+      value_coder  # type: CoderImpl
+  ):
+    self._key_coder = key_coder
+    self._value_coder = value_coder
+
+  def encode_to_stream(self, value, out, nested):
+    size = len(value)
+    out.write_bigendian_int32(size)

Review comment:
       As a practical matter, int32 max of any amount of data is bigger than our GRPC limits for receiving single values into an SDK. At least, until we add a large value protocol to stream in single large values somewhere.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org