xinyuiscool commented on a change in pull request #15421:
URL: https://github.com/apache/beam/pull/15421#discussion_r701406444



##########
File path: 
runners/samza/src/main/java/org/apache/beam/runners/samza/translation/SamzaTestStreamTranslator.java
##########
@@ -90,11 +97,54 @@ public void translate(
     ctx.registerInputMessageStream(output, inputDescriptor);
   }
 
+  @SuppressWarnings("unchecked")
   @Override
   public void translatePortable(
       PipelineNode.PTransformNode transform,
       QueryablePipeline pipeline,
       PortableTranslationContext ctx) {
-    throw new SamzaException("TestStream is not supported in portable by Samza 
runner");
+    final ByteString bytes = transform.getTransform().getSpec().getPayload();
+    final Coder<T> coder;
+
+    try {
+      coder =
+          (Coder<T>)
+              RehydratedComponents.forComponents(pipeline.getComponents())
+                  
.getCoder(RunnerApi.TestStreamPayload.parseFrom(bytes).getCoderId());
+    } catch (IOException e) {
+      throw new SamzaException(e);

Review comment:
       Let's throw a RuntimeException() here.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to