[
https://issues.apache.org/jira/browse/BEAM-6120?focusedWorklogId=172874&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-172874
]
ASF GitHub Bot logged work on BEAM-6120:
----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Dec/18 22:50
Start Date: 06/Dec/18 22:50
Worklog Time Spent: 10m
Work Description: robertwb commented on a change in pull request #7127:
[BEAM-6120] Support retrieval of large gbk iterables over the state API.
URL: https://github.com/apache/beam/pull/7127#discussion_r239644468
##########
File path: sdks/python/apache_beam/coders/coder_impl.py
##########
@@ -690,6 +720,35 @@ def decode_from_stream(self, in_stream, nested):
elements.append(self._elem_coder.decode_from_stream(in_stream, True))
count = in_stream.read_var_int64()
+ if count == -1:
+ if self._read_state is None:
+ raise ValueError(
+ 'Cannot read state-written iterable without state reader.')
+
+ class FullIterable(object):
+ def __init__(self, head, tail):
+ self._head = head
+ self._tail = tail
+
+ def __iter__(self):
+ for elem in self._head:
+ yield elem
+ for elem in self._tail:
+ yield elem
+
+ def __eq__(self, other):
+ return list(self) == list(other)
+
+ def __hash__(self):
+ raise NotImplementedError
+
+ def __reduce__(self):
+ return list, (list(self),)
+
+ state_token = in_stream.read_all(True)
Review comment:
Yes, that's what the `read_all([nested=]True)` does.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 172874)
Time Spent: 3h 20m (was: 3h 10m)
> Support retrieval of large gbk iterables over the state API.
> ------------------------------------------------------------
>
> Key: BEAM-6120
> URL: https://issues.apache.org/jira/browse/BEAM-6120
> Project: Beam
> Issue Type: Improvement
> Components: sdk-py-harness
> Reporter: Robert Bradshaw
> Assignee: Robert Bradshaw
> Priority: Major
> Time Spent: 3h 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)