Skip to content

Commit e943264

Browse files
committed
fix nypdbeat error log
1 parent fe970f7 commit e943264

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

products/cscl/models/intermediate/adjacent_polygons/int__segment_nypdbeat.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ SELECT
1212
co.lionkey,
1313
co.segmentid,
1414
left(left_beat.post, 1) AS left_nypd_service_area,
15-
left(right_beat.post, 1) AS right_nypd_service_area
15+
left_beat.sector AS left_nypd_beat_sector,
16+
left(right_beat.post, 1) AS right_nypd_service_area,
17+
right_beat.sector AS right_nypd_beat_sector
1618
FROM segment_offsets AS co
1719
-- using a cte around reference can confus the postgres compiler to not use index
1820
LEFT JOIN {{ source("recipe_sources", "dcp_cscl_nypdbeat") }} AS left_beat
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
SELECT
22
'segment joined to no nypd beat' AS error,
3-
globalid,
4-
source_table,
3+
segments.globalid,
4+
segments.source_table,
55
'segmentid' AS record_id_type,
6-
segmentid AS record_id
7-
FROM {{ ref('int__lion') }}
8-
WHERE left_nypd_service_area IS NULL AND right_nypd_service_area IS NULL
6+
segments.segmentid AS record_id
7+
FROM {{ ref('int__segments' ) }} AS segments
8+
INNER JOIN {{ ref('int__segment_nypdbeat') }} AS beat ON segments.lionkey = beat.lionkey
9+
WHERE beat.left_nypd_sector IS NULL AND beat.right_nypd_sector IS NULL

0 commit comments

Comments
 (0)