[feature](fe)support last column or index definition end with comma in create table statement (#29167)
allow the column list end with COMMA in create table statement. This is a issue rooted from history. So nereids has to keep the same behavior as old planner. CREATE TABLE t ( k1 int, )
This commit is contained in:
@ -41,7 +41,7 @@ statement
|
||||
TO (user=userIdentify | ROLE roleName=identifier)
|
||||
USING LEFT_PAREN booleanExpression RIGHT_PAREN #createRowPolicy
|
||||
| CREATE (EXTERNAL)? TABLE (IF NOT EXISTS)? name=multipartIdentifier
|
||||
((ctasCols=identifierList)? | (LEFT_PAREN columnDefs (COMMA indexDefs)? RIGHT_PAREN))
|
||||
((ctasCols=identifierList)? | (LEFT_PAREN columnDefs (COMMA indexDefs)? COMMA? RIGHT_PAREN))
|
||||
(ENGINE EQ engine=identifier)?
|
||||
((AGGREGATE | UNIQUE | DUPLICATE) KEY keys=identifierList (CLUSTER BY clusterKeys=identifierList)?)?
|
||||
(COMMENT STRING_LITERAL)?
|
||||
|
||||
@ -1800,6 +1800,19 @@ create_stmt ::=
|
||||
RESULT = new CreateTableStmt(ifNotExists, isExternal, name, columns, engineName, keys, partition,
|
||||
distribution, tblProperties, extProperties, tableComment, index);
|
||||
:}
|
||||
| KW_CREATE opt_external:isExternal KW_TABLE opt_if_not_exists:ifNotExists table_name:name
|
||||
LPAREN column_definition_list:columns COMMA RPAREN opt_engine:engineName
|
||||
opt_keys:keys
|
||||
opt_comment:tableComment
|
||||
opt_partition:partition
|
||||
opt_distribution:distribution
|
||||
opt_rollup:index
|
||||
opt_properties:tblProperties
|
||||
opt_ext_properties:extProperties
|
||||
{:
|
||||
RESULT = new CreateTableStmt(ifNotExists, isExternal, name, columns, null, engineName, keys, partition,
|
||||
distribution, tblProperties, extProperties, tableComment, index);
|
||||
:}
|
||||
| KW_CREATE opt_external:isExternal KW_TABLE opt_if_not_exists:ifNotExists table_name:name
|
||||
LPAREN column_definition_list:columns COMMA index_definition_list:indexes RPAREN opt_engine:engineName
|
||||
opt_keys:keys
|
||||
@ -1813,6 +1826,19 @@ create_stmt ::=
|
||||
RESULT = new CreateTableStmt(ifNotExists, isExternal, name, columns, indexes, engineName, keys, partition,
|
||||
distribution, tblProperties, extProperties, tableComment, index);
|
||||
:}
|
||||
| KW_CREATE opt_external:isExternal KW_TABLE opt_if_not_exists:ifNotExists table_name:name
|
||||
LPAREN column_definition_list:columns COMMA index_definition_list:indexes COMMA RPAREN opt_engine:engineName
|
||||
opt_keys:keys
|
||||
opt_comment:tableComment
|
||||
opt_partition:partition
|
||||
opt_distribution:distribution
|
||||
opt_rollup:index
|
||||
opt_properties:tblProperties
|
||||
opt_ext_properties:extProperties
|
||||
{:
|
||||
RESULT = new CreateTableStmt(ifNotExists, isExternal, name, columns, indexes, engineName, keys, partition,
|
||||
distribution, tblProperties, extProperties, tableComment, index);
|
||||
:}
|
||||
| KW_CREATE opt_external:isExternal KW_TABLE opt_if_not_exists:ifNotExists table_name:name
|
||||
opt_col_list:columns
|
||||
opt_engine:engineName
|
||||
|
||||
Reference in New Issue
Block a user