You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request]: Optimized GCS Direct Write for Dense Keys #40533
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=
(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)
Activity