tejasiyer-dev commented on code in PR #40543:
URL: https://github.com/apache/beam/pull/40543#discussion_r4623430540
##########
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java:
##########
@@ -2673,28 +2672,15 @@ static class StreamingShardedWriteFactory<UserT,
DestinationT, OutputT>
numShards = DEFAULT_NUM_SHARDS;
}
- try {
- List<PCollectionView<?>> sideInputs =
- WriteFilesTranslation.getDynamicDestinationSideInputs(transform);
- FileBasedSink sink = WriteFilesTranslation.getSink(transform);
- WriteFiles<UserT, DestinationT, OutputT> replacement =
- WriteFiles.to(sink).withSideInputs(sideInputs);
- if (WriteFilesTranslation.isWindowedWrites(transform)) {
- replacement = replacement.withWindowedWrites();
- }
-
- if (WriteFilesTranslation.isAutoSharded(transform)) {
- replacement = replacement.withAutoSharding();
- return PTransformReplacement.of(
- PTransformReplacements.getSingletonMainInput(transform),
replacement);
- }
-
+ // Keep every option of the original transform and only set the shard
count.
+ WriteFiles<UserT, DestinationT, OutputT> original =
transform.getTransform();
+ if (original.getWithAutoSharding()) {
Review Comment:
Sure.
Done in #41469. updated the matcher (writeWithRunnerDeterminedSharding())
to skip autosharded writes so withNumShards isn't called on them. We need to
avoid setting it because WriteFiles currently checks fixed sharding before
autosharding, so setting numShards would override autosharding.
--
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]