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 2022/05/09 17:23:24 UTC

[beam] branch master updated: [BEAM-14433] Improve Go split error message. (#17575)

This is an automated email from the ASF dual-hosted git repository.

lostluck pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 1af17bdbea9 [BEAM-14433] Improve Go split error message. (#17575)
1af17bdbea9 is described below

commit 1af17bdbea984797c22d1ae64630ed17fef9ea1e
Author: Robert Burke <lo...@users.noreply.github.com>
AuthorDate: Mon May 9 10:23:18 2022 -0700

    [BEAM-14433] Improve Go split error message. (#17575)
---
 sdks/go/pkg/beam/core/runtime/exec/datasource.go | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sdks/go/pkg/beam/core/runtime/exec/datasource.go b/sdks/go/pkg/beam/core/runtime/exec/datasource.go
index 92e6a85fe63..e47fee00c96 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/datasource.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/datasource.go
@@ -596,8 +596,12 @@ func splitHelper(
 	if bestS != -1 {
 		return bestS, -1.0, nil
 	}
-
-	return -1, -1.0, fmt.Errorf("failed to split DataSource (at index: %v) at requested splits: {%v}", currIdx, splits)
+	// Printing all splits is expensive. Instead, return the current start and
+	// end indices, and fraction along with the range of the indices and how
+	// many there are. This branch requires at least one split index, so we don't
+	// need to bounds check the slice.
+	return -1, -1.0, fmt.Errorf("failed to split DataSource (at index: %v, last index: %v) at fraction %.4f with requested splits (%v indices from %v to %v)",
+		currIdx, endIdx, frac, len(splits), splits[0], splits[len(splits)-1])
 }
 
 func encodeElm(elm *FullValue, wc WindowEncoder, ec ElementEncoder) ([]byte, error) {