mirror of
https://gitlab.com/cief-data/dbt_cloud.git
synced 2026-08-19 04:14:00 +00:00
26 lines
1002 B
SQL
26 lines
1002 B
SQL
/*
|
|
A macro to convert an address string into a set of geo coordinates.
|
|
|
|
It accepts five input parameters representing address components and returns the parsed JSON response from the E-UDF.
|
|
|
|
Usage:
|
|
{{ address_to_coordinates(column1, column2, column3, column4, column5) }}
|
|
|
|
Parameters:
|
|
- column1: VARCHAR or STRING - ADDRESS_LINE_ONE
|
|
- column2: VARCHAR or STRING - ADDRESS_LINE_TWO
|
|
- column3: VARCHAR or STRING - POSTCODE
|
|
- column4: VARCHAR or STRING - DISTRICT_NAME
|
|
- column5: VARCHAR or STRING - STATE_NAME
|
|
|
|
Returns:
|
|
- VARIANT - A parsed JSON response from the E-UDF, representing metadata from geocoding the address.
|
|
|
|
Example:
|
|
{{ address_to_coordinates('ADDRESS_LINE_ONE', 'ADDRESS_LINE_TWO', 'POSTCODE', 'DISTRICT_NAME', 'STATE_NAME') }}
|
|
*/
|
|
|
|
{%- macro address_to_coordinates(column1, column2, column3, column4, column5) -%}
|
|
PARSE_JSON( GLOBAL_FUNCTION.EUDF.ECHO_ADDRESS_TO_COORDINATES({{column1}}, {{column2}}, {{column3}}, {{column4}}, {{column5}}) )
|
|
{%- endmacro -%}
|