{"id":14529855,"url":"https://github.com/Placekey/snowflake-external-function","last_synced_at":"2025-09-02T00:32:55.047Z","repository":{"id":54429235,"uuid":"318267393","full_name":"Placekey/snowflake-external-function","owner":"Placekey","description":"Snowflake External Function for Placekey","archived":false,"fork":false,"pushed_at":"2024-08-12T21:01:44.000Z","size":106,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-05T00:02:45.162Z","etag":null,"topics":["placekey","placekey-api","snowflake"],"latest_commit_sha":null,"homepage":"https://placekey.io","language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Placekey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-03T17:19:15.000Z","updated_at":"2024-08-12T21:01:48.000Z","dependencies_parsed_at":"2024-09-05T00:02:46.087Z","dependency_job_id":"80e8c0d9-9045-4d8d-8ce1-166964c3d02c","html_url":"https://github.com/Placekey/snowflake-external-function","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Placekey%2Fsnowflake-external-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Placekey%2Fsnowflake-external-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Placekey%2Fsnowflake-external-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Placekey%2Fsnowflake-external-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Placekey","download_url":"https://codeload.github.com/Placekey/snowflake-external-function/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231732275,"owners_count":18418178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["placekey","placekey-api","snowflake"],"created_at":"2024-09-05T00:01:02.972Z","updated_at":"2024-12-29T11:30:23.855Z","avatar_url":"https://github.com/Placekey.png","language":"PLpgSQL","funding_links":[],"categories":["Code"],"sub_categories":["Snowflake"],"readme":"# Snowflake External Function\n\n## Integration with Snowflake\n\nThe Snowflake External Function allows you to append Placekeys to your address and POI data stored in Snowflake. The function can be used similarly to a user-defined function in a query.\n\n### Creating the API Integration\n- Sign in with an ACCOUNTADMIN role to your Snowflake instance. Alternatively, sign in with a role with the global CREATE INTEGRATION privilege.\n- In the query editor, execute the following query:\n    ```\n    USE ROLE ACCOUNTADMIN;\n    ```\n    \n- Specify the database. For example, if your database is called `DEMO_DB`, run the following:\n    ```\n    USE DEMO_DB;\n    ```\n\n- Create the API Integration:\n    ```\n    CREATE OR REPLACE API INTEGRATION placekey_api_integration\n      API_PROVIDER = aws_api_gateway\n      API_AWS_ROLE_ARN = 'arn:aws:iam::886725170148:role/placekey-lambda-production'\n      ENABLED = true\n      API_ALLOWED_PREFIXES = ('https://lbdl9njufi.execute-api.us-east-1.amazonaws.com/api/')\n    ;\n    ```\n    Here, please be sure to use the `api_aws_role_arn` and `api_allowed_prefixes` in the code block above.\n\n- Create the External function to retrieve Placekeys by using the API Integration created in the above step.\n    \n    ```\n    CREATE OR REPLACE EXTERNAL FUNCTION get_placekeys(\n      input variant\n    )\n      RETURNS variant\n      API_INTEGRATION = placekey_api_integration\n      HEADERS = ('api-key' = '\u003cPASTE_YOUR_KEY_HERE\u003e')\n      MAX_BATCH_ROWS = 100\n      AS 'https://lbdl9njufi.execute-api.us-east-1.amazonaws.com/api/placekeys'\n    ;\n    ```\n    Enter your Placekey API key into `headers = ('api-key': '\u003cPASTE_YOUR_KEY_HERE\u003e')`. If you don't have a Placekey API key, get one for free at [placekey.io](https://dev.placekey.io/default/register).\n\n### Using the External Function Directly\n\n- Create some sample address and point-of-interest data:\n\n    ```\n    CREATE OR REPLACE TABLE test_addresses (\n      ID VARCHAR(16777216),\n      NAME VARCHAR(16777216),\n      STREETADDRESS VARCHAR(16777216),\n      CITY VARCHAR(16777216),\n      STATE VARCHAR(16777216),\n      ZIPCODE VARCHAR(16777216),\n      LATITUDE VARCHAR(16777216),\n      LONGITUDE VARCHAR(16777216),\n      COUNTRY VARCHAR(16777216),\n      OTHER_COLUMN VARCHAR(16777216)\n    );\n\n    INSERT INTO test_addresses\n        VALUES \n        ('5', 'Twin Peaks Petroleum', '598 Portola Dr', 'San Francisco', 'CA', '94131', '37.7371', '-122.44283', 'US', 'other_value_1'),\n        ('1', null, null, null, null, null, '37.7371', '-122.44283', 'US', 'other_value_2'),\n        ('8', 'Beretta', '1199 Valencia St', 'San Francisco', 'CA', '94110', null, null, 'US', 'other_value_3'),\n        ('3', 'Tasty Hand Pulled Noodle', '1 Doyers St', 'New York', 'ny', '10013', null, null, 'US', 'other_value_4'),\n        ('7', null, '1 Doyers St', 'New York', 'NY', '10013', null, null, null, null);\n    ```\n    \n- To use the external function directly, call it like so:\n    \n    ```\n    SELECT\n      CAST(API_RESULT[0] AS INTEGER) AS ID,\n      CAST(API_RESULT[1] AS VARCHAR) AS PLACEKEY,\n      CAST(API_RESULT[2] AS VARCHAR) AS ERROR\n    FROM (\n      SELECT get_placekeys(object_construct(joined.*)) AS API_RESULT\n      FROM (\n        SELECT\n          ID as PRIMARY_KEY,\n          NAME as LOCATION_NAME,\n          STREETADDRESS as STREET_ADDRESS,\n          CITY as CITY,\n          STATE AS REGION,\n          ZIPCODE AS POSTAL_CODE,\n          LATITUDE AS LATITUDE,\n          LONGITUDE AS LONGITUDE,\n          COUNTRY AS ISO_COUNTRY_CODE\n        FROM test_addresses\n      ) AS joined\n    ) AS RESULT\n    ORDER BY ID;\n    ```\n    \n    Note that the above requires the following:\n    - The table needs to have a unique column `id` which is passed as the first argument to the external function. The function returns the id which was originally passed to it along with the Placekeys, so the result can be joined back to the original table. The `id` field cannot be `null`.\n    - The order of the fields in the `SELECT` statement should exactly match that of the external function definition: `(id, location_name, street_address, city, region, postal_code, latitude, longitude, country)`.\n    - There are at most 1,000 rows in the table to which you want to append Placekeys. To perform queries for \u003e100 Placekeys, see the procedure below.\n\n    The function can be used as follows to query only a limited number of fields. For example, if test_addresses only had the fields `STREETADDRESS`, `CITY`, and `STATE`, the function could be called as follows:\n    \n    ```\n    SELECT\n      CAST(API_RESULT[0] AS INTEGER) AS ID,\n      CAST(API_RESULT[1] AS VARCHAR) AS PLACEKEY,\n      CAST(API_RESULT[2] AS VARCHAR) AS ERROR\n    FROM (\n      SELECT get_placekeys(object_construct(joined.*)) AS API_RESULT\n      FROM (\n        SELECT\n          ID AS PRIMARY_KEY,\n          STREETADDRESS AS STREET_ADDRESS,\n          CITY,\n          STATE AS REGION\n        FROM test_addresses\n      ) AS joined\n    ) AS RESULT\n    ORDER BY ID;\n    ```\n    \n### Using the External Function Within a Procedure\n\n- Use the following procedure to perform bulk queries:\n\n    ```\n    CREATE OR REPLACE PROCEDURE APPEND_PLACEKEYS(\n      TBL_QUERY VARCHAR(100),   --Input table\n      MAPPING VARIANT,          --Mapping variant\n      TBL_OUT VARCHAR(100),     --This is the name of your OUTPUT table.\n      TBL_TEMP VARCHAR(100),    --This is a TEMP table used to query the API and get the placekeys.\n      API_FUNCTION VARCHAR(100),--The function to call. For this example, the function was named get_placekeys. Include only the name, not parentheses.\n      BATCH_SIZE FLOAT          --Size of the batch per operation. Can't be greater than 100.\n    )\n    RETURNS VARCHAR\n    LANGUAGE JAVASCRIPT\n    AS $$\n\n        try{\n          c_primary_key = MAPPING[\"PRIMARY_KEY\"];\n          c_location_name = MAPPING[\"LOCATION_NAME\"] || \"NULL\";\n          c_street_address = MAPPING[\"STREET_ADDRESS\"] || \"NULL\";\n          c_city = MAPPING[\"CITY\"] || \"NULL\";\n          c_region = MAPPING[\"REGION\"] || \"NULL\";\n          c_postal_code = MAPPING[\"POSTAL_CODE\"] || \"NULL\";\n          c_latitude = MAPPING[\"LATITUDE\"] || \"NULL\";\n          c_longitude = MAPPING[\"LONGITUDE\"] || \"NULL\";\n          c_country_code = MAPPING[\"COUNTRY_CODE\"] || \"NULL\";\n\n          // Create a temporary table to store the results of the query\n\n          var cmd_payload = `CREATE OR REPLACE TEMPORARY TABLE ${TBL_TEMP} (RESULT ARRAY);`\n          var stmt_payload = snowflake.createStatement( {sqlText: cmd_payload} );\n          var result_payload = stmt_payload.execute();\n          result_payload.next();\n\n          // Query the API\n\n          var cmd_count = `SELECT COUNT(*) FROM ${TBL_QUERY};`   \n          var stmt_count = snowflake.createStatement( {sqlText: cmd_count} );\n          var result_count = stmt_count.execute();\n          result_count.next()\n\n          var num_rows = result_count.getColumnValue(1);\n          var num_batches = Math.ceil(num_rows / BATCH_SIZE)\n\n          for (var i = 0; i \u003c num_batches; i++) {\n            var cmd_api = `\n              INSERT INTO ${TBL_TEMP}(RESULT)\n                SELECT ${API_FUNCTION}(\n                    object_construct(a.*)\n                  ) AS RESULT\n                FROM (\n                  SELECT\n                    ${c_primary_key} AS PRIMARY_KEY, \n                    ${c_location_name} AS LOCATION_NAME, \n                    ${c_street_address} AS STREET_ADDRESS, \n                    ${c_city} AS CITY, \n                    ${c_region} AS REGION, \n                    ${c_postal_code} AS POSTAL_CODE, \n                    ${c_latitude} AS LATITUDE,\n                    ${c_longitude} AS LONGITUDE, \n                    ${c_country_code} AS ISO_COUNTRY_CODE \n                  FROM ${TBL_QUERY}\n                  ORDER BY PRIMARY_KEY\n                  LIMIT ${BATCH_SIZE}\n                  OFFSET ${BATCH_SIZE * i} ) AS a;\n            `;\n\n            var statementLoop = snowflake.createStatement( {sqlText: cmd_api} );\n            var result_setLoop = statementLoop.execute();\n            result_setLoop.next();\n          }\n\n          var cmd_join = `CREATE OR REPLACE TABLE ${TBL_OUT} AS (\n            SELECT p.*, CAST(B.RESULT[1] AS VARCHAR(100)) AS PLACEKEY, B.RESULT[2] AS error\n            FROM ${TBL_QUERY} p\n            INNER JOIN ${TBL_TEMP} B\n            ON p.${c_primary_key} = B.RESULT[0]\n            ORDER BY ${c_primary_key} ASC\n          )`;\n\n          var stmt_join = snowflake.createStatement( {sqlText: cmd_join} );\n          var result_join = stmt_join.execute();\n\n          var cmd_cleanPlacekeys = `UPDATE ${TBL_OUT} SET PLACEKEY = REPLACE(PLACEKEY,'\"', '')`;\n          var stmt_cleanPlacekeys = snowflake.createStatement( {sqlText: cmd_cleanPlacekeys} );\n          var result_cleanPlacekeys = stmt_cleanPlacekeys.execute();\n\n          return `Done! Data stored in table: ${TBL_OUT}`;\n\n        } catch (err) {\n            return `ERROR: ${err} - ${err.stackTraceTxt}`\n        }\n    $$\n    ;\n    ```\n    \n    The procedure takes the following input variables: \n    - `TBL_QUERY`: the name of the table in which your address/POI data is stored\n    - `MAPPING`: variant to indicate columns mapping\n    - `TBL_TEMP`: the name of the temporary table used in the procedure\n    - `API_FUNCTION`: the name of the External Function defined earlier\n    - `BATCH_SIZE`: number of rows to call in each iteration of the internal loop (maximum 1,000)\n    \n- The procedure can be called like follows:\n    \n    ```\n    CALL APPEND_PLACEKEYS(\n      'test_addresses',\n      (\n        SELECT object_construct(MAPPING.*)\n        FROM (\n          SELECT\n            'ID' as PRIMARY_KEY,\n            'NAME' as LOCATION_NAME,\n            'STREETADDRESS' as STREET_ADDRESS,\n            'CITY' as CITY,\n            'STATE' as REGION,\n            'ZIPCODE' as POSTAL_CODE,\n            'LATITUDE' as LATITUDE,\n            'LONGITUDE' as LONGITUDE\n        ) AS MAPPING\n      ),\n      'payload', 'temp', 'get_placekeys', 2\n    );\n    ```\n    \n    The above procedure will store all of the fields in your original table along with two additional columns - placekey and error - in a temporary table called `payload`. There is no requirement that you supply a unique ID since this is handled by the procedure.\n\n    Sometimes, you may not have a few columns like latitude and longitude. Don't worry and you can call the procedure with fewer columns. Look at the following example:\n    ```\n    CALL APPEND_PLACEKEYS(\n      'test_addresses',\n      (\n        SELECT object_construct(MAPPING.*)\n        FROM (\n          SELECT\n            'ID' as PRIMARY_KEY,\n            'STREETADDRESS' as STREET_ADDRESS,\n            'CITY' as CITY,\n            'STATE' as REGION,\n            'ZIPCODE' as POSTAL_CODE\n        ) AS MAPPING\n      ),\n      'payload', 'temp', 'get_placekeys', 2\n    );\n    ```\n    \n    \n### Summary and Code\n\nTo test out this functionality, simply copy and paste the below code block into a blank Snowflake worksheet, replace `\u003cPASTE_YOUR_DB_HERE\u003e` with the database you would like to use, replace `\u003cPASTE_YOUR_KEY_HERE\u003e` with your API key, check the box next to `All Queries` (or select all), and click `Run`.\n\n```\nUSE ROLE ACCOUNTADMIN;\nUSE \u003cPASTE_YOUR_DB_HERE\u003e;\n\n\nCREATE OR REPLACE API INTEGRATION placekey_api_integration\n  API_PROVIDER = aws_api_gateway\n  API_AWS_ROLE_ARN = 'arn:aws:iam::886725170148:role/placekey-lambda-production'\n  ENABLED = true\n  API_ALLOWED_PREFIXES = ('https://lbdl9njufi.execute-api.us-east-1.amazonaws.com/api/')\n;\n\n\nCREATE OR REPLACE EXTERNAL FUNCTION get_placekeys(\n  input variant\n)\n  RETURNS variant\n  API_INTEGRATION = placekey_api_integration\n  HEADERS = ('api-key' = '\u003cPASTE_YOUR_KEY_HERE\u003e')\n  MAX_BATCH_ROWS = 100\n  AS 'https://lbdl9njufi.execute-api.us-east-1.amazonaws.com/api/placekeys'\n;\n\n\nCREATE OR REPLACE TABLE test_addresses (\n  ID VARCHAR(16777216),\n  NAME VARCHAR(16777216),\n  STREETADDRESS VARCHAR(16777216),\n  CITY VARCHAR(16777216),\n  STATE VARCHAR(16777216),\n  ZIPCODE VARCHAR(16777216),\n  LATITUDE VARCHAR(16777216),\n  LONGITUDE VARCHAR(16777216),\n  COUNTRY VARCHAR(16777216),\n  OTHER_COLUMN VARCHAR(16777216)\n);\n\n\nINSERT INTO test_addresses\n    VALUES \n    ('5', 'Twin Peaks Petroleum', '598 Portola Dr', 'San Francisco', 'CA', '94131', '37.7371', '-122.44283', 'US', 'other_value_1'),\n    ('1', null, null, null, null, null, '37.7371', '-122.44283', 'US', 'other_value_2'),\n    ('8', 'Beretta', '1199 Valencia St', 'San Francisco', 'CA', '94110', null, null, 'US', 'other_value_3'),\n    ('3', 'Tasty Hand Pulled Noodle', '1 Doyers St', 'New York', 'ny', '10013', null, null, 'US', 'other_value_4'),\n    ('7', null, '1 Doyers St', 'New York', 'NY', '10013', null, null, null, null);\n\n\nSELECT\n  CAST(API_RESULT[0] AS INTEGER) AS ID,\n  CAST(API_RESULT[1] AS VARCHAR) AS PLACEKEY,\n  CAST(API_RESULT[2] AS VARCHAR) AS ERROR\nFROM (\n  SELECT get_placekeys(object_construct(joined.*)) AS API_RESULT\n  FROM (\n    SELECT\n      ID as PRIMARY_KEY,\n      NAME as LOCATION_NAME,\n      STREETADDRESS as STREET_ADDRESS,\n      CITY AS CITY,\n      STATE AS REGION,\n      ZIPCODE AS POSTAL_CODE,\n      LATITUDE AS LATITUDE,\n      LONGITUDE AS LONGITUDE,\n      COUNTRY AS ISO_COUNTRY_CODE\n    FROM test_addresses\n  ) AS joined\n) AS RESULT\nORDER BY ID;\n\n\n// Get Placekeys for the data in test_addresses, but only query (id, street_address, city, and region). \n// Note that a null iso_country_code defaults to 'US'.\n\nSELECT\n  CAST(API_RESULT[0] AS INTEGER) AS ID,\n  CAST(API_RESULT[1] AS VARCHAR) AS PLACEKEY,\n  CAST(API_RESULT[2] AS VARCHAR) AS ERROR\nFROM (\n  SELECT get_placekeys(object_construct(joined.*)) AS API_RESULT\n  FROM (\n    SELECT\n      ID AS PRIMARY_KEY,\n      STREETADDRESS AS STREET_ADDRESS,\n      CITY,\n      STATE AS REGION\n    FROM test_addresses\n  ) AS joined\n) AS RESULT\nORDER BY ID\n;\n\n\nCREATE OR REPLACE PROCEDURE APPEND_PLACEKEYS(\n  TBL_QUERY VARCHAR(100),   --Input table\n  MAPPING VARIANT,          --Mapping variant\n  TBL_OUT VARCHAR(100),     --This is the name of your OUTPUT table.\n  TBL_TEMP VARCHAR(100),    --This is a TEMP table used to query the API and get the placekeys.\n  API_FUNCTION VARCHAR(100),--The function to call. For this example, the function was named get_placekeys. Include only the name, not parentheses.\n  BATCH_SIZE FLOAT          --Size of the batch per operation. Can't be greater than 1000.\n)\nRETURNS VARCHAR\nLANGUAGE JAVASCRIPT\nAS $$\n\n    try{\n      c_primary_key = MAPPING[\"PRIMARY_KEY\"];\n      c_location_name = MAPPING[\"LOCATION_NAME\"] || \"NULL\";\n      c_street_address = MAPPING[\"STREET_ADDRESS\"] || \"NULL\";\n      c_city = MAPPING[\"CITY\"] || \"NULL\";\n      c_region = MAPPING[\"REGION\"] || \"NULL\";\n      c_postal_code = MAPPING[\"POSTAL_CODE\"] || \"NULL\";\n      c_latitude = MAPPING[\"LATITUDE\"] || \"NULL\";\n      c_longitude = MAPPING[\"LONGITUDE\"] || \"NULL\";\n      c_country_code = MAPPING[\"COUNTRY_CODE\"] || \"NULL\";\n      \n      // Create a temporary table to store the results of the query\n\n      var cmd_payload = `CREATE OR REPLACE TEMPORARY TABLE ${TBL_TEMP} (RESULT ARRAY);`\n      var stmt_payload = snowflake.createStatement( {sqlText: cmd_payload} );\n      var result_payload = stmt_payload.execute();\n      result_payload.next();\n\n      // Query the API\n\n      var cmd_count = `SELECT COUNT(*) FROM ${TBL_QUERY};`   \n      var stmt_count = snowflake.createStatement( {sqlText: cmd_count} );\n      var result_count = stmt_count.execute();\n      result_count.next()\n\n      var num_rows = result_count.getColumnValue(1);\n      var num_batches = Math.ceil(num_rows / BATCH_SIZE)\n\n      for (var i = 0; i \u003c num_batches; i++) {\n        var cmd_api = `\n          INSERT INTO ${TBL_TEMP}(RESULT)\n            SELECT ${API_FUNCTION}(\n                object_construct(a.*)\n              ) AS RESULT\n            FROM (\n              SELECT\n                ${c_primary_key} AS PRIMARY_KEY, \n                ${c_location_name} AS LOCATION_NAME, \n                ${c_street_address} AS STREET_ADDRESS, \n                ${c_city} AS CITY, \n                ${c_region} AS REGION, \n                ${c_postal_code} AS POSTAL_CODE, \n                ${c_latitude} AS LATITUDE,\n                ${c_longitude} AS LONGITUDE, \n                ${c_country_code} AS ISO_COUNTRY_CODE \n              FROM ${TBL_QUERY}\n              ORDER BY PRIMARY_KEY\n              LIMIT ${BATCH_SIZE}\n              OFFSET ${BATCH_SIZE * i} ) AS a;\n        `;\n\n        var statementLoop = snowflake.createStatement( {sqlText: cmd_api} );\n        var result_setLoop = statementLoop.execute();\n        result_setLoop.next();\n      }\n\n      var cmd_join = `CREATE OR REPLACE TABLE ${TBL_OUT} AS (\n        SELECT p.*, CAST(B.RESULT[1] AS VARCHAR(100)) AS PLACEKEY, B.RESULT[2] AS error\n        FROM ${TBL_QUERY} p\n        INNER JOIN ${TBL_TEMP} B\n        ON p.${c_primary_key} = B.RESULT[0]\n        ORDER BY ${c_primary_key} ASC\n      )`;\n\n      var stmt_join = snowflake.createStatement( {sqlText: cmd_join} );\n      var result_join = stmt_join.execute();\n\n      var cmd_cleanPlacekeys = `UPDATE ${TBL_OUT} SET PLACEKEY = REPLACE(PLACEKEY,'\"', '')`;\n      var stmt_cleanPlacekeys = snowflake.createStatement( {sqlText: cmd_cleanPlacekeys} );\n      var result_cleanPlacekeys = stmt_cleanPlacekeys.execute();\n\n      return `Done! Data stored in table: ${TBL_OUT}`;\n\n    } catch (err) {\n        return `ERROR: ${err} - ${err.stackTraceTxt}`\n    }\n$$\n;\n\n\n// Call the procedure.\nCALL APPEND_PLACEKEYS(\n  'test_addresses',\n  (\n    SELECT object_construct(MAPPING.*)\n    FROM (\n      SELECT\n        'ID' as PRIMARY_KEY,\n        'STREETADDRESS' as STREET_ADDRESS,\n        'CITY' as CITY,\n        'STATE' as REGION,\n        'ZIPCODE' as POSTAL_CODE,\n        'LATITUDE' as LATITUDE,\n        'LONGITUDE' as LONGITUDE\n    ) AS MAPPING\n  ),\n  'payload', 'temp', 'get_placekeys', 2\n);\n\n\n// Check the results.\n\nSELECT * FROM payload;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPlacekey%2Fsnowflake-external-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPlacekey%2Fsnowflake-external-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPlacekey%2Fsnowflake-external-function/lists"}