tkaymak commented on code in PR #41426:
URL: https://github.com/apache/beam/pull/41426#discussion_r4686637654
##########
runners/spark/4/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/streaming/StatefulParDoStreamingTranslator.java:
##########
@@ -60,29 +70,66 @@ protected void translate(ParDo.MultiOutput<KV<K, V>,
OutputT> transform, Context
KvCoder<K, V> inputCoder = (KvCoder<K, V>) input.getCoder();
Coder<K> keyCoder = inputCoder.getKeyCoder();
TupleTag<OutputT> mainOutputTag = transform.getMainOutputTag();
- PCollection<OutputT> output = cxt.getOutput(mainOutputTag);
- Coder<OutputT> outputCoder = output.getCoder();
+ Map<TupleTag<?>, PCollection<?>> outputs =
Review Comment:
Thanks, fixed for the stateful path. `StatefulParDoStreamingTranslator` now
drops the main output when it is unconsumed and another output is consumed, so
no extra query or state store starts.
`testStatefulParDoOnlyAdditionalOutputConsumed` covers it, the DoFn counter was
8 before and is 4 now. The stateless path in `ParDoTranslatorBatch` is
unchanged, it is shared with batch and builds its single output path on the
main tag, and there the extra query only reruns a stateless DoFn, the same cost
as #41198.
--
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]