Created
June 8, 2023 15:41
-
-
Save Victoriapm/78a566623c9d15e38eb367eb0be89773 to your computer and use it in GitHub Desktop.
Apply dev limits to dbt models
This file contains hidden or 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
| -- Alternative one: Limit the result regardless of the query | |
| select * | |
| from event_tracking.events | |
| {% if target.name == 'dev' %} | |
| limit 10 | |
| {% endif %} | |
| -- Alternative 2: Limit the result depending on the loading date | |
| select * | |
| from event_tracking.events | |
| {% if target.name == 'dev' %} | |
| where created_at >= dateadd('day', -3, current_date) | |
| {% endif %} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment