Skip to content

Commit

Permalink
Restoring cross-database compatibility of example code (#5785)
Browse files Browse the repository at this point in the history
[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 #5326
was tested against a variety of dbt adapters. The update in
#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
#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.
  • Loading branch information
dbeatty10 authored Jul 18, 2024
1 parent 6ba5fda commit f38615b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/docs/docs/build/incremental-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
```
Expand Down

0 comments on commit f38615b

Please sign in to comment.