Skip to content

Snowflake Create External Table DDL with named format not supported return empty array #273

@dmaresma

Description

@dmaresma

Describe the bug
Snowflake SQL Create External Table DDL with given name file format reference

To Reproduce
` ddl = """create or replace external table if not exists ${database_name}.MySchemaName.MyTableName(
"Filename" VARCHAR(16777216) AS (METADATA$FILENAME))
partition by ("Filename")
location = @ADL_DH_DL_PTS/
auto_refresh = false
file_format = MyFormatName
;"""

result = DDLParser(ddl, normalize_names=True, debug=True).run(
    output_mode="snowflake"
)
expected = [
    {
        "table_name": "MyTableName",
        "schema": "MySchemaName",
        "primary_key": [],
        "columns": [
            {
                "name": "Filename",
                "type": "VARCHAR",
                "size": 16777216,
                "references": None,
                "unique": False,
                "nullable": True,
                "default": None,
                "check": None,
                "generated": {"as": "METADATA$FILENAME"},
            }
        ],
        "alter": {},
        "checks": [],
        "index": [],
        "partitioned_by": [],
        "partition_by": {"columns": ["Filename"], "type": None},
        "tablespace": None,
        "if_not_exists": True,
        "table_properties": {
            "project": "${database_name}",
            "auto_refresh": False,
            "file_format":"MyFormatName",
        },
        "replace": True,
        "location": "@ADL_DH_DL_PTS/",
        "external": True,
        "primary_key_enforced": None,
        "clone": None,
    }
]`

Expected behavior
the file_format member should like : "file_format":"MyFormatName",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions