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/02/25 18:32:03 UTC

[GitHub] [beam] y1chi commented on a change in pull request #14059: [BEAM-11866] Remove InvalidWindows from Java SDK, instead track "already merged" bit

y1chi commented on a change in pull request #14059:
URL: https://github.com/apache/beam/pull/14059#discussion_r583069716



##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/util/IdentityWindowFn.java
##########
@@ -25,26 +25,19 @@
 import org.apache.beam.sdk.transforms.GroupByKey;
 import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
 import org.apache.beam.sdk.transforms.windowing.IncompatibleWindowException;
-import org.apache.beam.sdk.transforms.windowing.InvalidWindows;
 import org.apache.beam.sdk.transforms.windowing.NonMergingWindowFn;
 import org.apache.beam.sdk.transforms.windowing.Window;
 import org.apache.beam.sdk.transforms.windowing.WindowFn;
 import org.apache.beam.sdk.transforms.windowing.WindowMappingFn;
 import org.apache.beam.sdk.values.PCollection;
-import org.apache.beam.sdk.values.WindowingStrategy;
 import org.joda.time.Instant;
 
 /**
  * A {@link WindowFn} that leaves all associations between elements and windows unchanged.
  *
  * <p>This {@link WindowFn} is applied when elements must be passed through a {@link GroupByKey},
- * but should maintain their existing {@link Window} assignments. Because windows may have been
- * merged, the earlier {@link WindowFn} may not appropriately maintain the existing window
- * assignments. For example, if the earlier {@link WindowFn} merges windows, after a {@link
- * GroupByKey} the {@link WindowingStrategy} uses {@link InvalidWindows}, and no further {@link
- * GroupByKey} can be applied without applying a new {@link WindowFn}. This {@link WindowFn} allows
- * existing window assignments to be maintained across a single group by key, at which point the
- * earlier {@link WindowingStrategy} should be restored.
+ * but should maintain their existing {@link Window} assignments. This will prevent merging if the

Review comment:
       The WindowingStrategy's alreadyMerged field will be set to true after {@link GroupByKey} and this will prevent...




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org