tejasiyer-dev commented on code in PR #40543:
URL: https://github.com/apache/beam/pull/40543#discussion_r4624325741


##########
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:
   BundleLifter keys records via a SerializableFunction, which doesn't have a 
ProcessContext to populate DynamicDestinations' side-input accessor before 
calling getDestination.



-- 
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]

Reply via email to