Skip to content

Commit f739761

Browse files
committed
fix failed case
1 parent 219ac7a commit f739761

File tree

8 files changed

+15
-41
lines changed

8 files changed

+15
-41
lines changed

fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4

+3-3
Original file line numberDiff line numberDiff line change
@@ -506,19 +506,19 @@ partitionDef
506506
;
507507

508508
lessThanPartitionDef
509-
: PARTITION (ifNotExists=IF NOT EXISTS)? partitionName=identifier VALUES LESS THAN (MAXVALUE | constantSeq)
509+
: PARTITION (IF NOT EXISTS)? partitionName=identifier VALUES LESS THAN (MAXVALUE | constantSeq)
510510
;
511511

512512
fixedPartitionDef
513-
: PARTITION (ifNotExists=IF NOT EXISTS)? partitionName=identifier VALUES LEFT_BRACKET lower=constantSeq COMMA upper=constantSeq RIGHT_PAREN
513+
: PARTITION (IF NOT EXISTS)? partitionName=identifier VALUES LEFT_BRACKET lower=constantSeq COMMA upper=constantSeq RIGHT_PAREN
514514
;
515515

516516
stepPartitionDef
517517
: FROM from=constantSeq TO to=constantSeq INTERVAL unitsAmount=INTEGER_VALUE unit=datetimeUnit?
518518
;
519519

520520
inPartitionDef
521-
: PARTITION (ifNotExists=IF NOT EXISTS)? partitionName=identifier (VALUES IN ((LEFT_PAREN constantSeqs+=constantSeq
521+
: PARTITION (IF NOT EXISTS)? partitionName=identifier (VALUES IN ((LEFT_PAREN constantSeqs+=constantSeq
522522
(COMMA constantSeqs+=constantSeq)* RIGHT_PAREN) | constants=constantSeq))?
523523
;
524524

fe/fe-core/src/main/cup/sql_parser.cup

-26
Original file line numberDiff line numberDiff line change
@@ -1800,19 +1800,6 @@ create_stmt ::=
18001800
RESULT = new CreateTableStmt(ifNotExists, isExternal, name, columns, engineName, keys, partition,
18011801
distribution, tblProperties, extProperties, tableComment, index);
18021802
:}
1803-
| KW_CREATE opt_external:isExternal KW_TABLE opt_if_not_exists:ifNotExists table_name:name
1804-
LPAREN column_definition_list:columns COMMA RPAREN opt_engine:engineName
1805-
opt_keys:keys
1806-
opt_comment:tableComment
1807-
opt_partition:partition
1808-
opt_distribution:distribution
1809-
opt_rollup:index
1810-
opt_properties:tblProperties
1811-
opt_ext_properties:extProperties
1812-
{:
1813-
RESULT = new CreateTableStmt(ifNotExists, isExternal, name, columns, null, engineName, keys, partition,
1814-
distribution, tblProperties, extProperties, tableComment, index);
1815-
:}
18161803
| KW_CREATE opt_external:isExternal KW_TABLE opt_if_not_exists:ifNotExists table_name:name
18171804
LPAREN column_definition_list:columns COMMA index_definition_list:indexes RPAREN opt_engine:engineName
18181805
opt_keys:keys
@@ -1826,19 +1813,6 @@ create_stmt ::=
18261813
RESULT = new CreateTableStmt(ifNotExists, isExternal, name, columns, indexes, engineName, keys, partition,
18271814
distribution, tblProperties, extProperties, tableComment, index);
18281815
:}
1829-
| KW_CREATE opt_external:isExternal KW_TABLE opt_if_not_exists:ifNotExists table_name:name
1830-
LPAREN column_definition_list:columns COMMA index_definition_list:indexes COMMA RPAREN opt_engine:engineName
1831-
opt_keys:keys
1832-
opt_comment:tableComment
1833-
opt_partition:partition
1834-
opt_distribution:distribution
1835-
opt_rollup:index
1836-
opt_properties:tblProperties
1837-
opt_ext_properties:extProperties
1838-
{:
1839-
RESULT = new CreateTableStmt(ifNotExists, isExternal, name, columns, indexes, engineName, keys, partition,
1840-
distribution, tblProperties, extProperties, tableComment, index);
1841-
:}
18421816
| KW_CREATE opt_external:isExternal KW_TABLE opt_if_not_exists:ifNotExists table_name:name
18431817
opt_col_list:columns
18441818
opt_engine:engineName

fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -2455,9 +2455,9 @@ public PartitionDefinition visitLessThanPartitionDef(LessThanPartitionDefContext
24552455
String partitionName = ctx.partitionName.getText();
24562456
if (ctx.MAXVALUE() == null) {
24572457
List<Expression> lessThanValues = visitConstantSeq(ctx.constantSeq());
2458-
return new LessThanPartition(ctx.ifNotExists != null, partitionName, lessThanValues);
2458+
return new LessThanPartition(ctx.EXISTS() != null, partitionName, lessThanValues);
24592459
} else {
2460-
return new LessThanPartition(ctx.ifNotExists != null, partitionName,
2460+
return new LessThanPartition(ctx.EXISTS() != null, partitionName,
24612461
ImmutableList.of(MaxValue.INSTANCE));
24622462
}
24632463
}
@@ -2467,7 +2467,7 @@ public PartitionDefinition visitFixedPartitionDef(FixedPartitionDefContext ctx)
24672467
String partitionName = ctx.partitionName.getText();
24682468
List<Expression> lowerBounds = visitConstantSeq(ctx.lower);
24692469
List<Expression> upperBounds = visitConstantSeq(ctx.upper);
2470-
return new FixedRangePartition(ctx.ifNotExists != null, partitionName, lowerBounds, upperBounds);
2470+
return new FixedRangePartition(ctx.EXISTS() != null, partitionName, lowerBounds, upperBounds);
24712471
}
24722472

24732473
@Override
@@ -2488,7 +2488,7 @@ public PartitionDefinition visitInPartitionDef(InPartitionDefContext ctx) {
24882488
values = visitConstantSeq(ctx.constants).stream().map(ImmutableList::of)
24892489
.collect(Collectors.toList());
24902490
}
2491-
return new InPartition(ctx.ifNotExists != null, ctx.partitionName.getText(), values);
2491+
return new InPartition(ctx.EXISTS() != null, ctx.partitionName.getText(), values);
24922492
}
24932493

