This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new bec551ed5fc Support parsing Doris ALTER TABLE ROLLUP syntax (#38176)
bec551ed5fc is described below
commit bec551ed5fc9f73403ab7212d7950c66a826cf80
Author: cxy <[email protected]>
AuthorDate: Tue Feb 24 19:10:12 2026 +0800
Support parsing Doris ALTER TABLE ROLLUP syntax (#38176)
---
.../src/main/antlr4/imports/doris/DDLStatement.g4 | 10 +
.../statement/type/DorisDDLStatementVisitor.java | 51 ++++-
.../ddl/rollup/AddRollupDefinitionSegment.java | 69 ++++++
.../ddl/rollup/DropRollupDefinitionSegment.java | 52 +++++
.../type/ddl/table/AlterTableStatement.java | 6 +
.../standard/type/AlterTableStatementAssert.java | 53 +++++
.../definition/ExpectedAddRollupDefinition.java | 50 +++++
.../definition/ExpectedDropRollupDefinition.java | 40 ++++
.../table/AlterTableStatementTestCase.java | 8 +
.../src/main/resources/case/ddl/alter-table.xml | 242 +++++++++++++++++++++
.../resources/sql/supported/ddl/alter-table.xml | 15 ++
11 files changed, 595 insertions(+), 1 deletion(-)
diff --git
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4
index fe78261d54b..25aadf18e90 100644
---
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4
+++
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4
@@ -125,9 +125,11 @@ createTableOptionsSpaceSeparated
alterListItem
: ADD COLUMN? (columnDefinition place? | LP_ tableElementList RP_) #
addColumn
| ADD tableConstraintDef # addTableConstraint
+ | ADD ROLLUP rollupItem (COMMA_ rollupItem)* # addRollup
| CHANGE COLUMN? columnInternalRef=identifier columnDefinition place? #
changeColumn
| MODIFY COLUMN? columnInternalRef=identifier fieldDefinition place? #
modifyColumn
| DROP (COLUMN? columnInternalRef=identifier restrict? | FOREIGN KEY
columnInternalRef=identifier | PRIMARY KEY | keyOrIndex indexName | CHECK
identifier | CONSTRAINT identifier) # alterTableDrop
+ | DROP ROLLUP rollupNameItem (COMMA_ rollupNameItem)* # dropRollup
| DISABLE KEYS # disableKeys
| ENABLE KEYS # enableKeys
| ALTER COLUMN? columnInternalRef=identifier (SET DEFAULT (LP_ expr RP_|
literals)| SET visibility | DROP DEFAULT) # alterColumn
@@ -149,6 +151,14 @@ alterOrderList
: columnRef direction? (COMMA_ columnRef direction?)*
;
+rollupItem
+ : rollupName=identifier LP_ columnNames RP_ (FROM
fromIndexName=indexName)? propertiesClause?
+ ;
+
+rollupNameItem
+ : rollupName=identifier propertiesClause?
+ ;
+
alterStoragePolicy
: ALTER STORAGE POLICY identifier propertiesClause
;
diff --git
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
index e6716e515fd..338bc45b769 100644
---
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
+++
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
@@ -123,6 +123,10 @@ import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.TableNa
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.TruncateTableContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ValidStatementContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.WhileStatementContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AddRollupContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DropRollupContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.RollupItemContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.RollupNameItemContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.RenameRollupContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.RenamePartitionContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ReplaceTableContext;
@@ -171,6 +175,8 @@ import
org.apache.shardingsphere.sql.parser.statement.core.segment.generic.Inter
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.policy.PolicyNameSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertiesSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertySegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup.AddRollupDefinitionSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup.DropRollupDefinitionSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup.RenameRollupDefinitionSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup.RollupSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.routine.FunctionNameSegment;
@@ -601,6 +607,10 @@ public final class DorisDDLStatementVisitor extends
DorisStatementVisitor implem
alterTableStatement.getRenameIndexDefinitions().add((RenameIndexDefinitionSegment)
alterDefinitionSegment);
} else if (alterDefinitionSegment instanceof RenameColumnSegment) {
alterTableStatement.getRenameColumnDefinitions().add((RenameColumnSegment)
alterDefinitionSegment);
+ } else if (alterDefinitionSegment instanceof
AddRollupDefinitionSegment) {
+
alterTableStatement.getAddRollupDefinitions().add((AddRollupDefinitionSegment)
alterDefinitionSegment);
+ } else if (alterDefinitionSegment instanceof
DropRollupDefinitionSegment) {
+
alterTableStatement.getDropRollupDefinitions().add((DropRollupDefinitionSegment)
alterDefinitionSegment);
} else if (alterDefinitionSegment instanceof
RenameRollupDefinitionSegment) {
alterTableStatement.getRenameRollupDefinitions().add((RenameRollupDefinitionSegment)
alterDefinitionSegment);
} else if (alterDefinitionSegment instanceof
RenamePartitionDefinitionSegment) {
@@ -657,7 +667,13 @@ public final class DorisDDLStatementVisitor extends
DorisStatementVisitor implem
private Collection<AlterDefinitionSegment>
getAlterDefinitionSegments(final AlterListContext ctx) {
Collection<AlterDefinitionSegment> result = new LinkedList<>();
for (AlterListItemContext each : ctx.alterListItem()) {
- getAlterDefinitionSegment(ctx, each).ifPresent(result::add);
+ if (each instanceof AddRollupContext) {
+ result.addAll(((CollectionValue<AddRollupDefinitionSegment>)
visit(each)).getValue());
+ } else if (each instanceof DropRollupContext) {
+ result.addAll(((CollectionValue<DropRollupDefinitionSegment>)
visit(each)).getValue());
+ } else {
+ getAlterDefinitionSegment(ctx, each).ifPresent(result::add);
+ }
}
return result;
}
@@ -1059,6 +1075,39 @@ public final class DorisDDLStatementVisitor extends
DorisStatementVisitor implem
return result;
}
+ @Override
+ public ASTNode visitAddRollup(final AddRollupContext ctx) {
+ CollectionValue<AddRollupDefinitionSegment> result = new
CollectionValue<>();
+ for (RollupItemContext each : ctx.rollupItem()) {
+ RollupSegment rollupSegment = new
RollupSegment(each.rollupName.getStart().getStartIndex(),
each.rollupName.getStop().getStopIndex(), (IdentifierValue)
visit(each.rollupName));
+ AddRollupDefinitionSegment addRollupDefinitionSegment = new
AddRollupDefinitionSegment(each.start.getStartIndex(),
each.stop.getStopIndex(), rollupSegment);
+ CollectionValue<ColumnSegment> columns =
(CollectionValue<ColumnSegment>) visit(each.columnNames());
+ addRollupDefinitionSegment.getColumns().addAll(columns.getValue());
+ if (null != each.fromIndexName) {
+ addRollupDefinitionSegment.setFromIndex((IndexSegment)
visit(each.fromIndexName));
+ }
+ if (null != each.propertiesClause()) {
+
addRollupDefinitionSegment.setProperties(extractPropertiesSegment(each.propertiesClause()));
+ }
+ result.getValue().add(addRollupDefinitionSegment);
+ }
+ return result;
+ }
+
+ @Override
+ public ASTNode visitDropRollup(final DropRollupContext ctx) {
+ CollectionValue<DropRollupDefinitionSegment> result = new
CollectionValue<>();
+ for (RollupNameItemContext each : ctx.rollupNameItem()) {
+ RollupSegment rollupSegment = new
RollupSegment(each.rollupName.getStart().getStartIndex(),
each.rollupName.getStop().getStopIndex(), (IdentifierValue)
visit(each.rollupName));
+ DropRollupDefinitionSegment dropRollupDefinitionSegment = new
DropRollupDefinitionSegment(each.start.getStartIndex(),
each.stop.getStopIndex(), rollupSegment);
+ if (null != each.propertiesClause()) {
+
dropRollupDefinitionSegment.setProperties(extractPropertiesSegment(each.propertiesClause()));
+ }
+ result.getValue().add(dropRollupDefinitionSegment);
+ }
+ return result;
+ }
+
@Override
public ASTNode visitRenameRollup(final RenameRollupContext ctx) {
RollupSegment oldRollupSegment = new
RollupSegment(ctx.oldRollupName.getStart().getStartIndex(),
ctx.oldRollupName.getStop().getStopIndex(),
diff --git
a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/ddl/rollup/AddRollupDefinitionSegment.java
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/ddl/rollup/AddRollupDefinitionSegment.java
new file mode 100644
index 00000000000..6e587be3488
--- /dev/null
+++
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/ddl/rollup/AddRollupDefinitionSegment.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.AlterDefinitionSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.index.IndexSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertiesSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.dml.column.ColumnSegment;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Optional;
+
+/**
+ * Add rollup definition segment.
+ */
+@RequiredArgsConstructor
+@Getter
+@Setter
+public final class AddRollupDefinitionSegment implements
AlterDefinitionSegment {
+
+ private final int startIndex;
+
+ private final int stopIndex;
+
+ private final RollupSegment rollupSegment;
+
+ private final Collection<ColumnSegment> columns = new LinkedList<>();
+
+ private IndexSegment fromIndex;
+
+ private PropertiesSegment properties;
+
+ /**
+ * Get from index.
+ *
+ * @return from index
+ */
+ public Optional<IndexSegment> getFromIndex() {
+ return Optional.ofNullable(fromIndex);
+ }
+
+ /**
+ * Get properties.
+ *
+ * @return properties
+ */
+ public Optional<PropertiesSegment> getProperties() {
+ return Optional.ofNullable(properties);
+ }
+}
diff --git
a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/ddl/rollup/DropRollupDefinitionSegment.java
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/ddl/rollup/DropRollupDefinitionSegment.java
new file mode 100644
index 00000000000..38131f0ea8d
--- /dev/null
+++
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/ddl/rollup/DropRollupDefinitionSegment.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.AlterDefinitionSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertiesSegment;
+
+import java.util.Optional;
+
+/**
+ * Drop rollup definition segment.
+ */
+@RequiredArgsConstructor
+@Getter
+@Setter
+public final class DropRollupDefinitionSegment implements
AlterDefinitionSegment {
+
+ private final int startIndex;
+
+ private final int stopIndex;
+
+ private final RollupSegment rollupSegment;
+
+ private PropertiesSegment properties;
+
+ /**
+ * Get properties.
+ *
+ * @return properties
+ */
+ public Optional<PropertiesSegment> getProperties() {
+ return Optional.ofNullable(properties);
+ }
+}
diff --git
a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/AlterTableStatement.java
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/AlterTableStatement.java
index 5c8ecfc3e83..941a87d8c81 100644
---
a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/AlterTableStatement.java
+++
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/AlterTableStatement.java
@@ -41,6 +41,8 @@ import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.partition
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.partition.ModifyPartitionDefinitionSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.partition.RenamePartitionDefinitionSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.primary.DropPrimaryKeyDefinitionSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup.AddRollupDefinitionSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup.DropRollupDefinitionSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup.RenameRollupDefinitionSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.table.AlgorithmTypeSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.table.ConvertTableDefinitionSegment;
@@ -106,6 +108,10 @@ public final class AlterTableStatement extends
DDLStatement {
private final Collection<ReplaceColumnDefinitionSegment>
replaceColumnDefinitions = new LinkedList<>();
+ private final Collection<AddRollupDefinitionSegment> addRollupDefinitions
= new LinkedList<>();
+
+ private final Collection<DropRollupDefinitionSegment>
dropRollupDefinitions = new LinkedList<>();
+
private final Collection<RenameRollupDefinitionSegment>
renameRollupDefinitions = new LinkedList<>();
private final Collection<RenamePartitionDefinitionSegment>
renamePartitionDefinitions = new LinkedList<>();
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/standard/type/AlterTableStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/standard/type/AlterTableStatementAssert.java
index eff989a26f7..5e9f3dbd2e0 100644
---
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/standard/type/AlterTableStatementAssert.java
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/standard/type/AlterTableStatementAssert.java
@@ -35,6 +35,8 @@ import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.partition
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.partition.ModifyPartitionDefinitionSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.partition.PartitionValuesSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.partition.RenamePartitionDefinitionSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup.AddRollupDefinitionSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup.DropRollupDefinitionSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.ExpressionSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.primary.DropPrimaryKeyDefinitionSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.rollup.RenameRollupDefinitionSegment;
@@ -54,6 +56,7 @@ import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.def
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.definition.ConstraintDefinitionAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.definition.IndexDefinitionAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.expression.ExpressionAssert;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.index.IndexAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.partition.PartitionAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.rollup.RollupAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.table.TableAssert;
@@ -67,6 +70,8 @@ import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.s
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedAddPartitionDefinition;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedModifyPartitionDefinition;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedRenamePartitionDefinition;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedAddRollupDefinition;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedDropRollupDefinition;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedRenameRollupDefinition;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.partition.ExpectedAddPartitions;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.distsql.ExpectedProperties;
@@ -111,6 +116,8 @@ public final class AlterTableStatementAssert {
assertDropColumns(assertContext, actual, expected);
assertRenameIndexDefinitions(assertContext, actual, expected);
assertRenameColumnDefinitions(assertContext, actual, expected);
+ assertAddRollupDefinitions(assertContext, actual, expected);
+ assertDropRollupDefinitions(assertContext, actual, expected);
assertRenameRollupDefinitions(assertContext, actual, expected);
assertRenamePartitionDefinitions(assertContext, actual, expected);
assertAddPartitionDefinitions(assertContext, actual, expected);
@@ -307,6 +314,52 @@ public final class AlterTableStatementAssert {
}
}
+ private static void assertAddRollupDefinitions(final SQLCaseAssertContext
assertContext, final AlterTableStatement actual, final
AlterTableStatementTestCase expected) {
+ assertThat(assertContext.getText("Add rollup definitions size
assertion error: "), actual.getAddRollupDefinitions().size(),
is(expected.getAddRollups().size()));
+ int count = 0;
+ for (AddRollupDefinitionSegment each :
actual.getAddRollupDefinitions()) {
+ ExpectedAddRollupDefinition expectedAddRollupDefinition =
expected.getAddRollups().get(count);
+ RollupAssert.assertIs(assertContext, each.getRollupSegment(),
expectedAddRollupDefinition.getRollup());
+ assertThat(assertContext.getText("Add rollup columns size
assertion error: "), each.getColumns().size(),
is(expectedAddRollupDefinition.getColumns().size()));
+ int columnCount = 0;
+ for (ColumnSegment columnSegment : each.getColumns()) {
+ ColumnAssert.assertIs(assertContext, columnSegment,
expectedAddRollupDefinition.getColumns().get(columnCount));
+ columnCount++;
+ }
+ if (null != expectedAddRollupDefinition.getFromIndex()) {
+ assertTrue(each.getFromIndex().isPresent(),
assertContext.getText("Add rollup from index should exist"));
+ IndexAssert.assertIs(assertContext, each.getFromIndex().get(),
expectedAddRollupDefinition.getFromIndex());
+ } else {
+ assertFalse(each.getFromIndex().isPresent(),
assertContext.getText("Add rollup from index should not exist"));
+ }
+ if (null != expectedAddRollupDefinition.getProperties()) {
+ assertTrue(each.getProperties().isPresent(),
assertContext.getText("Add rollup properties should exist"));
+ assertProperties(assertContext, each.getProperties().get(),
expectedAddRollupDefinition.getProperties());
+ } else {
+ assertFalse(each.getProperties().isPresent(),
assertContext.getText("Add rollup properties should not exist"));
+ }
+ SQLSegmentAssert.assertIs(assertContext, each,
expectedAddRollupDefinition);
+ count++;
+ }
+ }
+
+ private static void assertDropRollupDefinitions(final SQLCaseAssertContext
assertContext, final AlterTableStatement actual, final
AlterTableStatementTestCase expected) {
+ assertThat(assertContext.getText("Drop rollup definitions size
assertion error: "), actual.getDropRollupDefinitions().size(),
is(expected.getDropRollups().size()));
+ int count = 0;
+ for (DropRollupDefinitionSegment each :
actual.getDropRollupDefinitions()) {
+ ExpectedDropRollupDefinition expectedDropRollupDefinition =
expected.getDropRollups().get(count);
+ RollupAssert.assertIs(assertContext, each.getRollupSegment(),
expectedDropRollupDefinition.getRollup());
+ if (null != expectedDropRollupDefinition.getProperties()) {
+ assertTrue(each.getProperties().isPresent(),
assertContext.getText("Drop rollup properties should exist"));
+ assertProperties(assertContext, each.getProperties().get(),
expectedDropRollupDefinition.getProperties());
+ } else {
+ assertFalse(each.getProperties().isPresent(),
assertContext.getText("Drop rollup properties should not exist"));
+ }
+ SQLSegmentAssert.assertIs(assertContext, each,
expectedDropRollupDefinition);
+ count++;
+ }
+ }
+
private static void assertRenameRollupDefinitions(final
SQLCaseAssertContext assertContext, final AlterTableStatement actual, final
AlterTableStatementTestCase expected) {
assertThat(assertContext.getText("Rename rollup definitions size
assertion error: "), actual.getRenameRollupDefinitions().size(),
is(expected.getRenameRollups().size()));
int count = 0;
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/definition/ExpectedAddRollupDefinition.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/definition/ExpectedAddRollupDefinition.java
new file mode 100644
index 00000000000..8b9cda66e9d
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/definition/ExpectedAddRollupDefinition.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition;
+
+import lombok.Getter;
+import lombok.Setter;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.AbstractExpectedSQLSegment;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.column.ExpectedColumn;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.distsql.ExpectedProperties;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.index.ExpectedIndex;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.rollup.ExpectedRollup;
+
+import javax.xml.bind.annotation.XmlElement;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Expected add rollup definition.
+ */
+@Getter
+@Setter
+public final class ExpectedAddRollupDefinition extends
AbstractExpectedSQLSegment {
+
+ @XmlElement(name = "rollup")
+ private ExpectedRollup rollup;
+
+ @XmlElement(name = "column")
+ private final List<ExpectedColumn> columns = new LinkedList<>();
+
+ @XmlElement(name = "from-index")
+ private ExpectedIndex fromIndex;
+
+ @XmlElement(name = "properties")
+ private ExpectedProperties properties;
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/definition/ExpectedDropRollupDefinition.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/definition/ExpectedDropRollupDefinition.java
new file mode 100644
index 00000000000..e6ee486bb7a
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/definition/ExpectedDropRollupDefinition.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition;
+
+import lombok.Getter;
+import lombok.Setter;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.AbstractExpectedSQLSegment;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.distsql.ExpectedProperties;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.rollup.ExpectedRollup;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Expected drop rollup definition.
+ */
+@Getter
+@Setter
+public final class ExpectedDropRollupDefinition extends
AbstractExpectedSQLSegment {
+
+ @XmlElement(name = "rollup")
+ private ExpectedRollup rollup;
+
+ @XmlElement(name = "properties")
+ private ExpectedProperties properties;
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/standard/table/AlterTableStatementTestCase.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/standard/table/AlterTableStatementTestCase.java
index 3b2a51880bf..12f85ded7c6 100644
---
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/standard/table/AlterTableStatementTestCase.java
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/standard/table/AlterTableStatementTestCase.java
@@ -31,6 +31,8 @@ import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.s
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedRenameColumnDefinition;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedRenameIndexDefinition;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedRenamePartitionDefinition;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedAddRollupDefinition;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedDropRollupDefinition;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedRenameRollupDefinition;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedReplaceTableDefinition;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.definition.ExpectedAddPartitionDefinition;
@@ -82,6 +84,12 @@ public final class AlterTableStatementTestCase extends
SQLParserTestCase {
@XmlElement(name = "rename-column")
private final List<ExpectedRenameColumnDefinition> renameColumns = new
LinkedList<>();
+ @XmlElement(name = "add-rollup")
+ private final List<ExpectedAddRollupDefinition> addRollups = new
LinkedList<>();
+
+ @XmlElement(name = "drop-rollup")
+ private final List<ExpectedDropRollupDefinition> dropRollups = new
LinkedList<>();
+
@XmlElement(name = "rename-rollup")
private final List<ExpectedRenameRollupDefinition> renameRollups = new
LinkedList<>();
diff --git a/test/it/parser/src/main/resources/case/ddl/alter-table.xml
b/test/it/parser/src/main/resources/case/ddl/alter-table.xml
index e4fa7575109..0a5e7133e00 100644
--- a/test/it/parser/src/main/resources/case/ddl/alter-table.xml
+++ b/test/it/parser/src/main/resources/case/ddl/alter-table.xml
@@ -2571,6 +2571,248 @@
</rename-column>
</alter-table>
+ <alter-table sql-case-id="alter_table_add_rollup_simple">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <add-rollup start-index="43" stop-index="78">
+ <rollup name="example_rollup_index" start-index="43"
stop-index="62" />
+ <column name="k1" start-index="64" stop-index="65" />
+ <column name="k3" start-index="68" stop-index="69" />
+ <column name="v1" start-index="72" stop-index="73" />
+ <column name="v2" start-index="76" stop-index="77" />
+ </add-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_add_rollup_from_index">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <add-rollup start-index="43" stop-index="98">
+ <rollup name="example_rollup_index2" start-index="43"
stop-index="63" />
+ <column name="k1" start-index="66" stop-index="67" />
+ <column name="v1" start-index="70" stop-index="71" />
+ <from-index name="example_rollup_index" start-index="79"
stop-index="98" />
+ </add-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_add_rollup_with_properties">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <add-rollup start-index="43" stop-index="127">
+ <rollup name="example_rollup_index" start-index="43"
stop-index="62" />
+ <column name="k1" start-index="64" stop-index="65" />
+ <column name="k3" start-index="68" stop-index="69" />
+ <column name="v1" start-index="72" stop-index="73" />
+ <properties start-index="76" stop-index="127">
+ <property key="timeout" value="3600" start-index="87"
stop-index="104" />
+ <property key="in_memory" value="true" start-index="107"
stop-index="126" />
+ </properties>
+ </add-rollup>
+ </alter-table>
+
+ <alter-table
sql-case-id="alter_table_add_rollup_from_index_with_properties">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <add-rollup start-index="43" stop-index="158">
+ <rollup name="example_rollup_index3" start-index="43"
stop-index="63" />
+ <column name="k1" start-index="66" stop-index="67" />
+ <column name="k2" start-index="70" stop-index="71" />
+ <column name="v1" start-index="74" stop-index="75" />
+ <from-index name="example_rollup_index" start-index="83"
stop-index="102" />
+ <properties start-index="104" stop-index="158">
+ <property key="timeout" value="1200" start-index="115"
stop-index="132" />
+ <property key="replication_num" value="3" start-index="135"
stop-index="157" />
+ </properties>
+ </add-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_add_rollup_batch_simple">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <add-rollup start-index="43" stop-index="63">
+ <rollup name="rollup_index1" start-index="43" stop-index="55" />
+ <column name="k1" start-index="57" stop-index="58" />
+ <column name="k2" start-index="61" stop-index="62" />
+ </add-rollup>
+ <add-rollup start-index="66" stop-index="86">
+ <rollup name="rollup_index2" start-index="66" stop-index="78" />
+ <column name="k1" start-index="80" stop-index="81" />
+ <column name="k3" start-index="84" stop-index="85" />
+ </add-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_add_rollup_batch_from">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <add-rollup start-index="43" stop-index="79">
+ <rollup name="rollup_index1" start-index="43" stop-index="55" />
+ <column name="k1" start-index="57" stop-index="58" />
+ <column name="v1" start-index="61" stop-index="62" />
+ <from-index name="base_index" start-index="70" stop-index="79" />
+ </add-rollup>
+ <add-rollup start-index="82" stop-index="118">
+ <rollup name="rollup_index2" start-index="82" stop-index="94" />
+ <column name="k2" start-index="96" stop-index="97" />
+ <column name="v2" start-index="100" stop-index="101" />
+ <from-index name="base_index" start-index="109" stop-index="118" />
+ </add-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_add_rollup_batch_properties">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <add-rollup start-index="43" stop-index="93">
+ <rollup name="rollup_index1" start-index="43" stop-index="55" />
+ <column name="k1" start-index="57" stop-index="58" />
+ <column name="k2" start-index="61" stop-index="62" />
+ <properties start-index="65" stop-index="93">
+ <property key="timeout" value="600" start-index="76"
stop-index="92" />
+ </properties>
+ </add-rollup>
+ <add-rollup start-index="96" stop-index="146">
+ <rollup name="rollup_index2" start-index="96" stop-index="108" />
+ <column name="k1" start-index="110" stop-index="111" />
+ <column name="k3" start-index="114" stop-index="115" />
+ <properties start-index="118" stop-index="146">
+ <property key="timeout" value="900" start-index="129"
stop-index="145" />
+ </properties>
+ </add-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_add_rollup_batch_all">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <add-rollup start-index="43" stop-index="109">
+ <rollup name="rollup_index1" start-index="43" stop-index="55" />
+ <column name="k1" start-index="57" stop-index="58" />
+ <column name="v1" start-index="61" stop-index="62" />
+ <from-index name="base_index" start-index="70" stop-index="79" />
+ <properties start-index="81" stop-index="109">
+ <property key="timeout" value="800" start-index="92"
stop-index="108" />
+ </properties>
+ </add-rollup>
+ <add-rollup start-index="112" stop-index="179">
+ <rollup name="rollup_index2" start-index="112" stop-index="124" />
+ <column name="k2" start-index="126" stop-index="127" />
+ <column name="v2" start-index="130" stop-index="131" />
+ <from-index name="base_index" start-index="139" stop-index="148" />
+ <properties start-index="150" stop-index="179">
+ <property key="timeout" value="1000" start-index="161"
stop-index="178" />
+ </properties>
+ </add-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_add_rollup_batch_mixed_from">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <add-rollup start-index="43" stop-index="79">
+ <rollup name="rollup_index1" start-index="43" stop-index="55" />
+ <column name="k1" start-index="57" stop-index="58" />
+ <column name="v1" start-index="61" stop-index="62" />
+ <from-index name="base_index" start-index="70" stop-index="79" />
+ </add-rollup>
+ <add-rollup start-index="82" stop-index="102">
+ <rollup name="rollup_index2" start-index="82" stop-index="94" />
+ <column name="k2" start-index="96" stop-index="97" />
+ <column name="v2" start-index="100" stop-index="101" />
+ </add-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_add_rollup_batch_mixed_properties">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <add-rollup start-index="43" stop-index="93">
+ <rollup name="rollup_index1" start-index="43" stop-index="55" />
+ <column name="k1" start-index="57" stop-index="58" />
+ <column name="k2" start-index="61" stop-index="62" />
+ <properties start-index="65" stop-index="93">
+ <property key="timeout" value="500" start-index="76"
stop-index="92" />
+ </properties>
+ </add-rollup>
+ <add-rollup start-index="96" stop-index="116">
+ <rollup name="rollup_index2" start-index="96" stop-index="108" />
+ <column name="k1" start-index="110" stop-index="111" />
+ <column name="k3" start-index="114" stop-index="115" />
+ </add-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_drop_rollup_simple">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <drop-rollup start-index="44" stop-index="64">
+ <rollup name="example_rollup_index2" start-index="44"
stop-index="64" />
+ </drop-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_drop_rollup_batch">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <drop-rollup start-index="44" stop-index="64">
+ <rollup name="example_rollup_index2" start-index="44"
stop-index="64" />
+ </drop-rollup>
+ <drop-rollup start-index="66" stop-index="86">
+ <rollup name="example_rollup_index3" start-index="66"
stop-index="86" />
+ </drop-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_drop_rollup_with_properties">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <drop-rollup start-index="44" stop-index="113">
+ <rollup name="example_rollup_index" start-index="44"
stop-index="63" />
+ <properties start-index="65" stop-index="113">
+ <property key="timeout" value="1800" start-index="76"
stop-index="93" />
+ <property key="force" value="false" start-index="96"
stop-index="112" />
+ </properties>
+ </drop-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_drop_rollup_batch_properties">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <drop-rollup start-index="44" stop-index="86">
+ <rollup name="rollup_index1" start-index="44" stop-index="56" />
+ <properties start-index="58" stop-index="86">
+ <property key="timeout" value="600" start-index="69"
stop-index="85" />
+ </properties>
+ </drop-rollup>
+ <drop-rollup start-index="89" stop-index="149">
+ <rollup name="rollup_index2" start-index="89" stop-index="101" />
+ <properties start-index="103" stop-index="149">
+ <property key="timeout" value="900" start-index="114"
stop-index="130" />
+ <property key="force" value="true" start-index="133"
stop-index="148" />
+ </properties>
+ </drop-rollup>
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_drop_rollup_batch_mixed">
+ <table name="my_table" start-index="12" stop-index="30">
+ <owner name="example_db" start-index="12" stop-index="21" />
+ </table>
+ <drop-rollup start-index="44" stop-index="87">
+ <rollup name="rollup_index1" start-index="44" stop-index="56" />
+ <properties start-index="58" stop-index="87">
+ <property key="timeout" value="1200" start-index="69"
stop-index="86" />
+ </properties>
+ </drop-rollup>
+ <drop-rollup start-index="90" stop-index="102">
+ <rollup name="rollup_index2" start-index="90" stop-index="102" />
+ </drop-rollup>
+ </alter-table>
+
<alter-table sql-case-id="alter_table_rename_rollup">
<table name="example_table" start-index="12" stop-index="24" />
<rename-rollup start-index="26" stop-index="54">
diff --git
a/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml
b/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml
index 1ff33c46d4b..91f2eddb9e3 100644
--- a/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml
@@ -378,6 +378,21 @@
<sql-case id="alter_table_rename_table_doris" value="ALTER TABLE table1
RENAME table2" db-types="Doris" />
<sql-case id="alter_table_without_actions_doris" value="ALTER TABLE
t_order" db-types="Doris" />
<sql-case id="alter_table_rename_column_doris" value="ALTER TABLE
example_table RENAME COLUMN c1 c2" db-types="Doris" />
+ <sql-case id="alter_table_add_rollup_simple" value="ALTER TABLE
example_db.my_table ADD ROLLUP example_rollup_index(k1, k3, v1, v2)"
db-types="Doris" />
+ <sql-case id="alter_table_add_rollup_from_index" value="ALTER TABLE
example_db.my_table ADD ROLLUP example_rollup_index2 (k1, v1) FROM
example_rollup_index" db-types="Doris" />
+ <sql-case id="alter_table_add_rollup_with_properties" value="ALTER TABLE
example_db.my_table ADD ROLLUP example_rollup_index(k1, k3, v1)
PROPERTIES("timeout" = "3600", "in_memory" =
"true")" db-types="Doris" />
+ <sql-case id="alter_table_add_rollup_from_index_with_properties"
value="ALTER TABLE example_db.my_table ADD ROLLUP example_rollup_index3 (k1,
k2, v1) FROM example_rollup_index PROPERTIES("timeout" =
"1200", "replication_num" = "3")"
db-types="Doris" />
+ <sql-case id="alter_table_add_rollup_batch_simple" value="ALTER TABLE
example_db.my_table ADD ROLLUP rollup_index1(k1, k2), rollup_index2(k1, k3)"
db-types="Doris" />
+ <sql-case id="alter_table_add_rollup_batch_from" value="ALTER TABLE
example_db.my_table ADD ROLLUP rollup_index1(k1, v1) FROM base_index,
rollup_index2(k2, v2) FROM base_index" db-types="Doris" />
+ <sql-case id="alter_table_add_rollup_batch_properties" value="ALTER TABLE
example_db.my_table ADD ROLLUP rollup_index1(k1, k2)
PROPERTIES("timeout" = "600"), rollup_index2(k1, k3)
PROPERTIES("timeout" = "900")" db-types="Doris" />
+ <sql-case id="alter_table_add_rollup_batch_all" value="ALTER TABLE
example_db.my_table ADD ROLLUP rollup_index1(k1, v1) FROM base_index
PROPERTIES("timeout" = "800"), rollup_index2(k2, v2) FROM
base_index PROPERTIES("timeout" = "1000")" db-types="Doris"
/>
+ <sql-case id="alter_table_add_rollup_batch_mixed_from" value="ALTER TABLE
example_db.my_table ADD ROLLUP rollup_index1(k1, v1) FROM base_index,
rollup_index2(k2, v2)" db-types="Doris" />
+ <sql-case id="alter_table_add_rollup_batch_mixed_properties" value="ALTER
TABLE example_db.my_table ADD ROLLUP rollup_index1(k1, k2)
PROPERTIES("timeout" = "500"), rollup_index2(k1, k3)"
db-types="Doris" />
+ <sql-case id="alter_table_drop_rollup_simple" value="ALTER TABLE
example_db.my_table DROP ROLLUP example_rollup_index2" db-types="Doris" />
+ <sql-case id="alter_table_drop_rollup_batch" value="ALTER TABLE
example_db.my_table DROP ROLLUP example_rollup_index2,example_rollup_index3"
db-types="Doris" />
+ <sql-case id="alter_table_drop_rollup_with_properties" value="ALTER TABLE
example_db.my_table DROP ROLLUP example_rollup_index
PROPERTIES("timeout" = "1800", "force" =
"false")" db-types="Doris" />
+ <sql-case id="alter_table_drop_rollup_batch_properties" value="ALTER TABLE
example_db.my_table DROP ROLLUP rollup_index1 PROPERTIES("timeout" =
"600"), rollup_index2 PROPERTIES("timeout" =
"900", "force" = "true")" db-types="Doris" />
+ <sql-case id="alter_table_drop_rollup_batch_mixed" value="ALTER TABLE
example_db.my_table DROP ROLLUP rollup_index1 PROPERTIES("timeout" =
"1200"), rollup_index2" db-types="Doris" />
<sql-case id="alter_table_rename_rollup" value="ALTER TABLE example_table
RENAME ROLLUP rollup1 rollup2" db-types="Doris" />
<sql-case id="alter_table_rename_partition" value="ALTER TABLE
example_table RENAME PARTITION partition1 partition2" db-types="Doris" />
<sql-case id="alter_table_with_algorithm_lock_doris" value="ALTER TABLE
t_order ADD COLUMN col_alg INT, ALGORITHM=INSTANT, LOCK=NONE" db-types="Doris"
/>