From 382b8d58660b35d257a14cce06914d3f7d01a0fe Mon Sep 17 00:00:00 2001 From: Yam ZhengLim Date: Sat, 20 May 2023 13:44:19 +0000 Subject: [PATCH] geocode function returning more rows than expected, to be fixed. --- analyses/call_eudf_address_to_coordinates.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/analyses/call_eudf_address_to_coordinates.sql b/analyses/call_eudf_address_to_coordinates.sql index 5a1d1fd..b7604cf 100644 --- a/analyses/call_eudf_address_to_coordinates.sql +++ b/analyses/call_eudf_address_to_coordinates.sql @@ -6,10 +6,12 @@ -- from {{ ref('test_address__mock_data') }}; -- This block of code returns the latitude, longitude, metadata, every data column +-- Fix why this block return 289 rows instead of 17 rows? WITH json_data AS ( SELECT PARSE_JSON( {{ address_to_coordinates( 'ADDRESS_LINE_ONE', 'ADDRESS_LINE_TWO', 'POSTCODE', 'DISTRICT_NAME', 'STATE_NAME' ) }} ) AS response from {{ ref('test_address__mock_data') }} ) + SELECT response[0]:geometry:location:lat::float AS LATITUDE, response[0]:geometry:location:lng::float AS LONGITUDE,