Skip to content

Commit

Permalink
Fuzzy Key Uniqueness Threshold for fct_vehicle_locations (#3303)
Browse files Browse the repository at this point in the history
  • Loading branch information
SorenSpicknall authored Mar 19, 2024
1 parent 0e047a8 commit c1ddbc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
10 changes: 1 addition & 9 deletions warehouse/models/mart/gtfs/_mart_gtfs_fcts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,7 @@ models:
level.
columns:
- name: key
description: |
Synthetic primary key.
tests:
- unique:
config:
where: '__rt_sampled__'
- not_null:
config:
where: '__rt_sampled__'
tests: *almost_unique_rt_key_tests
- <<: *rt_trip_id
tests:
- not_null:
Expand Down
10 changes: 8 additions & 2 deletions warehouse/models/mart/gtfs/fct_vehicle_locations.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{{
config(
materialized='incremental',
unique_key = 'key',
cluster_by = ['service_date', 'base64_url'],
incremental_strategy='insert_overwrite',
partition_by = {
'field': 'dt',
'data_type': 'date',
'granularity': 'day',
},
cluster_by=['dt', 'base64_url'],
on_schema_change='append_new_columns'
)
}}

Expand Down

0 comments on commit c1ddbc6

Please sign in to comment.