-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch/update partition expiration sandbox (#549)
* HUBBLE-623 Update Canvas retention window * None schedule interval creates Nonetype object errors * cast string as date
- Loading branch information
1 parent
009e0d8
commit 042908c
Showing
2 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
create or replace table `{target_project}.{target_dataset}.{table_id}` | ||
partition by date_trunc(batch_run_date, day) | ||
options (partition_expiration_days = 180) as ( | ||
options (partition_expiration_days = 450) as ( | ||
select * | ||
from `{project_id}.{dataset_id}.{table_id}` | ||
where | ||
batch_run_date >= date_trunc(date_sub(current_date(), interval 6 month), day) | ||
and batch_run_date < date_trunc(current_date(), day) | ||
batch_run_date >= date_trunc(date_sub(date('{batch_run_date}'), interval 15 month), day) | ||
and batch_run_date < date_trunc(date('{batch_run_date}'), day) | ||
) |
This file contains 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