24942494
@Override

regression-test/suites/datatype_p0/date/test_date_key.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ suite("test_date_key") {
2020
sql """
2121
create table `test_date_key` (
2222
`k1` datev1, `k2` int,
23-
INDEX idx_k1 (`k1`) USING BITMAP,
23+
INDEX idx_k1 (`k1`) USING BITMAP
2424
) duplicate key(`k1`)
2525
distributed by hash(k2) buckets 3
2626
properties("replication_num" = "1");

regression-test/suites/datatype_p0/decimalv3/test_decimalv3_overflow.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ suite("test_decimalv3_overflow") {
3232
def tblName2 = "test_decimalv3_overflow2"
3333
sql "drop table if exists ${tblName2}"
3434
sql """ CREATE TABLE ${tblName2} (
35-
`c2` decimalv3(20, 2),
35+
`c2` decimalv3(20, 2)
3636
) ENGINE=OLAP
3737
UNIQUE KEY(`c2`)
3838
DISTRIBUTED BY HASH(`c2`) BUCKETS 10

regression-test/suites/datatype_p0/decimalv3/test_uniq_tab_decimalv2.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ suite("test_uniq_tab_decimalv2") {
2626
`decimal_key1` decimalv2(8, 5) NULL COMMENT "",
2727
`decimal_key2` decimalv2(16, 5) NULL COMMENT "",
2828
`decimal_value1` decimalv2(8, 5) NULL COMMENT "",
29-
`decimal_value2` decimalv2(16, 5) NULL COMMENT "",
29+
`decimal_value2` decimalv2(16, 5) NULL COMMENT ""
3030
) ENGINE=OLAP
3131
UNIQUE KEY(`decimal_key1`, `decimal_key2`)
3232
COMMENT "OLAP"

regression-test/suites/datatype_p0/nested_types/ddl/create_nestedtypes_with_unsupport_types.groovy

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ suite("create_nestedtypes_with_unsupport_types") {
2525
sql """
2626
CREATE TABLE IF NOT EXISTS ${testTablex} (
2727
`k1` INT(11) NULL,
28-
`k2` array<${columnType}> NULL,
28+
`k2` array<${columnType}> NULL
2929
)
3030
DUPLICATE KEY(`k1`)
3131
DISTRIBUTED BY HASH(`k1`) BUCKETS 1
@@ -48,7 +48,7 @@ suite("create_nestedtypes_with_unsupport_types") {
4848
sql """
4949
CREATE TABLE IF NOT EXISTS ${testTablex} (
5050
`k1` INT(11) NULL,
51-
`k2` map<${columnType}, String> NULL,
51+
`k2` map<${columnType}, String> NULL
5252
)
5353
DUPLICATE KEY(`k1`)
5454
DISTRIBUTED BY HASH(`k1`) BUCKETS 1
@@ -60,7 +60,7 @@ suite("create_nestedtypes_with_unsupport_types") {
6060
sql """
6161
CREATE TABLE IF NOT EXISTS ${testTablex} (
6262
`k1` INT(11) NULL,
63-
`k2` map<String, ${columnType}> NULL,
63+
`k2` map<String, ${columnType}> NULL
6464
)
6565
DUPLICATE KEY(`k1`)
6666
DISTRIBUTED BY HASH(`k1`) BUCKETS 1
@@ -84,7 +84,7 @@ suite("create_nestedtypes_with_unsupport_types") {
8484
sql """
8585
CREATE TABLE IF NOT EXISTS ${testTablex} (
8686
`k1` INT(11) NULL,
87-
`k2` STRUCT<f1:${columnType}> NULL,
87+
`k2` STRUCT<f1:${columnType}> NULL
8888
)
8989
DUPLICATE KEY(`k1`)
9090
DISTRIBUTED BY HASH(`k1`) BUCKETS 1

regression-test/suites/nereids_p0/sql_functions/datetime_functions/test_date_or_datetime_computation_negative.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ suite("test_date_or_datetime_computation_negative") {
2323
`dateV2` DATEV2 NOT NULL,
2424
`dateV2_null` DATEV2 NULL,
2525
`datetime` DATETIME NOT NULL,
26-
`datetime_null` DATETIME NULL, )
26+
`datetime_null` DATETIME NULL )
2727
DUPLICATE KEY(`row_id`)
2828
DISTRIBUTED BY HASH(`row_id`) BUCKETS 1
2929
PROPERTIES (

0 commit comments

Comments
 (0)