akhileshmalavalli opened a new issue, #38055: URL: https://github.com/apache/beam/issues/38055
### What would you like to happen? ## Summary Today, Beam supports dynamic destination routing for Iceberg, but the input PCollection<Row> still requires a single Beam schema. This makes it difficult to build generic ingestion pipelines where: - new event types can appear dynamically - each event type maps to a different Iceberg table - each event type has its own schema ## Problem A common ingestion pattern is: 1. Read generic events from a streaming pipeline like Pub/Sub 2. Determine destination table from an attribute like event_type 3. Fetch the schema for that event type dynamically from a central schema store 4. Write each record to its corresponding Iceberg table This works conceptually for table routing, but breaks down because PCollection<Row> has one schema for the entire collection. In practice, that means: - dynamic table name is possible - dynamic schema per destination is not - newly introduced event types require pipeline changes ## What is needed? We need per-destination schema, similar to [BigQuery DynamicDestinations](https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/io/gcp/bigquery/DynamicDestinations.html). Example Idea: ``` IcebergIO.write() .to(new DynamicDestinations<InputT, DestinationT>() { @Override public DestinationT getDestination(ValueInSingleWindow<InputT> element) { ... } @Override public String getTableIdentifier(DestinationT destination) { ... } @Override public org.apache.iceberg.Schema getSchema(DestinationT destination) { ... } })``` ### 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 - [ ] 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 -- 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]
