From f38615b018a36b3e00512d05b3bcb63f144df3eb Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Thu, 18 Jul 2024 04:07:35 -0600 Subject: [PATCH] Restoring cross-database compatibility of example code (#5785) [Preview](https://docs-getdbt-com-git-dbeatty10-patch-1-dbt-labs.vercel.app/docs/build/incremental-models#filtering-rows-on-an-incremental-run) ## What are you changing in this pull request and why? The code change in https://github.com/dbt-labs/docs.getdbt.com/pull/5326 was tested against a variety of dbt adapters. The update in https://github.com/dbt-labs/docs.getdbt.com/pull/5306 modified that code example, and it appears to have database-specific cast syntax (`::`) as well as a data type that means different things in different databases (i.e., the `TIMESTAMP` data type has different semantics in BigQuery vs. Snowflake). So we should restore the code example in https://github.com/dbt-labs/docs.getdbt.com/pull/5326. If there is a better example that has been tested across dbt adapters, then we can consider making another update in the future. ## Checklist - [x] Review the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines. --- website/docs/docs/build/incremental-models.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/build/incremental-models.md b/website/docs/docs/build/incremental-models.md index 21215437d89..21cd656484a 100644 --- a/website/docs/docs/build/incremental-models.md +++ b/website/docs/docs/build/incremental-models.md @@ -71,7 +71,7 @@ from {{ ref('app_data_events') }} -- this filter will only be applied on an incremental run -- (uses >= to include records whose timestamp occurred since the last run of this model) -- (If event_time is NULL or the table is truncated, the condition will always be true and load all records) -where event_time >= (select coalesce(max(event_time),'1900-01-01'::TIMESTAMP) from {{ this }} ) +where event_time >= (select coalesce(max(event_time),'1900-01-01') from {{ this }} ) {% endif %} ```