tejasiyer-dev opened a new issue, #40533:
URL: https://github.com/apache/beam/issues/40533
### What would you like to happen?
In streaming, WriteFiles shuffles every record before writing temp files:
- fixed sharding: GroupByKey in WriteShardedBundlesToTempFiles
- runner-determined/auto sharding: GroupIntoBatches in
WriteAutoShardedBundlesToTempFiles
When input is dense (bundles are large), this shuffle is unnecessary
cost: each bundle is already big enough to produce a reasonably sized
file on its own.
Proposal (similar to the IcebergIO direct-write bypass, #36720):
- Buffer each bundle's records up to a byte threshold.
- Bundles that reach the threshold are written directly to temp files,
skipping the shuffle.
- Smaller bundles keep the existing grouped path, so files stay large.
- Both paths are merged before finalization, which assigns shard numbers
across all files (file count per window may differ from the
runner-chosen shard count).
Enablement (off by default):
- WriteFiles.withDirectWriteByteThreshold(long)
- Pipeline experiment streaming_file_direct_write_threshold_bytes=<bytes>
(does not override an explicit user withNumShards(N))
- Follow-up: expose the option on TextIO/FileIO.
-
Scope:
- Unbounded (streaming) inputs only.
- Disabled when dynamic destinations use side inputs.
- Not GCS-specific: works for any FileSystem, but GCS streaming sinks
are the main target.
### Issue Priority
Priority: 2 (default / most feature requests should be filed as P2)
### Issue Components
- [ ] Component: Python SDK
- [x] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [x] Component: IO connector
- [ ] Component: Beam YAML
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Infrastructure
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Prism Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [x] Component: Google Cloud Dataflow Runner
--
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]