datacontract-cli
datacontract-cli copied to clipboard
Database and schema in Snowflake CREATE TABLE statement not picked up for servers section of YAML on import
Snowflake SQL script has a CREATE TABLE dbs.schema.table, but the generated YAML reports errors on missing account, database, and schema. Account I understand, but database and schema are present and should be included in the servers section.
Looking at the code in sql_importer.py, it appears that this would be the required SQLGlot code to pick up database and schema:
for table in tables:
...
table_name = table.this.name
database_name = table.catalog
schema_name = table.db