Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add incremental variable for overlap #163

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changes/5.3.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## dbt-snowflake-monitoring 5.3.1 - August 23, 2024

### Features

- Add lookback variable to stg_query_history ([#163](https://github.com/get-select/dbt-snowflake-monitoring/pull/163))

### Contributors
- [@smitsrr](https://github.com/smitsrr) (Features)

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).

## dbt-snowflake-monitoring 5.3.1 - August 23, 2024

### Features

- Add lookback variable to stg_query_history ([#163](https://github.com/get-select/dbt-snowflake-monitoring/pull/163))

### Contributors
- [@smitsrr](https://github.com/smitsrr) (Features)


## dbt-snowflake-monitoring 5.3.0 - June 15, 2024

### Features
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'dbt_snowflake_monitoring'
version: '5.3.0'
version: '5.3.1'
config-version: 2

profile: dbt_snowflake_monitoring
Expand Down
2 changes: 1 addition & 1 deletion models/staging/stg_query_history.sql
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ from {{ source('snowflake_account_usage', 'query_history') }}
{% if is_incremental() %}
-- must use end time in case query hasn't completed
-- add lookback window of 2 days to account for late arriving queries
where end_time > (select dateadd(day, -2, coalesce(max(end_time), '1970-01-01') ) from {{ this }})
where end_time > (select dateadd(day, -{{ var('dbt_snowflake_monitoring_incremental_days', '2') }}, coalesce(max(end_time), '1970-01-01') ) from {{ this }})
{% endif %}

order by start_time
Loading