simple-ddl-parser icon indicating copy to clipboard operation
simple-ddl-parser copied to clipboard

Snowflake columns with autoincrement are not being parsed

Open ashumkoska opened this issue 3 years ago • 1 comments

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:

  1. Execute DDLParser(object_ddl).run() with object_ddl being the test query I have added above.
  2. 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 avatar Sep 12 '22 13:09 ashumkoska

@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

xnuinside avatar Sep 15 '22 16:09 xnuinside

this works on version 1.3.0, I will close the issue

xnuinside avatar May 14 '24 20:05 xnuinside