simple-ddl-parser
simple-ddl-parser copied to clipboard
Snowflake columns with autoincrement are not being parsed
I am using parsed_object = DDLParser(object_ddl).run() to parse Snowflake DDL queries. However, when I try to parse a table which has columns with autoincrement, the whole table is not being parsed and I get an empty list [] as a result.
Example query:
create or replace table TEST_TABLE (
custkey number(38,0) autoincrement start 3 increment 10,
orderdate date default null comment 'This is a column comment',
orderstatus varchar(100) default null,
price varchar(255)
)
If I remove the custkey column, the table is being properly parsed.
To Reproduce Steps to reproduce the behavior:
- Execute
DDLParser(object_ddl).run()with object_ddl being the test query I have added above. - See the empty list result instead of the table dictionary.
Expected behavior
The result of DDLParser(object_ddl).run() should be a dictionary containing the table info.
Desktop
- OS: macOS Monterey
- Version: 12.4
@ashumkoska hi! thanks for reporting the issue, problem not in autoincrement - problem in statement after it, so if try
custkey number(38,0) autoincrement,
orderdate date default null comment 'This is a column comment',
orderstatus varchar(100) default null,
price varchar(255)
)
you will see output
Anyway, I will work on it and fix in next release
this works on version 1.3.0, I will close the issue