geocode function returning more rows than expected, to be fixed.

This commit is contained in:
Yam ZhengLim
2023-05-20 13:44:19 +00:00
parent f08ed4ef0e
commit 382b8d5866
@@ -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,