This is an automated email from the ASF dual-hosted git repository.
terrymanu 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 dace9b24926 Support parsing Doris CREATE TABLE AS SELECT with key
clause and ADMIN REBALANCE DISK (#39510)
dace9b24926 is described below
commit dace9b249265ba1d004e806ea38724be95754e55
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Aug 19 10:03:01 2026 +0800
Support parsing Doris CREATE TABLE AS SELECT with key clause and ADMIN
REBALANCE DISK (#39510)
---
.../core/database/visitor/SQLVisitorRule.java | 2 +
.../src/main/antlr4/imports/doris/DALStatement.g4 | 4 ++
.../src/main/antlr4/imports/doris/DDLStatement.g4 | 4 +-
.../src/main/antlr4/imports/doris/DorisKeyword.g4 | 4 ++
.../sql/parser/autogen/DorisStatement.g4 | 1 +
.../statement/type/DorisDALStatementVisitor.java | 11 +++++
.../dal/DorisAdminRebalanceDiskStatement.java | 38 ++++++++++++++++
.../dal/dialect/doris/DorisDALStatementAssert.java | 5 +++
.../DorisAdminRebalanceDiskStatementAssert.java | 52 ++++++++++++++++++++++
.../cases/parser/jaxb/RootSQLParserTestCases.java | 4 ++
.../DorisAdminRebalanceDiskStatementTestCase.java | 40 +++++++++++++++++
.../resources/case/dal/admin-rebalance-disk.xml | 30 +++++++++++++
.../src/main/resources/case/ddl/create-table.xml | 42 +++++++++++++++++
.../sql/supported/dal/admin-rebalance-disk.xml | 23 ++++++++++
.../resources/sql/supported/ddl/create-table.xml | 2 +
15 files changed, 260 insertions(+), 2 deletions(-)
diff --git
a/parser/sql/engine/core/src/main/java/org/apache/shardingsphere/sql/parser/engine/core/database/visitor/SQLVisitorRule.java
b/parser/sql/engine/core/src/main/java/org/apache/shardingsphere/sql/parser/engine/core/database/visitor/SQLVisitorRule.java
index e4f7b06f112..0e27a4ebd25 100644
---
a/parser/sql/engine/core/src/main/java/org/apache/shardingsphere/sql/parser/engine/core/database/visitor/SQLVisitorRule.java
+++
b/parser/sql/engine/core/src/main/java/org/apache/shardingsphere/sql/parser/engine/core/database/visitor/SQLVisitorRule.java
@@ -601,6 +601,8 @@ public enum SQLVisitorRule {
ADMIN_CLEAN_TRASH("AdminCleanTrash", SQLStatementType.DAL),
+ ADMIN_REBALANCE_DISK("AdminRebalanceDisk", SQLStatementType.DAL),
+
CLEAN_ALL_PROFILE("CleanAllProfile", SQLStatementType.DAL),
PLAN_REPLAYER_PLAY("PlanReplayerPlay", SQLStatementType.DAL),
diff --git
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DALStatement.g4
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DALStatement.g4
index 6f9b0f456d8..210965aa67c 100644
---
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DALStatement.g4
+++
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DALStatement.g4
@@ -475,6 +475,10 @@ adminCopyTablet
: ADMIN COPY TABLET NUMBER_ propertiesClause?
;
+adminRebalanceDisk
+ : ADMIN REBALANCE DISK (ON LP_ string_ (COMMA_ string_)* RP_)?
+ ;
+
createSqlBlockRule
: CREATE SQL_BLOCK_RULE ruleName propertiesClause
;
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 66854df3f3d..ec521a74c48 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
@@ -36,13 +36,13 @@ alterStatement
createTable
// DORIS CHANGED BEGIN
- : CREATE TEMPORARY? TABLE ifNotExists? tableName (createDefinitionClause?
createTableOptions? partitionClause? duplicateAsQueryExpression?
startTransaction? duplicatekeyClause? commentClause? distributedbyClause?
propertiesClause? | createLikeClause)
+ : CREATE TEMPORARY? TABLE ifNotExists? tableName (createDefinitionClause?
createTableOptions? duplicatekeyClause? commentClause? partitionClause?
distributedbyClause? propertiesClause? duplicateAsQueryExpression?
startTransaction? | createLikeClause)
// DORIS CHANGED END
;
// DORIS ADDED BEGIN
duplicatekeyClause
- : DUPLICATE KEY (LP_ columnName RP_)
+ : (DUPLICATE | UNIQUE | AGGREGATE) KEY LP_ columnNames RP_
;
commentClause
diff --git
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4
index 58fffebae27..4c09e8f9f0a 100644
---
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4
+++
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4
@@ -2194,6 +2194,10 @@ REAL
: R E A L
;
+REBALANCE
+ : R E B A L A N C E
+ ;
+
REBUILD
: R E B U I L D
;
diff --git
a/parser/sql/engine/dialect/doris/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/DorisStatement.g4
b/parser/sql/engine/dialect/doris/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/DorisStatement.g4
index f43ce966bd8..b2228539f4e 100644
---
a/parser/sql/engine/dialect/doris/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/DorisStatement.g4
+++
b/parser/sql/engine/dialect/doris/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/DorisStatement.g4
@@ -153,6 +153,7 @@ execute
| adminSetReplicaVersion
| adminCopyTablet
| adminCleanTrash
+ | adminRebalanceDisk
| createSqlBlockRule
| alterSqlBlockRule
| dropSqlBlockRule
diff --git
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDALStatementVisitor.java
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDALStatementVisitor.java
index 55e968d0c19..41192635f9f 100644
---
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDALStatementVisitor.java
+++
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDALStatementVisitor.java
@@ -145,6 +145,7 @@ import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PluginP
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PluginPropertyKeyContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PluginPropertyValueContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminCleanTrashContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminRebalanceDiskContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CleanAllProfileContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PlanReplayerPlayContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DorisAlterSystemContext;
@@ -241,6 +242,7 @@ import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisPlanReplaye
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetReplicaStatusStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetReplicaVersionStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCopyTabletStatement;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminRebalanceDiskStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterResourceStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterSystemStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisBackupStatement;
@@ -1275,6 +1277,15 @@ public final class DorisDALStatementVisitor extends
DorisStatementVisitor implem
return result;
}
+ @Override
+ public ASTNode visitAdminRebalanceDisk(final AdminRebalanceDiskContext
ctx) {
+ DorisAdminRebalanceDiskStatement result = new
DorisAdminRebalanceDiskStatement(getDatabaseType());
+ if (null != ctx.string_()) {
+ ctx.string_().forEach(each ->
result.getBackends().add(SQLUtils.getExactlyValue(each.getText())));
+ }
+ return result;
+ }
+
@Override
public ASTNode visitCleanAllProfile(final CleanAllProfileContext ctx) {
return new DorisCleanAllProfileStatement(getDatabaseType());
diff --git
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminRebalanceDiskStatement.java
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminRebalanceDiskStatement.java
new file mode 100644
index 00000000000..3e49323e1b0
--- /dev/null
+++
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminRebalanceDiskStatement.java
@@ -0,0 +1,38 @@
+/*
+ * 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.doris.dal;
+
+import lombok.Getter;
+import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+/**
+ * Admin rebalance disk statement for Doris.
+ */
+@Getter
+public final class DorisAdminRebalanceDiskStatement extends DALStatement {
+
+ private final Collection<String> backends = new LinkedList<>();
+
+ public DorisAdminRebalanceDiskStatement(final DatabaseType databaseType) {
+ super(databaseType);
+ }
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/DorisDALStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/DorisDALStatementAssert.java
index 95582301a26..a4c2b27a0ce 100644
---
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/DorisDALStatementAssert.java
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/DorisDALStatementAssert.java
@@ -22,6 +22,7 @@ import lombok.NoArgsConstructor;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.UnsetVariableStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCleanTrashStatement;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminRebalanceDiskStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCleanAllProfileStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisPlanReplayerPlayStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCopyTabletStatement;
@@ -56,6 +57,7 @@ import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisSwitchState
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.show.DorisShowQueryStatsStatement;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAdminCleanTrashStatementAssert;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAdminRebalanceDiskStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisCleanAllProfileStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisPlanReplayerPlayStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAdminCopyTabletStatementAssert;
@@ -91,6 +93,7 @@ import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.d
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisUnsetVariableStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.SQLParserTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminCleanTrashStatementTestCase;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminRebalanceDiskStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCleanAllProfileStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisPlanReplayerPlayStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminCopyTabletStatementTestCase;
@@ -185,6 +188,8 @@ public final class DorisDALStatementAssert {
DorisShowEncryptKeysStatementAssert.assertIs(assertContext,
(DorisShowEncryptKeysStatement) actual, (DorisShowEncryptKeysStatementTestCase)
expected);
} else if (actual instanceof DorisAdminCleanTrashStatement) {
DorisAdminCleanTrashStatementAssert.assertIs(assertContext,
(DorisAdminCleanTrashStatement) actual, (DorisAdminCleanTrashStatementTestCase)
expected);
+ } else if (actual instanceof DorisAdminRebalanceDiskStatement) {
+ DorisAdminRebalanceDiskStatementAssert.assertIs(assertContext,
(DorisAdminRebalanceDiskStatement) actual,
(DorisAdminRebalanceDiskStatementTestCase) expected);
} else if (actual instanceof DorisShowTrashStatement) {
DorisShowTrashStatementAssert.assertIs(assertContext,
(DorisShowTrashStatement) actual, (DorisShowTrashStatementTestCase) expected);
} else if (actual instanceof DorisShowLoadStatement) {
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminRebalanceDiskStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminRebalanceDiskStatementAssert.java
new file mode 100644
index 00000000000..af1c08c34eb
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminRebalanceDiskStatementAssert.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.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminRebalanceDiskStatement;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminRebalanceDiskStatementTestCase;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+/**
+ * Admin rebalance disk statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisAdminRebalanceDiskStatementAssert {
+
+ /**
+ * Assert admin rebalance disk statement is correct with expected parser
result.
+ *
+ * @param assertContext assert context
+ * @param actual actual admin rebalance disk statement
+ * @param expected expected admin rebalance disk statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext,
final DorisAdminRebalanceDiskStatement actual, final
DorisAdminRebalanceDiskStatementTestCase expected) {
+ List<String> actualBackends = new ArrayList<>(actual.getBackends());
+ assertThat(assertContext.getText("backends size does not match: "),
actualBackends.size(), is(expected.getBackends().size()));
+ for (int i = 0; i < actualBackends.size(); i++) {
+ assertThat(assertContext.getText("backend does not match: "),
actualBackends.get(i), is(expected.getBackends().get(i)));
+ }
+ }
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
index 9fc5ec1497f..10348bb3a5c 100644
---
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
@@ -25,6 +25,7 @@ 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.statement.dal.ShowAlterTableStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.ShowBuildIndexStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminCleanTrashStatementTestCase;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminRebalanceDiskStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminCopyTabletStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminSetReplicaStatusStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminSetReplicaVersionStatementTestCase;
@@ -810,6 +811,9 @@ public final class RootSQLParserTestCases {
@XmlElement(name = "admin-clean-trash")
private final List<DorisAdminCleanTrashStatementTestCase>
adminCleanTrashTestCases = new LinkedList<>();
+ @XmlElement(name = "admin-rebalance-disk")
+ private final List<DorisAdminRebalanceDiskStatementTestCase>
adminRebalanceDiskTestCases = new LinkedList<>();
+
@XmlElement(name = "clean-all-profile")
private final List<DorisCleanAllProfileStatementTestCase>
cleanAllProfileTestCases = new LinkedList<>();
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisAdminRebalanceDiskStatementTestCase.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisAdminRebalanceDiskStatementTestCase.java
new file mode 100644
index 00000000000..f6546440887
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisAdminRebalanceDiskStatementTestCase.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.statement.dal.dialect.doris;
+
+import lombok.Getter;
+import lombok.Setter;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.SQLParserTestCase;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Admin rebalance disk statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisAdminRebalanceDiskStatementTestCase extends
SQLParserTestCase {
+
+ @XmlElement(name = "backend")
+ private final List<String> backends = new LinkedList<>();
+}
diff --git
a/test/it/parser/src/main/resources/case/dal/admin-rebalance-disk.xml
b/test/it/parser/src/main/resources/case/dal/admin-rebalance-disk.xml
new file mode 100644
index 00000000000..8a5c4999814
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/dal/admin-rebalance-disk.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<sql-parser-test-cases>
+ <admin-rebalance-disk sql-case-id="admin_rebalance_disk" />
+
+ <admin-rebalance-disk sql-case-id="admin_rebalance_disk_on_backends">
+ <backend>192.168.0.1:9050</backend>
+ <backend>192.168.0.2:9050</backend>
+ </admin-rebalance-disk>
+
+ <admin-rebalance-disk sql-case-id="admin_rebalance_disk_on_single_backend">
+ <backend>192.168.0.1:9050</backend>
+ </admin-rebalance-disk>
+</sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/ddl/create-table.xml
b/test/it/parser/src/main/resources/case/ddl/create-table.xml
index 50fe27438e8..f41fd614bc4 100644
--- a/test/it/parser/src/main/resources/case/ddl/create-table.xml
+++ b/test/it/parser/src/main/resources/case/ddl/create-table.xml
@@ -2408,6 +2408,48 @@
</column-definition>
</create-table>
+ <create-table
sql-case-id="create_table_as_select_with_key_partition_distribution_properties_doris"
db-types="Doris">
+ <table name="t_user" start-index="13" stop-index="18" />
+ <column-definition type="DATE" start-index="21" stop-index="27">
+ <column name="dt" start-index="21" stop-index="22" />
+ </column-definition>
+ <column-definition type="INT" start-index="30" stop-index="35">
+ <column name="id" start-index="30" stop-index="31" />
+ </column-definition>
+ <column-definition type="VARCHAR" start-index="38" stop-index="53">
+ <column name="name" start-index="38" stop-index="41" />
+ </column-definition>
+ <create-table-option start-index="56" stop-index="66">
+ <engine name="OLAP" start-index="63" stop-index="66" />
+ </create-table-option>
+ <select>
+ <projections start-index="259" stop-index="314">
+ <expression-projection text="cast('2020-05-20' as date)"
alias="dt" start-index="259" stop-index="290" />
+ <expression-projection text="1" alias="id" start-index="293"
stop-index="299" />
+ <expression-projection text="Tom" alias="name"
start-index="302" stop-index="314" />
+ </projections>
+ </select>
+ </create-table>
+
+ <create-table
sql-case-id="create_table_as_select_with_duplicate_key_multi_columns_doris"
db-types="Doris">
+ <table name="t_dup_user" start-index="13" stop-index="22" />
+ <column-definition type="DATE" start-index="25" stop-index="31">
+ <column name="dt" start-index="25" stop-index="26" />
+ </column-definition>
+ <column-definition type="INT" start-index="34" stop-index="39">
+ <column name="id" start-index="34" stop-index="35" />
+ </column-definition>
+ <create-table-option start-index="42" stop-index="52">
+ <engine name="OLAP" start-index="49" stop-index="52" />
+ </create-table-option>
+ <select>
+ <projections start-index="120" stop-index="160">
+ <expression-projection text="cast('2020-05-20' as date)"
alias="dt" start-index="120" stop-index="151" />
+ <expression-projection text="1" alias="id" start-index="154"
stop-index="160" />
+ </projections>
+ </select>
+ </create-table>
+
<create-table sql-case-id="create_table_with_select_without_query"
db-types="Oracle">
<table name="t_order_new" start-index="13" stop-index="23"/>
<select>
diff --git
a/test/it/parser/src/main/resources/sql/supported/dal/admin-rebalance-disk.xml
b/test/it/parser/src/main/resources/sql/supported/dal/admin-rebalance-disk.xml
new file mode 100644
index 00000000000..c09ad8f01ba
--- /dev/null
+++
b/test/it/parser/src/main/resources/sql/supported/dal/admin-rebalance-disk.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<sql-cases>
+ <sql-case id="admin_rebalance_disk" value="ADMIN REBALANCE DISK"
db-types="Doris" />
+ <sql-case id="admin_rebalance_disk_on_backends" value="ADMIN REBALANCE
DISK ON ("192.168.0.1:9050", "192.168.0.2:9050")"
db-types="Doris" />
+ <sql-case id="admin_rebalance_disk_on_single_backend" value="ADMIN
REBALANCE DISK ON ("192.168.0.1:9050")" db-types="Doris" />
+</sql-cases>
diff --git
a/test/it/parser/src/main/resources/sql/supported/ddl/create-table.xml
b/test/it/parser/src/main/resources/sql/supported/ddl/create-table.xml
index dbb64905107..bea57e92172 100644
--- a/test/it/parser/src/main/resources/sql/supported/ddl/create-table.xml
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/create-table.xml
@@ -177,6 +177,8 @@
<sql-case id="create_table_multi_range_partition_date_doris" value="CREATE
TABLE create_table_multi_partion_date (k1 DATE, k2 INT, V1 VARCHAR(20))
PARTITION BY RANGE (k1) (FROM ('2000-11-14') TO ('2021-11-14') INTERVAL 1 YEAR,
FROM ('2021-11-14') TO ('2022-11-14') INTERVAL 1 MONTH, FROM ('2022-11-14') TO
('2023-01-03') INTERVAL 1 WEEK, FROM ('2023-01-03') TO ('2023-01-14') INTERVAL
1 DAY, PARTITION p_20230114 VALUES [('2023-01-14'), ('2023-01-15')))
DISTRIBUTED BY HASH(k2) BUCKETS 1 [...]
<sql-case id="create_table_multi_range_partition_hour_doris" value="CREATE
TABLE create_table_multi_partion_date_hour (k1 DATETIME, k2 INT, V1
VARCHAR(20)) PARTITION BY RANGE (k1) (FROM ('2023-01-03 12') TO ('2023-01-14
22') INTERVAL 1 HOUR) DISTRIBUTED BY HASH(k2) BUCKETS 1
PROPERTIES('replication_num' = '1')" db-types="Doris" />
<sql-case id="create_table_multi_range_partition_integer_doris"
value="CREATE TABLE create_table_multi_partion_integer (k1 BIGINT, k2 INT, V1
VARCHAR(20)) PARTITION BY RANGE (k1) (FROM (1) TO (100) INTERVAL 10)
DISTRIBUTED BY HASH(k2) BUCKETS 1 PROPERTIES('replication_num' = '1')"
db-types="Doris" />
+ <sql-case
id="create_table_as_select_with_key_partition_distribution_properties_doris"
value="CREATE TABLE t_user (dt DATE, id INT, name VARCHAR(20)) ENGINE=OLAP
UNIQUE KEY(dt, id) COMMENT "OLAP" PARTITION BY RANGE(dt) (FROM
("2020-01-01") TO ("2021-12-31") INTERVAL 1 YEAR)
DISTRIBUTED BY HASH(id) BUCKETS 1
PROPERTIES("replication_num"="1") AS SELECT
cast('2020-05-20' as date) as dt, 1 as id, 'Tom' as name" db-types="Doris" />
+ <sql-case
id="create_table_as_select_with_duplicate_key_multi_columns_doris"
value="CREATE TABLE t_dup_user (dt DATE, id INT) ENGINE=OLAP DUPLICATE KEY(dt,
id) DISTRIBUTED BY HASH(id) BUCKETS 1 AS SELECT cast('2020-05-20' as date) as
dt, 1 as id" db-types="Doris" />
<sql-case id="create_table_with_select_without_query" value="CREATE TABLE
t_order_new AS SELECT * FROM t_order" db-types="Oracle"/>
<sql-case id="create_table_as_select_with_pivot" value="CREATE TABLE
pivot_table AS SELECT * FROM (SELECT EXTRACT(YEAR FROM order_date) year,
order_mode, order_total FROM orders) PIVOT (SUM(order_total) FOR order_mode IN
('direct' AS Store, 'online' AS Internet));" db-types="Oracle"/>
<sql-case id="create_table_organization_index_parallel_with_select"
value="CREATE TABLE admin_iot3(i PRIMARY KEY, j, k, l) ORGANIZATION INDEX
PARALLEL AS SELECT * FROM hr.jobs" db-types="Oracle" />