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 2021/07/21 17:20:16 UTC

[GitHub] [beam] jrmccluskey commented on a change in pull request #15196: [BEAM-4152] Implement session window merging in the Go direct runner

jrmccluskey commented on a change in pull request #15196:
URL: https://github.com/apache/beam/pull/15196#discussion_r674184357



##########
File path: sdks/go/pkg/beam/runners/direct/gbk.go
##########
@@ -100,6 +114,68 @@ func (n *CoGBK) FinishBundle(ctx context.Context) error {
 	return n.Out.FinishBundle(ctx)
 }
 
+func (n *CoGBK) mergeWindows() error {
+	sort.Slice(n.wins, func(i int, j int) bool {
+		return n.wins[i].MaxTimestamp() < n.wins[j].MaxTimestamp()
+	})
+	n.mergeMap = make(map[typex.Window]int)
+	mergedWins := []typex.Window{}
+	for i := 0; i < len(n.wins); {
+		intWin, ok := n.wins[i].(window.IntervalWindow)
+		if !ok {
+			return errors.Errorf("tried to merge non-interval window type")

Review comment:
       Done




-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

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