twosom commented on code in PR #34253:
URL: https://github.com/apache/beam/pull/34253#discussion_r1991756755
##########
runners/spark/src/main/java/org/apache/beam/runners/spark/translation/SparkStreamingPortablePipelineTranslator.java:
##########
@@ -322,13 +342,21 @@ private static <T> void translateFlatten(
dStreams.add(unboundedDataset.getDStream());
} else {
// create a single RDD stream.
- final SingleEmitInputDStream<WindowedValue<T>>
singleEmitInputDStream =
- new SingleEmitInputDStream<WindowedValue<T>>(
- context.getStreamingContext().ssc(), ((BoundedDataset)
dataset).getRDD().rdd());
- final JavaDStream<WindowedValue<T>> dStream =
- JavaDStream.fromDStream(
- singleEmitInputDStream,
JavaSparkContext$.MODULE$.fakeClassTag());
-
+ JavaDStream<WindowedValue<T>> dStream;
+ if (context.getSparkContext().version().startsWith("3")) {
+ Queue<JavaRDD<WindowedValue<T>>> q = new LinkedBlockingQueue<>();
+ q.offer(((BoundedDataset) dataset).getRDD());
+ // TODO (https://github.com/apache/beam/issues/20426): this is not
recoverable from
Review Comment:
Hello. I am currently reviewing the issue.
At the time of submitting the PR, the following trigger files were used, but
it seems that `PortableRunner` was not included, which is likely why the issue
was not detected:
- `beam_PostCommit_Java_ValidatesRunner_Spark.json`
- `beam_PostCommit_Java_ValidatesRunner_Spark_Java11.json`
- `beam_PostCommit_Java_ValidatesRunner_SparkStructuredStreaming.json`
I agree with @Amar3tto's suggestion. For now, it seems we need to roll back
the changes related to the `PortableRunner` and revisit the task afterward.
--
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]