You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lo...@apache.org on 2019/09/09 23:46:40 UTC
[beam] branch lostluck-patch-3 created (now 8e5b9e3)
This is an automated email from the ASF dual-hosted git repository.
lostluck pushed a change to branch lostluck-patch-3
in repository https://gitbox.apache.org/repos/asf/beam.git.
at 8e5b9e3 [go-sdk] Never split on the 0th element.
This branch includes the following new commits:
new 8e5b9e3 [go-sdk] Never split on the 0th element.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[beam] 01/01: [go-sdk] Never split on the 0th element.
Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lostluck pushed a commit to branch lostluck-patch-3
in repository https://gitbox.apache.org/repos/asf/beam.git
commit 8e5b9e3356f4131b3fc4f0862203662f7a495f84
Author: Robert Burke <lo...@users.noreply.github.com>
AuthorDate: Mon Sep 9 16:46:01 2019 -0700
[go-sdk] Never split on the 0th element.
That is, don't split if no elements have been processed yet. Always process at least one element.
---
sdks/go/pkg/beam/core/runtime/exec/datasource.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sdks/go/pkg/beam/core/runtime/exec/datasource.go b/sdks/go/pkg/beam/core/runtime/exec/datasource.go
index 1a0371f..e1da517 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/datasource.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/datasource.go
@@ -270,7 +270,7 @@ func (n *DataSource) Split(splits []int64, frac float32) (int64, error) {
// Find the smallest split index that we haven't yet processed, and set
// the promised split position to this value.
for _, s := range splits {
- if s >= c && s < n.splitPos {
+ if s > 0 && s >= c && s < n.splitPos {
n.splitPos = s
fs := n.splitPos
n.mu.Unlock()