xnuinside / simple-ddl-parser

Simple DDL Parser to parse SQL (HQL, TSQL, AWS Redshift, BigQuery, Snowflake and other dialects) ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc. & table properties, types, domains, etc.
MIT License
179 stars 40 forks source link

parsing create table with tokens separated by space cause empty output #194

Closed arnovkh closed 1 year ago

arnovkh commented 1 year ago

parsing following create table statement returns an empty array

CREATE TABLE TEST.CRM_JOB_PARAM ( COL1 VARCHAR(50) NOT NULL, COl2 VARCHAR(50), COL3 VARCHAR(50) DEFAULT '0', COL3 TIMESTAMP
) IN TABLESPACE1 INDEX IN TABLESPACE2

If INDEX IN is removed, parsing works fine. This issue applys to any 2/3 word tokens e.g. ORGANIZE BY ROW

xnuinside commented 1 year ago

@arnovkh thanks for reporting the issue. I had surgery and other a lot things to do, but I'm back. Already added support for your statements in next release. I will ping you when it will be available on pypi.

xnuinside commented 1 year ago

@arnovkh fix was released in version 0.30 https://pypi.org/project/simple-ddl-parser/ pls try, if will be anything more - feel free to open new issue. And thanks again!