Skip to content

Commit

Permalink
[BEAM-14469] Allow nil primary returns from TrySplit in a single-wind…
Browse files Browse the repository at this point in the history
…ow context (apache#17667)
  • Loading branch information
jrmccluskey committed May 13, 2022
1 parent b774133 commit c110365
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions sdks/go/pkg/beam/core/runtime/exec/sdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,15 +665,20 @@ func (n *ProcessSizedElementsAndRestrictions) singleWindowSplit(f float64, pWeSt
return []*FullValue{}, []*FullValue{}, nil
}

pfv, err := n.newSplitResult(p, n.elm.Windows, pWeState)
if err != nil {
return nil, nil, err
var primaryResult []*FullValue
if p != nil {
pfv, err := n.newSplitResult(p, n.elm.Windows, pWeState)
if err != nil {
return nil, nil, err
}
primaryResult = append(primaryResult, pfv)
}

rfv, err := n.newSplitResult(r, n.elm.Windows, rWeState)
if err != nil {
return nil, nil, err
}
return []*FullValue{pfv}, []*FullValue{rfv}, nil
return primaryResult, []*FullValue{rfv}, nil
}

// multiWindowSplit is intended for splitting multi-window elements in
Expand Down

0 comments on commit c110365

Please sign in to comment.