tejasiyer-dev commented on code in PR #40543:
URL: https://github.com/apache/beam/pull/40543#discussion_r4628689211
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/io/WriteFiles.java:
##########
@@ -579,8 +616,118 @@ public WriteFilesResult<DestinationT>
expand(PCollection<UserT> input) {
(getComputeNumShards() == null) ? null :
input.apply(getComputeNumShards());
boolean fixedSharding = getComputeNumShards() != null ||
getNumShardsProvider() != null;
+ // Records that take the grouped path, and files written directly (if any).
+ PCollection<UserT> groupedInput = input;
+ @Nullable PCollection<FileResult<DestinationT>> directFiles = null;
+ Long directWriteThreshold = getDirectWriteByteThreshold();
+ if (directWriteThreshold != null) {
+ List<String> disabledReasons = new ArrayList<>();
+ // Without a fixed shard count, bounded inputs already write each bundle
directly.
+ if (input.isBounded() == IsBounded.BOUNDED && !fixedSharding) {
Review Comment:
Updated to disable direct writes for all bounded inputs for now.
Since withDirectWriteByteThreshold is opt-in, we could revisit enabling it
for batch/bounded writes without fixed sharding in a follow-up if useful to
keep direct-write performance while coalescing small bundles to avoid creating
too many small files.
--
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]