Skip to content

Commit 9cedf1c

Browse files
authored
Merge pull request #3795 from cal-itp/vp-grouped-table-settings
use service_date for fct_vp_grouped table settings
2 parents 7a79671 + 4d86aff commit 9cedf1c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

warehouse/models/mart/gtfs/fct_vehicle_locations_grouped.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
materialized='incremental',
44
incremental_strategy='insert_overwrite',
55
partition_by = {
6-
'field': 'dt',
6+
'field': 'service_date',
77
'data_type': 'date',
88
'granularity': 'day',
99
},
10-
cluster_by=['dt', 'base64_url'],
10+
cluster_by=['service_date', 'base64_url'],
1111
on_schema_change='append_new_columns'
1212
)
1313
}}
@@ -25,7 +25,7 @@ WITH fct_vehicle_locations AS (
2525
location,
2626
-- rather than using next_location_key, use lag to calculate direction from previous
2727
FROM {{ ref('fct_vehicle_locations') }}
28-
WHERE {{ incremental_where(default_start_var='PROD_GTFS_RT_START') }}
28+
WHERE {{ incremental_where(default_start_var='PROD_GTFS_RT_START') }} AND trip_instance_key IS NOT NULL
2929
),
3030

3131
lat_lon AS (

0 commit comments

Comments
 (0)