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 2020/04/08 22:52:58 UTC

[GitHub] [beam] TheNeuralBit commented on a change in pull request #11314: [BEAM-9562] Send Timers over Data Channel as Elements

TheNeuralBit commented on a change in pull request #11314: [BEAM-9562] Send Timers over Data Channel as Elements
URL: https://github.com/apache/beam/pull/11314#discussion_r405831920
 
 

 ##########
 File path: runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/ParDoTranslation.java
 ##########
 @@ -257,6 +230,19 @@ public static ParDoPayload translateParDo(
       restrictionCoderId = "";
     }
 
+    Coder<BoundedWindow> windowCoder =
+        (Coder<BoundedWindow>) mainInput.getWindowingStrategy().getWindowFn().windowCoder();
+    Coder<?> keyCoder;
+    if (signature.usesState() || signature.usesTimers()) {
+      checkArgument(
+          mainInput.getCoder() instanceof KvCoder,
+          "DoFn's that use state or timers must have an input PCollection with a KvCoder but received %s",
+          mainInput.getCoder());
 
 Review comment:
   Just curious: did we not have this check before, and just failed when attempting to cast to KVCoder  (in the removed block from `translate` above)?

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


With regards,
Apache Git Services