Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dmaresma opened this issue Jul 31, 2024 · 1 comment

Comments

@dmaresma
Copy link
Contributor

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",

@xnuinside
Copy link
Owner

@dmaresma I released version 1.5.3 with your changes

@dmaresma dmaresma closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants