-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
source-sqlserver: Support DATETIME as backfill keys
By default we serialize these as an RFC3339 timestamp, but SQL Server doesn't support that as an input format for a DATETIME column since DATETIMEs only have three digits of sub-second precision and no time zone. To make this work we just have to adjust the FDB row key encode operation so that when the column type is `datetime` we apply a different string format. This doesn't change the handling of the actual capture output values, only row key serialization.
- Loading branch information
1 parent
7afe1ff
commit ba0f13c
Showing
3 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#################################### | ||
### Capture from Start | ||
#################################### | ||
# ================================ | ||
# Collection "acmeCo/test/test_scankeytypes_datetime_889298060005": 1 Documents | ||
# ================================ | ||
{"_meta":{"op":"c","source":{"schema":"dbo","snapshot":true,"table":"test_ScanKeyTypes_DateTime_889298060005","lsn":"","seqval":"AAAAAAAAAAAAAA=="}},"k":"<TIMESTAMP>","v":"Data 0"} | ||
# ================================ | ||
# Final State Checkpoint | ||
# ================================ | ||
{"bindingStateV1":{"dbo%2Ftest_ScanKeyTypes_DateTime_889298060005":{"backfilled":1,"key_columns":["k"],"mode":"Backfill","scanned":"AjE5OTEtMDgtMzFUMTI6MzQ6NTQuMTEwAA=="}},"cursor":"AAAAAAAAAAAAAA=="} | ||
|
||
|
||
#################################### | ||
### Capture from Key "AjE5OTEtMDgtMzFUMTI6MzQ6NTQuMTEwAA==" | ||
#################################### | ||
# ================================ | ||
# Collection "acmeCo/test/test_scankeytypes_datetime_889298060005": 1 Documents | ||
# ================================ | ||
{"_meta":{"op":"c","source":{"schema":"dbo","snapshot":true,"table":"test_ScanKeyTypes_DateTime_889298060005","lsn":"","seqval":"AAAAAAAAAAAAAA=="}},"k":"<TIMESTAMP>","v":"Data 1"} | ||
# ================================ | ||
# Final State Checkpoint | ||
# ================================ | ||
{"bindingStateV1":{"dbo%2Ftest_ScanKeyTypes_DateTime_889298060005":{"backfilled":2,"key_columns":["k"],"mode":"Backfill","scanned":"AjE5OTEtMDgtMzFUMTI6MzQ6NTQuMzMzAA=="}},"cursor":"AAAAAAAAAAAAAA=="} | ||
|
||
|
||
#################################### | ||
### Capture from Key "AjE5OTEtMDgtMzFUMTI6MzQ6NTQuMzMzAA==" | ||
#################################### | ||
# ================================ | ||
# Collection "acmeCo/test/test_scankeytypes_datetime_889298060005": 1 Documents | ||
# ================================ | ||
{"_meta":{"op":"c","source":{"schema":"dbo","snapshot":true,"table":"test_ScanKeyTypes_DateTime_889298060005","lsn":"","seqval":"AAAAAAAAAAAAAA=="}},"k":"<TIMESTAMP>","v":"Data 2"} | ||
# ================================ | ||
# Final State Checkpoint | ||
# ================================ | ||
{"bindingStateV1":{"dbo%2Ftest_ScanKeyTypes_DateTime_889298060005":{"backfilled":3,"key_columns":["k"],"mode":"Backfill","scanned":"AjIwMDAtMDEtMDFUMDE6MDE6MDEuMDAwAA=="}},"cursor":"AAAAAAAAAAAAAA=="} | ||
|
||
|
||
#################################### | ||
### Capture from Key "AjIwMDAtMDEtMDFUMDE6MDE6MDEuMDAwAA==" | ||
#################################### | ||
# ================================ | ||
# Final State Checkpoint | ||
# ================================ | ||
{"bindingStateV1":{"dbo%2Ftest_ScanKeyTypes_DateTime_889298060005":{"backfilled":3,"key_columns":["k"],"mode":"Active"}},"cursor":"AAAAAAAAAAAAAA=="} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters