William Whelan
04/30/2026, 5:32 AMkapa.ai
04/30/2026, 5:32 AMORDER BY
<cursor_field> IS NULL ASC,
<cursor_field> DESC,
_airbyte_emitted_at DESC
This is used in the lag() and row_number() window functions to determine _airbyte_end_at and _airbyte_active_row in the SCD table. [BigQuery SQL optimization; incremental sync tutorial]
For CDC sources, Airbyte adds metadata columns like _ab_cdc_updated_at and _ab_cdc_deleted_at, and these are factored into the normalization SQL via cdc_updated_at_order and cdc_active_row variables in the SCD model. [CDC docs] However, the exact SQL expression for those CDC-specific ordering variables is not included in the provided knowledge sources.
For the precise, up-to-date SQL used for Postgres CDC â Snowflake ordering, I'd recommend checking the Airbyte source code directly, particularly the normalization templates in stream_processor.py and the Snowflake destination connector. đ 0 button đ 0 button âšī¸ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.