chamikaramj commented on code in PR #39372:
URL: https://github.com/apache/beam/pull/39372#discussion_r3619854382


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/io/WriteFiles.java:
##########
@@ -553,29 +556,53 @@ public PCollection<List<ResultT>> 
expand(PCollection<ResultT> input) {
             // Reshuffle one more time to stabilize the contents of the bundle 
lists to finalize.
             .apply(Reshuffle.viaRandomKey());
       } else {
-        // Pass results via a side input rather than reshuffle, because we 
need to get an empty
-        // iterable to finalize if there are no results.
-        return input
-            .getPipeline()
-            .apply(
-                "AsPossiblyEmptyList",
-                Reify.viewInGlobalWindow(
-                    // Insert a reshuffle before taking the view to 
consolidate the (typically)
-                    // one-output-per-bundle writes.
-                    // This avoids producing a huge number of tiny files in 
the case that side
-                    // inputs are materialized to disk bundle-by-bundle.
-                    input.apply("Consolidate", 
Reshuffle.viaRandomKey()).apply(View.asIterable()),

Review Comment:
   I think this is a significant behavior change that could have performance 
implications and potential cost changes due to the extra shuffle (for batch and 
streaming). Hence we should perform some large scale benchmarking as a part of 
the solution to avoid potential regressions.
   
   I think this probably require a dev list discussion as well.



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