clarkyu2016 / sql-beautify

VS Code extension that beautifies SQL(HQL).
MIT License
60 stars 21 forks source link

DDL中DECIMAL格式化出错 #16

Closed xubuild closed 3 years ago

xubuild commented 3 years ago

DDL中包含decimal时,格式化会出错:

CREATE TABLE IF NOT EXISTS tttt (
f1 DECIMAL(8, 2) COMMENT 'f1',
    f2 DECIMAL(8, 2) COMMENT 'f2'
) COMMENT 'asd' PARTITIONED BY (dt STRING COMMENT '日期分区字段,格式为datekey(yyyymmdd)') STORED AS ORC;

会变成:

CREATE TABLE IF NOT EXISTS tttt (
     f1 DECIMAL(8 COMMENT undefined
    ,f2 DECIMAL(8 COMMENT undefined
, 2) COMMENT 'f2'
) COMMENT 'asd' PARTITIONED BY (dt STRING COMMENT '日期分区字段,格式为datekey(yyyymmdd)') STORED AS ORC;
clarkyu2016 commented 3 years ago

因为之前工作环境hive建表字段类型比较统一,一般就用到double来表示或整型,所以没有考虑到demical,0.2.8会增加一些hive字段类型。

clarkyu2016 commented 3 years ago

0.2.8已经修复