镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[Feature Request]: Optimized GCS Direct Write for Dense Keys #40533

Open

Description

@tejasiyer-dev

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=
    (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
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • 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
  • Component: Google Cloud Dataflow Runner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions