lukecwik commented on a change in 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_r401318044
 
 

 ##########
 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:
   This will validate that you get the right output but doesn't actually ensure 
that convertToAccumulators didn't do any combining.
   
   It might be worthwhile to just test the convertToAccumulators step without 
any of the other steps alongside it.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to