jonathansudhakar1 commented on issue #22480: URL: https://github.com/apache/beam/issues/22480#issuecomment-7280814694
Thanks, both of you. That settles the direction: the work goes into `SpannerWriteSchemaTransformProvider` (`spanner_write:v1`) and YAML `WriteToSpanner`, and the legacy `SpannerTransformRegistrar` transforms stay as they are. I'll implement the plan above and open a PR. If you'd rather do it yourself, just say so and I'll free the issue. .take-issue A few details I'd follow, so you can correct anything before the PR: - **Opt-in output:** `emit_write_results` (default `false`) adds a `write_results` output. `post-write` and `errors` don't change, and with the flag off the expansion is the same as today. - **Schema:** `mutation_count` (`INT64`), `commit_timestamp` and `snapshot_timestamp` (nullable `MicrosInstant`). On precision: Spanner [documents commit timestamps as microsecond-granular](https://cloud.google.com/spanner/docs/commit-timestamp), so `MicrosInstant` should keep the full `commit_timestamp`. It's also what Python already maps `apache_beam.utils.timestamp.Timestamp` to; Python has no nanosecond logical type. - **#41764:** the provider is in the same package as `SpannerIO`, so it can turn on commit stats on `SpannerIO.Write` itself and read both `getFailedMutations()` and `getWriteResults()` from the same `SpannerWriteResult`. That way `error_handling` and `emit_write_results` work together and don't go through `WriteWithResults`, which #41765 changes. - **Options:** `priority` (`LOW`/`MEDIUM`/`HIGH`), `max_commit_delay` (milliseconds), `transaction_tag` and `exclude_txn_from_change_streams`. All are optional and unset by default, and they're also mapped in `standard_io.yaml`. The batching knobs the legacy wrappers expose (`max_batch_size_bytes` and friends) could follow separately if they're wanted. - **Tests:** unit tests in `SpannerSchemaTransformProviderTest` using `FakeServiceFactory`. They'd cover the results output, results plus `error_handling` together, the options reaching `SpannerIO.Write`, and the default expansion being unchanged. -- 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]
