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/11/08 22:10:43 UTC

[GitHub] [beam] tvalentyn commented on a diff in pull request #23828: Adjust windowing strategy only for windows that explicitly set accumulating mode in with_fanout

tvalentyn commented on code in PR #23828:
URL: https://github.com/apache/beam/pull/23828#discussion_r1017163591


##########
sdks/python/apache_beam/transforms/core.py:
##########
@@ -2779,14 +2779,20 @@ def StripNonce(nonce_key_value):
 
     cold, hot = pcoll | ParDo(SplitHotCold()).with_outputs('hot', main='cold')
     cold.element_type = typehints.Any  # No multi-output type hints.
+    precombined_hot = hot
+    if pcoll.windowing.accumulation_mode == AccumulationMode.ACCUMULATING:
+      # Avoid double-counting that may happen with stacked accumulating mode.
+      precombined_hot |= 'WindowIntoDiscarding' >> WindowInto(
+          pcoll.windowing, accumulation_mode=AccumulationMode.DISCARDING)
+
     precombined_hot = (
-        hot
-        # Avoid double counting that may happen with stacked accumulating mode.
-        | 'WindowIntoDiscarding' >> WindowInto(

Review Comment:
   TODO: try to keep the same trigger, and/or other properties on the windowing mode.



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