Repository navigation
Normalization: Better handling for interesting CDC situations - #25993
Conversation
| cdc_cols += f", {cast_begin}{col_cdc_log_pos}{cast_as}" + "{{ dbt_utils.type_string() }}" + f"{cast_end}" | ||
| quoted_cdc_cols += f", {quoted_col_cdc_log_pos}" | ||
|
|
||
| if "_ab_cdc_lsn" in column_names.keys(): |
There was a problem hiding this comment.
this is copied from the if-statement right above, which enables sorting on _ab_cdc_log_pos
| }, | ||
| "sync_mode": "incremental", | ||
| "cursor_field": ["_ab_cdc_lsn"], | ||
| "cursor_field": [], |
There was a problem hiding this comment.
this replicates cdc behavior in practice, where source-postgres doesn't declare an explicit cursor field
(we should maybe reconsider that behavior, but I think that's a separate conversation)
Affected Connector ReportNOTE
|
| Connector | Version | Changelog | Publish |
|---|
- See "Actionable Items" below for how to resolve warnings and errors.
❌ Destinations (15)
| Connector | Version | Changelog | Publish |
|---|---|---|---|
destination-bigquery |
1.4.1 |
✅ | ✅ |
destination-bigquery-denormalized |
1.4.0 |
✅ | ✅ |
destination-clickhouse |
0.2.3 |
✅ | ✅ |
destination-clickhouse-strict-encrypt |
0.2.3 |
🔵 (ignored) |
🔵 (ignored) |
destination-mssql |
0.1.23 |
✅ | ✅ |
destination-mssql-strict-encrypt |
0.1.23 |
🔵 (ignored) |
🔵 (ignored) |
destination-mysql |
0.1.20 |
✅ | ✅ |
destination-mysql-strict-encrypt |
❌ 0.1.21(mismatch: 0.1.20) |
🔵 (ignored) |
🔵 (ignored) |
destination-oracle |
0.1.19 |
✅ | ✅ |
destination-oracle-strict-encrypt |
0.1.19 |
🔵 (ignored) |
🔵 (ignored) |
destination-postgres |
0.3.27 |
✅ | ✅ |
destination-postgres-strict-encrypt |
0.3.27 |
🔵 (ignored) |
🔵 (ignored) |
destination-redshift |
0.4.7 |
✅ | ✅ |
destination-snowflake |
1.0.2 |
✅ | ✅ |
destination-tidb |
0.1.1 |
✅ | ✅ |
- See "Actionable Items" below for how to resolve warnings and errors.
👀 Other Modules (1)
- base-normalization
Actionable Items
(click to expand)
| Category | Status | Actionable Item |
|---|---|---|
| Version | ❌ mismatch |
The version of the connector is different from its normal variant. Please bump the version of the connector. |
| ⚠ doc not found |
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug. |
|
| Changelog | ⚠ doc not found |
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug. |
| ❌ changelog missing |
There is no chnagelog for the current version of the connector. If you are the author of the current version, please add a changelog. | |
| Publish | ⚠ not in seed |
The connector is not in the cloud or oss registry, so its publication status cannot be checked. This can be normal (e.g. some connectors are cloud-specific, and only listed in the cloud seed file). Please double-check to make sure that you have added a metadata.yaml file and the expected registries are enabled. |
This comment was marked as outdated.
This comment was marked as outdated.
|
/test connector=connectors/destination-snowflake
Build PassedTest summary info: |
|
/test connector=connectors/destination-bigquery
Build PassedTest summary info: |
|
/test connector=bases/base-normalization
Build PassedTest summary info: |
|
/publish connector=bases/base-normalization
if you have connectors that successfully published but failed definition generation, follow step 4 here |
|
/publish connector=connectors/destination-bigquery
if you have connectors that successfully published but failed definition generation, follow step 4 here |
…hq#25993) * try this? * fix tests * assert cdc values * handle case where we have lsn but no updated_at * readability improvements * tweaks to test * version bumps + changelogs * Automated Change --------- Co-authored-by: edgao <edgao@users.noreply.github.com>
What
Similar to how source-mysql CDC will sort on both
_ab_cdc_updated_atAND_ab_cdc_log_pos, source-postgres CDC should sort using both updated_at AND_ab_cdc_lsn.Note that this adds a new
_ab_cdc_lsncolumn to the final table. I think that's fine.Long-term:
_airbyte_emitted_at, and we can remove the hardcoded CDC column references?How
Copy-paste the
_ab_cdc_log_posstuff.We'll need to publish:
bases/base-normalizationconnectors/destination-bigquery(because normalization code is copied into the bigquery connector)Recommended reading order
*also see
dbt_integration_test.py- I swapped the comment character from#to//to align better with jsonl conventionstest_dedup_cdc_excluded....sqlfiles are inputs todbt test. If they return nonzero records,dbt testwill throw an error.dedup_cdc_excluded_....incorrect_names.sqlfiles are the inputs to thosetest_....sqlfiles. We're asserting the exact set of records that we expect to see after each sync.🚨 User Impact 🚨
source-postgres CDC users will see a new column
_ab_cdc_lsnin their SCD and final tables.