tejasiyer-dev commented on code in PR #40543:
URL: https://github.com/apache/beam/pull/40543#discussion_r4560670621
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/io/WriteFiles.java:
##########
@@ -579,6 +610,22 @@ public WriteFilesResult<DestinationT>
expand(PCollection<UserT> input) {
(getComputeNumShards() == null) ? null :
input.apply(getComputeNumShards());
boolean fixedSharding = getComputeNumShards() != null ||
getNumShardsProvider() != null;
+ Long directWriteThreshold = getDirectWriteByteThreshold();
+ if (directWriteThreshold != null
+ && getSideInputs().isEmpty()
+ && input.isBounded() == IsBounded.UNBOUNDED) {
Review Comment:
Good catch! I disabled direct write for merging windows using the same
needsMerge() check.
When directWriteThreshold is set but direct write can't be used, I think we
should fall back to the default grouped path and log a warning with the reason.
The pipeline still writes all the same records to the same files, it just
doesn't get the optimization.
--
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]