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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When DDL has TBLPROPERTIES, result is empty

kukigai opened this issue · comments

Describe the bug
When DDL has TBLPROPERTIES, result is empty

To Reproduce
ddl = """
CREATE EXTERNAL TABLE test (
job_id STRING COMMENT 'test'
)
STORED AS PARQUET LOCATION 'hdfs://test'
TBLPROPERTIES (
'parquet.compression'='SNAPPY')
"""
from simple_ddl_parser import DDLParser
parse_results = DDLParser(ddl).run(output_mode="hql")

Expected behavior
non empty result

@kukigai thanks for DDL sample, support for TBLPROPERTIES was not added yet, I will add

another example

ddl = """
CREATE EXTERNAL TABLE test (
test STRING NULL COMMENT 'xxxx',
)
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
'hdfs://xxxx'
"""
from simple_ddl_parser import DDLParser
parse_results = DDLParser(ddl).run(output_mode="hql")