fix: #290 hive lifecycle (#293)

This commit is contained in:
琉易 2024-04-19 17:19:36 +08:00 committed by GitHub
parent 1a0e2fa77b
commit 37974ca0cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 2410 additions and 2381 deletions

View File

@ -1634,16 +1634,16 @@ Rules for parsing createtable
*/ */
createTableStatement createTableStatement
: KW_CREATE temp=KW_TEMPORARY? trans=KW_TRANSACTIONAL? ext=KW_EXTERNAL? KW_TABLE ifNotExists? name=tableNameCreate ( : KW_CREATE temp=KW_TEMPORARY? trans=KW_TRANSACTIONAL? ext=KW_EXTERNAL? KW_TABLE ifNotExists? name=tableNameCreate (
likeTableOrFile createTablePartitionSpec? tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? likeTableOrFile createTablePartitionSpec? tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? tableLifecycle?
| (LPAREN columnNameTypeOrConstraintList RPAREN)? tableComment? tableLifecycle? createTablePartitionSpec? tableBuckets? tableSkewed? | (LPAREN columnNameTypeOrConstraintList RPAREN)? tableComment? createTablePartitionSpec? tableBuckets? tableSkewed? tableRowFormat?
tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? ( tableFileFormat? tableLocation? tablePropertiesPrefixed? tableLifecycle? (
KW_AS selectStatementWithCTE KW_AS selectStatementWithCTE
)? )?
) )
| KW_CREATE mgd=KW_MANAGED KW_TABLE ifNotExists? name=tableNameCreate ( | KW_CREATE mgd=KW_MANAGED KW_TABLE ifNotExists? name=tableNameCreate (
likeTableOrFile tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? likeTableOrFile tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? tableLifecycle?
| (LPAREN columnNameTypeOrConstraintList RPAREN)? tableComment? tableLifecycle? createTablePartitionSpec? tableBuckets? tableSkewed? | (LPAREN columnNameTypeOrConstraintList RPAREN)? tableComment? createTablePartitionSpec? tableBuckets? tableSkewed? tableRowFormat?
tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? ( tableFileFormat? tableLocation? tablePropertiesPrefixed? tableLifecycle? (
KW_AS selectStatementWithCTE KW_AS selectStatementWithCTE
)? )?
) )

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -112,9 +112,14 @@ CREATE TABLE IF NOT EXISTS t1 (
name STRING COMMENT '姓名', name STRING COMMENT '姓名',
age SMALLINT COMMENT '年龄' age SMALLINT COMMENT '年龄'
) COMMENT "t1表" lifecycle 29; ) COMMENT "t1表" lifecycle 29;
-- dtstack SparkSQL/HiveSQL lifecycle
CREATE MANAGED TABLE managed_table ( CREATE MANAGED TABLE managed_table (
id INT COMMENT 'ID', id INT COMMENT 'ID',
name STRING COMMENT '名称' name STRING COMMENT '名称'
) COMMENT '测试分桶' lifecycle 29 CLUSTERED BY(id) SORTED BY (id) INTO 4 BUCKETS STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'; ) COMMENT '测试分桶' CLUSTERED BY(id) SORTED BY (id) INTO 4 BUCKETS STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' lifecycle 29;
CREATE TABLE employee (
eid int,
name String,
salary String,
destination String)
STORED AS ORC
lifecycle 10;