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 2022/04/18 21:39:28 UTC

[GitHub] [beam] lostluck commented on a diff in pull request #17374: [BEAM-11105] Stateful watermark estimation

lostluck commented on code in PR #17374:
URL: https://github.com/apache/beam/pull/17374#discussion_r852433361


##########
sdks/go/pkg/beam/pardo.go:
##########
@@ -64,9 +66,16 @@ func TryParDo(s Scope, dofn interface{}, col PCollection, opts ...Option) ([]PCo
 	}
 
 	var rc *coder.Coder
+	// Sdfs will always encode restrictions as KV<restriction, watermark state | nil>
 	if fn.IsSplittable() {
 		sdf := (*graph.SplittableDoFn)(fn)
-		rc, err = inferCoder(typex.New(sdf.RestrictionT()))
+		restT := typex.New(sdf.RestrictionT())
+		// If no watermark estimator state, use boolean as a placeholder

Review Comment:
   Outside of specifying a new custom coder, the coder for GlobalWindows encodes them 0 size, as it's a mono value type.
   
   I suppose this related to my question during design, about whether we're using it all the time or not. A Watermark Estimator with no state along with an SDF with type S should make the Restriction type S, rather than trying to make up a type of WS to make KV<S, WS> valid.



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