reuvenlax commented on code in PR #40543:
URL: https://github.com/apache/beam/pull/40543#discussion_r4618753907
##########
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) {
+ disabledReasons.add("the input is bounded without a fixed number of
shards");
+ }
+ if (!getSideInputs().isEmpty()) {
Review Comment:
explain why side inputs cause us to disable this?
--
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]