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/04 15:07:29 UTC

[GitHub] [beam] reuvenlax commented on a diff in pull request #17262: Use the supplied output timestamp for processing time timers rather than the input watermark

reuvenlax commented on code in PR #17262:
URL: https://github.com/apache/beam/pull/17262#discussion_r841850813


##########
runners/core-java/src/main/java/org/apache/beam/runners/core/SimpleDoFnRunner.java:
##########
@@ -209,7 +209,12 @@ public void processElement(WindowedValue<InputT> compressedElem) {
         break;
       case PROCESSING_TIME:
       case SYNCHRONIZED_PROCESSING_TIME:
-        effectiveTimestamp = stepContext.timerInternals().currentInputWatermarkTime();
+        Instant outputWatermark = stepContext.timerInternals().currentOutputWatermarkTime();
+        Instant inputWatermark = stepContext.timerInternals().currentInputWatermarkTime();
+        effectiveTimestamp =
+            outputTimestamp != null
+                ? outputTimestamp
+                : outputWatermark != null ? outputWatermark : inputWatermark;

Review Comment:
   IMO, this should always be outputTimestamp. If outputTimestamp is set, then I  think overriding it with something else (input watermark, output watermark) is incorrect.



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