jk-shah opened a new issue, #41354:
URL: https://github.com/apache/beam/issues/41354
### Description
Deduplicating streaming at-least-once deliveries (e.g. from Pub/Sub, Kafka,
or webhook retries) by one or more business columns (`event_id`, `[tenant_id,
order_id]`) is one of the most common streaming requirements.
Currently:
1. `apache_beam.transforms.deduplicate.DeduplicatePerKey` / `Deduplicate`
only operates on raw `(K, V)` pairs or full serialized elements, rather than
named `beam.Row` schema columns while preserving the full input `Row` schema
and element timestamp.
2. Beam YAML has **no** built-in `Deduplicate` transform provider, forcing
users out of declarative YAML for basic idempotency.
### Proposed YAML & Python API
```yaml
pipeline:
transforms:
- type: Deduplicate
input: ReadFromPubSub
config:
keys: [tenant_id, event_id]
duration: 10m
time_domain: processing_time # or event_time
```
### Key Capabilities
1. **Schema-Preserving Composite Keys**: Deduplicate `beam.Row` streams by
one or more key columns (`keys: [...]`), deterministically serializing
composite/nullable keys while preserving input `RowTypeConstraint` and element
event-time timestamps.
2. **Stateful TTL**: Use `ReadModifyWriteStateSpec` +
`TimerSpec(TimeDomain.REAL_TIME | TimeDomain.WATERMARK)` to bound per-key state
memory to `duration` without leaking Windmill/Flink state.
3. **Observability**: Emit standard Beam counters (`deduplicate_kept`,
`deduplicate_dropped`) so operators can monitor duplicate rates in
Dataflow/Flink.
### Issue Priority
Priority: 2 (default / most feature requests should be filed as P2/P3)
### Issue Components
- [x] Component: Python SDK
- [ ] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [x] Component: Beam YAML
- [ ] Component: Beam ML
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Infrastructure
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Prism 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]