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/09/07 22:16:42 UTC

[GitHub] [beam] lostluck commented on a change in pull request #15399: [BEAM-5097] Increment counter for "small words" in go SDK example

lostluck commented on a change in pull request #15399:
URL: https://github.com/apache/beam/pull/15399#discussion_r703890203



##########
File path: sdks/go/examples/wordcount/wordcount.go
##########
@@ -123,6 +125,11 @@ func extractFn(ctx context.Context, line string, emit func(string)) {
 		empty.Inc(ctx, 1)
 	}
 	for _, word := range wordRE.FindAllString(line, -1) {
+		// increment the counter for small words if length of words is
+		// less than small_word_length
+		if len(word) < *small_word_length {

Review comment:
       Flags aren't available on workers. They'd only have their default values. `extractFn` needs to change to a structural DoFn (like it is in the other example being updated) so the flag functions properly. 




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