Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Add option to set maximum Storage API streams when using autosharding #32490

Open
2 of 17 tasks
ahmedabu98 opened this issue Sep 17, 2024 · 0 comments
Open
2 of 17 tasks

Comments

@ahmedabu98
Copy link
Contributor

What would you like to happen?

Users can either set a fixed number of streams using --numStorageWriteApiStreams or let the runner/sink decide by using autosharding.

The Storage API sink's auto-sharding relies on GroupIntoBatches.withShardedKey() to determine a number of parallel shards beforehand, then creates one write stream for each shard. Beam's implementation of GroupIntoBatches simply creates one per DoFn instance/thread.

The DataflowRunner overrides GroupIntoBatches to offer a more fine-tuned experience where parallelism is determined using signals such as accumulated backlog. When backlog is huge, the increase in parallelism forces the sink to create many streams and can end up exhausting BigQuery's CreateWriteStream quota.

To handle this better, we should allow the user to specify a maximum number of streams:

  • Extend a new BigQuery option --maxNumStorageWriteApiStreams (only applicable for streaming writes with autosharding)
  • Extend a GroupIntoBatches.withShardedKey().withMaxNumShards() function
    • This is required for both the local Beam implementation as well as the DataflowRunner override

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: Samza 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
Projects
None yet
Development

No branches or pull requests

1 participant