-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2280 from fishtown-analytics/fix/add-partitions-b…
…q-config Add "partitions" to the adapter specific config (#2256)
- Loading branch information
Showing
6 changed files
with
52 additions
and
4 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
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
20 changes: 20 additions & 0 deletions
20
test/integration/022_bigquery_test/dp-models/confirmation_noconfig.sql
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
-- This model checks to confirm that each date partition was created correctly. | ||
-- Columns day_1, day_2, and day_3 should have a value of 1, and count_days should be 3 | ||
|
||
with base as ( | ||
|
||
select | ||
case when _PARTITIONTIME = '2018-01-01' then 1 else 0 end as day_1, | ||
case when _PARTITIONTIME = '2018-01-02' then 1 else 0 end as day_2, | ||
case when _PARTITIONTIME = '2018-01-03' then 1 else 0 end as day_3 | ||
from {{ ref('partitioned_noconfig') }} | ||
|
||
) | ||
|
||
select distinct | ||
sum(day_1) over () as day_1, | ||
sum(day_2) over () as day_2, | ||
sum(day_3) over () as day_3, | ||
count(*) over () as count_days | ||
from base |
7 changes: 7 additions & 0 deletions
7
test/integration/022_bigquery_test/dp-models/partitioned_noconfig.sql
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- Hack to make sure our events models run first. | ||
-- In practice, these would be source data | ||
-- {{ ref('events_20180101') }} | ||
-- {{ ref('events_20180102') }} | ||
-- {{ ref('events_20180103') }} | ||
|
||
select * from `{{ this.schema }}`.`{{ date_sharded_table('events_') }}` |
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
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