[ 
https://issues.apache.org/jira/browse/BEAM-9624?focusedWorklogId=414206&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-414206
 ]

ASF GitHub Bot logged work on BEAM-9624:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Apr/20 18:33
            Start Date: 01/Apr/20 18:33
    Worklog Time Spent: 10m 
      Work Description: acrites commented on pull request #11271: [BEAM-9624] 
Adds Convert to Accumulators operator for use in combiner lifting for streaming 
pipelines
URL: https://github.com/apache/beam/pull/11271#discussion_r401825184
 
 

 ##########
 File path: sdks/go/pkg/beam/core/runtime/exec/combine_test.go
 ##########
 @@ -113,6 +113,40 @@ func TestLiftedCombine(t *testing.T) {
 
 }
 
+// TestConvertToaccumulators verifies that if we just do ConvertToAccumulators 
instead
+// of LiftedCombine before the GBK we still get the right answer.
+func TestConvertToAccumulators(t *testing.T) {
+       withCoder := func(t *testing.T, suffix string, key interface{}, 
keyCoder *coder.Coder) {
+               for _, test := range tests {
+                       t.Run(fnName(test.Fn)+"_"+suffix, func(t *testing.T) {
+                               edge := getCombineEdge(t, test.Fn, 
reflectx.Int, test.AccumCoder)
+
+                               out := &CaptureNode{UID: 1}
+                               extract := &ExtractOutput{Combine: 
&Combine{UID: 2, Fn: edge.CombineFn, Out: out}}
+                               merge := &MergeAccumulators{Combine: 
&Combine{UID: 3, Fn: edge.CombineFn, Out: extract}}
+                               gbk := &simpleGBK{UID: 4, KeyCoder: keyCoder, 
Out: merge}
+                               convertToAccumulators := 
&ConvertToAccumulators{Combine: &Combine{UID: 5, Fn: edge.CombineFn, Out: gbk}}
 
 Review comment:
   Good point. Updated the test.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 414206)
    Time Spent: 1h 50m  (was: 1h 40m)

> Combine operation should support only converting to accumulators
> ----------------------------------------------------------------
>
>                 Key: BEAM-9624
>                 URL: https://issues.apache.org/jira/browse/BEAM-9624
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-core
>            Reporter: Andrew Crites
>            Assignee: Andrew Crites
>            Priority: Major
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> For streaming pipelines, we want to be able to lift the combiner into the 
> MergeBuckets without having to also do a PartialGroupByKey before the 
> shuffle. We don't want to do the PGBK since it could cause non-deterministic 
> results when used with some triggers.
> We propose adding a new URN for doing just the convert to accumulators step 
> and adding support for it in Java/Python/Go.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to