SnowDDL
  • 👋Introduction
  • 🚩Getting started
  • 📋Main features
  • 🪤SnowDDL vs. Declarative DCM
  • In-depth guides
    • 👓Object identifiers
    • 📐Data types
    • 📦Object types
    • 🎭Role hierarchy
    • 🚧Permission model
    • 🔦Other guides
      • Administration user
      • Integrations
      • Inbound shares
      • Object OWNERSHIP
      • Safe & unsafe DDL
      • Dependency management
      • Short hash explained
      • Env Prefix explained
      • Team workflow
      • Limitations & workarounds
      • Fivetran
      • Airbyte
      • Encrypt user passwords
      • Iceberg Tables
  • Basic usage (CLI + YAML)
    • 💻CLI interface
    • 📦YAML configs
      • ACCOUNT PARAMETER
      • ACCOUNT POLICY
      • AGGREGATION POLICY
      • ALERT
      • AUTHENTICATION POLICY
      • BUSINESS ROLE
      • DATABASE
      • DATABASE ROLE
      • DYNAMIC TABLE
      • EVENT TABLE
      • EXTERNAL ACCESS INTEGRATION
      • EXTERNAL FUNCTION
      • EXTERNAL TABLE
      • FILE FORMAT
      • FUNCTION
      • HYBRID TABLE
      • ICEBERG TABLE
      • MASKING POLICY
      • MATERIALIZED VIEW
      • NETWORK POLICY
      • NETWORK RULE
      • PERMISSION MODEL
      • PIPE
      • PLACEHOLDER
      • PROCEDURE
      • PROJECTION POLICY
      • RESOURCE MONITOR
      • ROW ACCESS POLICY
      • SCHEMA
      • SECRET
      • SEQUENCE
      • SHARE (outbound)
      • STAGE
      • STAGE FILE
      • STREAM
      • TABLE
      • TASK
      • TECHNICAL ROLE
      • USER
      • VIEW
      • WAREHOUSE
    • 🏷️YAML placeholders
    • 📬YAML tag !include
    • 🔐YAML tag !decrypt
  • Single DB
    • 🦀Overview
  • Advanced usage (Python)
    • ⚙️Programmatic config
    • 🐍Architecture overview
      • 🔵Blueprints
      • 🟣Config
      • 🟠Parsers
      • 🟢Resolvers
      • 🔴Engine
    • 🏗️Query builder & formatter
  • Breaking changes log
    • 0.45.0 - March 2025
    • 0.41.0 - January 2025
    • 0.37.0 - December 2024
    • 0.36.0 - November 2024
    • 0.33.0 - October 2024
    • 0.27.0 - May 2024
  • Links
    • GitHub repository
    • PyPI package
    • YouTube tutorials
    • Changelog
    • LinkedIn profile
Powered by GitBook
On this page
  • Schema
  • Usage notes
  • Additional privileges
  • Links
  1. Basic usage (CLI + YAML)
  2. YAML configs

EXTERNAL FUNCTION

Config path: /<database>/<schema>/external_function/<name>(<dtypes>).yaml

Example:

arguments:
  string_col: VARCHAR(255)

returns: VARIANT

api_integration: test_api_integration
url: https://xyz.execute-api.us-west-2.amazonaws.com/production/remote_echo

Schema

  • arguments (dict)

    • {key} (ident) - argument name

    • {value} (str) - argument data type

  • returns (str) - for single return value, return data type

  • api_integration (ident) - name of API integration

  • url (str) - invocation URL of proxy service

  • is_secure (bool) - is function SECURE

  • is_strict (bool) - is function STRICT (always returns NULL on NULL input)

  • is_immutable (bool) - is function IMMUTABLE (same input always produced the same output)

  • headers (dict)

    • {key} (str) - header name

    • {value} (str) - header value

  • context_headers (list)

    • {items} (ident) - context function name

  • max_batch_rows (int) - maximum number of rows in each batch sent to the proxy service

  • comment (str)

Usage notes

  1. Snowflake supports overloading of function names. Multiple functions may have the same name as long as they have different arguments. It is required to use comma-separated base data types of arguments in config names. For example: my_function(number).yaml, my_function(varchar,number).yaml

  2. API integration should be created and granted to SnowDDL admin role manually prior to execution.

Additional privileges

In order for EXTERNAL FUNCTION objects to operate properly, the following additional grants should be added to OWNER role in schema config:

  • owner_integration_usage - please specify names of API INTEGRATION objects used by external functions. Functions may work without explicit INTEGRATION USAGE grant to OWNER role, but it is not guaranteed for Snowflake keep it this way forever.

Links

  • CREATE EXTERNAL FUNCTION

  • SHOW EXTERNAL FUNCTIONS

  • CREATE API INTEGRATION

  • Parser & JSON Schema (GitHub)

PreviousEXTERNAL ACCESS INTEGRATIONNextEXTERNAL TABLE

Last updated 1 year ago

📦