Skip to content

Place create table and table name in the same line #495

@Tasselmi

Description

@Tasselmi

Describe the Feature
hi bro.
for hive sql, can we put create table and table name in the same line? currently there is a new line after CREATE TABLE IF NOT EXISTS , so the table name will be in another line

Why do you want this feature?
to make the sql code more compact

currently there will be 2 layers of indent

CREATE TABLE IF NOT EXISTS
    `{dbPrefix}wms_mart`.`{tbPrefix}ods_wms_txn_log_details_ri` (
        `kfk_topic` STRING COMMENT 'kafka主题'
      , `kfk_partition` INT COMMENT 'kafka分区号'
      , `kfk_offset` BIGINT COMMENT 'kafka偏移量'
      , `kfk_timestamp` BIGINT COMMENT 'kafka时间戳'
      , `is_valid_msg` INT COMMENT 'message是不是合法的JSON字符串,0非法,1合法'
      , `full_message` STRING COMMENT 'kafka完整消息(当json不合法时,不丢失数据,完整保留在此字段中)'
    ) COMMENT 'wms三级账日志数据' PARTITIONED BY (
        tz_type STRING COMMENT 'local'
      , grass_region STRING COMMENT '国家或地区,根据cid/region_id字段而来,三级账分区都放在sg'
      , grass_date STRING COMMENT 'local日期,格式为yyyy-mm-dd 基于kafka接收时间解析而来'
      , grass_hour STRING COMMENT '00-23小时,前闭后开 基于kafka接收时间解析而来'
    )
ROW FORMAT
    SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
STORED AS
    TEXTFILE
;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions