[
https://issues.apache.org/jira/browse/BEAM-4546?focusedWorklogId=111665&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-111665
]
ASF GitHub Bot logged work on BEAM-4546:
----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Jun/18 21:24
Start Date: 13/Jun/18 21:24
Worklog Time Spent: 10m
Work Description: aaltay commented on a change in pull request #5639:
[BEAM-4546] Multi level combine
URL: https://github.com/apache/beam/pull/5639#discussion_r195240878
##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -1337,6 +1350,74 @@ def default_type_hints(self):
return hints
+class _CombinePerKeyWithHotKeyFanout(PTransform):
+
+ def __init__(self, combine_fn, fanout):
+ self._fanout_fn = (
+ (lambda key: fanout) if isinstance(fanout, int) else fanout)
+ self._combine_fn = combine_fn
+
+ def expand(self, pcoll):
+
+ from apache_beam.transforms.trigger import AccumulationMode
+ combine_fn = self._combine_fn
+ fanout_fn = self._fanout_fn
+
+ class SplitHotCold(DoFn):
+ counter = 0
+ def process(self, element):
+ key, value = element
+ fanout = fanout_fn(key)
+ if not fanout or fanout is 1:
Review comment:
Should it be invalid to return None from fanout_fn?
Also a high level question, do we expect users to have an idea about what
keys would be hot to a point of how much fanout they will want per key? Would
it be simpler to just accept an fanout integer that will apply to all keys?
----------------------------------------------------------------
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: 111665)
> Implement with hot key fanout for combiners
> -------------------------------------------
>
> Key: BEAM-4546
> URL: https://issues.apache.org/jira/browse/BEAM-4546
> Project: Beam
> Issue Type: New Feature
> Components: sdk-py-core
> Reporter: Ahmet Altay
> Assignee: Robert Bradshaw
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)