stankiewicz commented on issue #22480: URL: https://github.com/apache/beam/issues/22480#issuecomment-7274217090
`SpannerIO.Write#withWriteResults()` (added in #40480) is currently Java-only and not yet exposed in `SpannerWriteSchemaTransformProvider` / Beam YAML `WriteToSpanner` and adding it makes sense! To support this in `WriteToSpanner` without breaking existing pipelines or adding `commitStats()` overhead by default, the plan would be: 1. **Opt-in configuration**: Add an optional boolean flag (e.g., `emit_write_results`, default `false`) to `SpannerWriteSchemaTransformConfiguration` and expose it in `standard_io.yaml` for `WriteToSpanner`. Aligning rest of missing options in this PR (eg. priority) makes sense. 2. **Separate output tag**: Keep `"post-write"` as the existing empty completion signal, and emit `WriteResults` rows on a new `"write_results"` output tag only when the flag is enabled. 3. **Output schema**: Emit one `Row` per committed Spanner batch with `mutation_count` (`INT64`), `commit_timestamp` (nullable `TIMESTAMP` / `MicrosInstant`), and `snapshot_timestamp` (nullable `TIMESTAMP` / `MicrosInstant`). - I think there may be precision loss when choosing timestamp. This would cover `WriteToSpanner` / `SchemaTransform` cross-language usage; the legacy `SpannerTransformRegistrar` transforms in `apache_beam.io.gcp.spanner` are out of scope. Also note https://github.com/apache/beam/issues/41764 - There is bug when combined with reporting failures. -- 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]
