Skip to content

Commit

Permalink
Fix bug on joins
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Sep 2, 2023
1 parent a9d7d49 commit c2460c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/field_update
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,18 @@ class Raw:
t2 AS (
SELECT
t1.osm_id,
array_agg(cg.{source_column}) AS aa_fids
COALESCE(array_agg(cg.{source_column}),ARRAY[0]::integer[]) AS aa_fids
FROM
t1
INNER JOIN
LEFT JOIN
{source_table} cg ON ST_Intersects(t1.geom, cg.{source_geom})
GROUP BY
t1.osm_id
)
UPDATE
{target_table} uw
SET
{target_column} = COALESCE(t2.aa_fids, ARRAY[0]::integer[])
{target_column} = t2.aa_fids
FROM
t2
WHERE
Expand Down

0 comments on commit c2460c0

Please sign in to comment.