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
      • 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
  • Policy reference parameters
  • Usage notes
  • Links
  1. Basic usage (CLI + YAML)
  2. YAML configs

EXTERNAL TABLE

Config path: /<database>/<schema>/external_table/<name>.yaml

Example:

columns:
  dt:
    type: DATE
    expr: "to_date(split_part(metadata$filename, '/', 2))::date"
    comment: "Date of ingestion"

  id:
    type: NUMBER(38,0) NOT NULL
    expr: "$1:id::number(38,0)"

  name:
    type: VARCHAR(255) NOT NULL
    expr: "$1:name::varchar(255)"

location:
  stage: test_external_stage
  file_format: test_parquet_format

partition_by: [dt]

Schema

  • columns (dict)

    • {key} (ident) - column name

    • {value} (dict)

      • expr (str) - SQL expression describing column

      • comment (str)

  • location (dict)

    • stage (ident) - stage name

    • path (str) - path prefix for files stage

    • pattern (str) - regular expression to filter files in stage

  • partition_by (list)

    • {items} (ident) - column names for PARTITION BY

  • partition_type (str) - example: USER_DEFINED

  • auto_refresh (bool) - enable AUTO_REFRESH (default: False)

  • refresh_on_create (bool) - refresh once immediately after creation (default: False)

  • aws_sns_topic (str) - SNS topic for S3 bucket

  • table_format (str) - example: DELTA

  • comment (str)

  • primary_key (list)

    • {items} (ident) - column names for PRIMARY KEY constraint

  • unique_keys (list)

    • {items} (list)

      • {items} (ident) - column names for UNIQUE KEY constraint

  • foreign_keys (list)

    • {items} (dict) - FOREIGN KEY definitions

      • columns (list)

        • {items} (ident) - column names from current table

      • ref_table (ident) - reference table

      • ref_columns (list)

        • {items} (ident) - column names from reference table

Policy reference parameters

  • row_access_policy (dict)

    • columns (list)

      • {items} (ident) - reference column names

Usage notes

  1. If automatic metadata refresh it not available for your cloud provider, it should be implemented separately. SnowDDL cannot refresh external table metadata for you.

  2. file_format can only be specified by name referencing to FILE_FORMAT object.

Links

PreviousEXTERNAL FUNCTIONNextFILE FORMAT

Last updated 6 months ago

type (str) - full with optional "NOT NULL" constraint (not enforced)

file_format (ident) - for files in stage

integration (ident) - notification name for Azure

policy_name (ident) - name of

📦
data type
file format
integration
ROW ACCESS POLICY
CREATE EXTERNAL TABLE
SHOW EXTERNAL TABLES
DESC EXTERNAL TABLE
Working with External Tables
Parser & JSON Schema (GitHub)