Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
source-bigquery-batch: Fix DATETIME serialization
BigQuery DATETIME columns only support microsecond precision, but the default serialization of the Go `civil.DateTime` struct uses nanosecond precision. Which is fine for output only, and *also* is fine for cursors until the capture restarts, and *also* is fine when the datetime values are whole seconds. But a fractional-second datetime used as a cursor will be stored as a string in the state checkpoint, and trying to feed that back to BigQuery after a restart will produce an error because there are too many digits of precision. The fix is to handle the formatting of `civil.DateTime` values into strings ourselves and make sure it only has six digits.
- Loading branch information