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 a50aebeaa92 Support parsing Doris ADMIN SET REPLICA STATUS/VERSION and
ADMIN COPY TABLET syntax (#38349)
a50aebeaa92 is described below
commit a50aebeaa92eb34328f447ccb265b8d31686c284
Author: cxy <[email protected]>
AuthorDate: Fri Mar 6 00:31:39 2026 +0800
Support parsing Doris ADMIN SET REPLICA STATUS/VERSION and ADMIN COPY
TABLET syntax (#38349)
* Support parsing Doris ADMIN SET REPLICA STATUS/VERSION and ADMIN COPY
TABLET syntax
* Fix SQL case syntax for admin_copy_tablet_without_properties
* Remove semicolon from admin_copy_tablet SQL case
---
.../core/database/visitor/SQLVisitorRule.java | 6 +++
.../src/main/antlr4/imports/doris/BaseRule.g4 | 1 +
.../src/main/antlr4/imports/doris/DALStatement.g4 | 12 +++++
.../src/main/antlr4/imports/doris/DorisKeyword.g4 | 8 +++
.../sql/parser/autogen/DorisStatement.g4 | 3 ++
.../statement/type/DorisDALStatementVisitor.java | 30 +++++++++++
.../doris/dal/DorisAdminCopyTabletStatement.java | 41 +++++++++++++++
.../dal/DorisAdminSetReplicaStatusStatement.java | 38 ++++++++++++++
.../dal/DorisAdminSetReplicaVersionStatement.java | 38 ++++++++++++++
.../dal/dialect/doris/DorisDALStatementAssert.java | 15 ++++++
.../type/DorisAdminCopyTabletStatementAssert.java | 60 +++++++++++++++++++++
.../DorisAdminSetReplicaStatusStatementAssert.java | 61 ++++++++++++++++++++++
...DorisAdminSetReplicaVersionStatementAssert.java | 61 ++++++++++++++++++++++
.../cases/parser/jaxb/RootSQLParserTestCases.java | 12 +++++
.../DorisAdminCopyTabletStatementTestCase.java | 44 ++++++++++++++++
...orisAdminSetReplicaStatusStatementTestCase.java | 40 ++++++++++++++
...risAdminSetReplicaVersionStatementTestCase.java | 40 ++++++++++++++
.../main/resources/case/dal/admin-copy-tablet.xml | 26 +++++++++
.../case/dal/admin-set-replica-status.xml | 37 +++++++++++++
.../case/dal/admin-set-replica-version.xml | 31 +++++++++++
.../sql/supported/dal/admin-copy-tablet.xml | 22 ++++++++
.../sql/supported/dal/admin-set-replica-status.xml | 23 ++++++++
.../supported/dal/admin-set-replica-version.xml | 22 ++++++++
23 files changed, 671 insertions(+)
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 e8867cc0887..840f1b1d84c 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
@@ -567,6 +567,12 @@ public enum SQLVisitorRule {
DORIS_ALTER_SYSTEM("DorisAlterSystem", SQLStatementType.DAL),
+ ADMIN_SET_REPLICA_STATUS("AdminSetReplicaStatus", SQLStatementType.DAL),
+
+ ADMIN_SET_REPLICA_VERSION("AdminSetReplicaVersion", SQLStatementType.DAL),
+
+ ADMIN_COPY_TABLET("AdminCopyTablet", SQLStatementType.DAL),
+
CREATE_SQL_BLOCK_RULE("CreateSqlBlockRule", SQLStatementType.DAL),
DELIMITER("Delimiter", SQLStatementType.DAL),
diff --git
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/BaseRule.g4
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/BaseRule.g4
index 412b7d7261a..2714d0f5b1c 100644
--- a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/BaseRule.g4
+++ b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/BaseRule.g4
@@ -550,6 +550,7 @@ identifierKeywordsUnambiguous
| VARIABLES
| VCPU
| VERBOSE
+ | VERSION
| VIEW
| VISIBLE
| WAIT
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 85499ab4bc7..924ff2f09f8 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
@@ -429,6 +429,18 @@ dorisAlterSystemAction
| DROP OBSERVER string_
;
+adminSetReplicaStatus
+ : ADMIN SET REPLICA STATUS propertiesClause
+ ;
+
+adminSetReplicaVersion
+ : ADMIN SET REPLICA VERSION propertiesClause
+ ;
+
+adminCopyTablet
+ : ADMIN COPY TABLET NUMBER_ propertiesClause?
+ ;
+
createSqlBlockRule
: CREATE SQL_BLOCK_RULE ruleName propertiesClause
;
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 bd5f3356fec..0fda3fbe52c 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
@@ -2914,6 +2914,10 @@ TABLE_NAME
: T A B L E UL_ N A M E
;
+TABLET
+ : T A B L E T
+ ;
+
TASK
: T A S K
;
@@ -3174,6 +3178,10 @@ VERBOSE
: V E R B O S E
;
+VERSION
+ : V E R S I O N
+ ;
+
VIEW
: V I E W
;
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 da0266851b3..dc2a62e0a07 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
@@ -149,6 +149,9 @@ execute
| stopSyncJob
| createSyncJob
| dorisAlterSystem
+ | adminSetReplicaStatus
+ | adminSetReplicaVersion
+ | adminCopyTablet
| 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 ddb2f720a8b..f1fc173335c 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
@@ -140,6 +140,9 @@ 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.DorisAlterSystemContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminSetReplicaStatusContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminSetReplicaVersionContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminCopyTabletContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateSqlBlockRuleContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PropertiesClauseContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PropertyContext;
@@ -210,6 +213,9 @@ import
org.apache.shardingsphere.sql.parser.statement.core.value.literal.impl.Da
import
org.apache.shardingsphere.sql.parser.statement.core.value.literal.impl.NullLiteralValue;
import
org.apache.shardingsphere.sql.parser.statement.core.value.literal.impl.OtherLiteralValue;
import
org.apache.shardingsphere.sql.parser.statement.core.value.literal.impl.TemporalLiteralValue;
+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.DorisAlterResourceStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterSystemStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisBackupStatement;
@@ -1224,6 +1230,30 @@ public final class DorisDALStatementVisitor extends
DorisStatementVisitor implem
return "";
}
+ @Override
+ public ASTNode visitAdminSetReplicaStatus(final
AdminSetReplicaStatusContext ctx) {
+ DorisAdminSetReplicaStatusStatement result = new
DorisAdminSetReplicaStatusStatement(getDatabaseType());
+ result.setProperties(extractPropertiesSegment(ctx.propertiesClause()));
+ return result;
+ }
+
+ @Override
+ public ASTNode visitAdminSetReplicaVersion(final
AdminSetReplicaVersionContext ctx) {
+ DorisAdminSetReplicaVersionStatement result = new
DorisAdminSetReplicaVersionStatement(getDatabaseType());
+ result.setProperties(extractPropertiesSegment(ctx.propertiesClause()));
+ return result;
+ }
+
+ @Override
+ public ASTNode visitAdminCopyTablet(final AdminCopyTabletContext ctx) {
+ long tabletId = Long.parseLong(ctx.NUMBER_().getText());
+ DorisAdminCopyTabletStatement result = new
DorisAdminCopyTabletStatement(getDatabaseType(), tabletId);
+ if (null != ctx.propertiesClause()) {
+
result.setProperties(extractPropertiesSegment(ctx.propertiesClause()));
+ }
+ return result;
+ }
+
@Override
public ASTNode visitCreateSqlBlockRule(final CreateSqlBlockRuleContext
ctx) {
DorisCreateSqlBlockRuleStatement result = new
DorisCreateSqlBlockRuleStatement(getDatabaseType());
diff --git
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminCopyTabletStatement.java
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminCopyTabletStatement.java
new file mode 100644
index 00000000000..aeb4942b7cd
--- /dev/null
+++
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminCopyTabletStatement.java
@@ -0,0 +1,41 @@
+/*
+ * 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 lombok.Setter;
+import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertiesSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;
+
+/**
+ * Admin copy tablet statement for Doris.
+ */
+@Getter
+@Setter
+public final class DorisAdminCopyTabletStatement extends DALStatement {
+
+ private final long tabletId;
+
+ private PropertiesSegment properties;
+
+ public DorisAdminCopyTabletStatement(final DatabaseType databaseType,
final long tabletId) {
+ super(databaseType);
+ this.tabletId = tabletId;
+ }
+}
diff --git
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminSetReplicaStatusStatement.java
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminSetReplicaStatusStatement.java
new file mode 100644
index 00000000000..acfd5f9b3d9
--- /dev/null
+++
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminSetReplicaStatusStatement.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 lombok.Setter;
+import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertiesSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;
+
+/**
+ * Admin set replica status statement for Doris.
+ */
+@Getter
+@Setter
+public final class DorisAdminSetReplicaStatusStatement extends DALStatement {
+
+ private PropertiesSegment properties;
+
+ public DorisAdminSetReplicaStatusStatement(final DatabaseType
databaseType) {
+ super(databaseType);
+ }
+}
diff --git
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminSetReplicaVersionStatement.java
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminSetReplicaVersionStatement.java
new file mode 100644
index 00000000000..b18c0bcbce0
--- /dev/null
+++
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminSetReplicaVersionStatement.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 lombok.Setter;
+import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertiesSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;
+
+/**
+ * Admin set replica version statement for Doris.
+ */
+@Getter
+@Setter
+public final class DorisAdminSetReplicaVersionStatement extends DALStatement {
+
+ private PropertiesSegment properties;
+
+ public DorisAdminSetReplicaVersionStatement(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 2f98509de79..ddd2fa77b83 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
@@ -21,6 +21,9 @@ import lombok.AccessLevel;
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.DorisAdminCopyTabletStatement;
+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.DorisAlterResourceStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterSystemStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisBackupStatement;
@@ -38,6 +41,9 @@ import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowSyncJob
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisSwitchStatement;
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.DorisAdminCopyTabletStatementAssert;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAdminSetReplicaStatusStatementAssert;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAdminSetReplicaVersionStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAlterResourceStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAlterSystemStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisBackupStatementAssert;
@@ -56,6 +62,9 @@ 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.DorisSwitchStatementAssert;
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.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;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAlterResourceStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAlterSystemStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisBackupStatementTestCase;
@@ -122,6 +131,12 @@ public final class DorisDALStatementAssert {
DorisBackupStatementAssert.assertIs(assertContext,
(DorisBackupStatement) actual, (DorisBackupStatementTestCase) expected);
} else if (actual instanceof DorisCancelBackupStatement) {
DorisCancelBackupStatementAssert.assertIs(assertContext,
(DorisCancelBackupStatement) actual, (DorisCancelBackupStatementTestCase)
expected);
+ } else if (actual instanceof DorisAdminSetReplicaStatusStatement) {
+ DorisAdminSetReplicaStatusStatementAssert.assertIs(assertContext,
(DorisAdminSetReplicaStatusStatement) actual,
(DorisAdminSetReplicaStatusStatementTestCase) expected);
+ } else if (actual instanceof DorisAdminSetReplicaVersionStatement) {
+ DorisAdminSetReplicaVersionStatementAssert.assertIs(assertContext,
(DorisAdminSetReplicaVersionStatement) actual,
(DorisAdminSetReplicaVersionStatementTestCase) expected);
+ } else if (actual instanceof DorisAdminCopyTabletStatement) {
+ DorisAdminCopyTabletStatementAssert.assertIs(assertContext,
(DorisAdminCopyTabletStatement) actual, (DorisAdminCopyTabletStatementTestCase)
expected);
}
}
}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminCopyTabletStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminCopyTabletStatementAssert.java
new file mode 100644
index 00000000000..e4ed9a8472f
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminCopyTabletStatementAssert.java
@@ -0,0 +1,60 @@
+/*
+ * 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.core.segment.ddl.property.PropertySegment;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCopyTabletStatement;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+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.PropertyTestCase;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+/**
+ * Admin copy tablet statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisAdminCopyTabletStatementAssert {
+
+ /**
+ * Assert admin copy tablet statement is correct with expected parser
result.
+ *
+ * @param assertContext assert context
+ * @param actual actual admin copy tablet statement
+ * @param expected expected admin copy tablet statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext,
final DorisAdminCopyTabletStatement actual, final
DorisAdminCopyTabletStatementTestCase expected) {
+ assertThat(assertContext.getText("Tablet ID does not match: "),
actual.getTabletId(), is(expected.getTabletId()));
+ if (!expected.getProperties().isEmpty()) {
+ assertThat(assertContext.getText("Properties size does not match:
"), actual.getProperties().getProperties().size(),
is(expected.getProperties().size()));
+ for (int i = 0; i < expected.getProperties().size(); i++) {
+ assertProperty(assertContext,
actual.getProperties().getProperties().get(i), expected.getProperties().get(i));
+ }
+ }
+ }
+
+ private static void assertProperty(final SQLCaseAssertContext
assertContext, final PropertySegment actual, final PropertyTestCase expected) {
+ assertThat(assertContext.getText(String.format("Property key '%s'
assertion error: ", expected.getKey())), actual.getKey(),
is(expected.getKey()));
+ assertThat(assertContext.getText(String.format("Property value for key
'%s' assertion error: ", expected.getKey())), actual.getValue(),
is(expected.getValue()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminSetReplicaStatusStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminSetReplicaStatusStatementAssert.java
new file mode 100644
index 00000000000..05cb137f216
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminSetReplicaStatusStatementAssert.java
@@ -0,0 +1,61 @@
+/*
+ * 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.core.segment.ddl.property.PropertySegment;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetReplicaStatusStatement;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+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.PropertyTestCase;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * Admin set replica status statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisAdminSetReplicaStatusStatementAssert {
+
+ /**
+ * Assert admin set replica status statement is correct with expected
parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual admin set replica status statement
+ * @param expected expected admin set replica status statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext,
final DorisAdminSetReplicaStatusStatement actual, final
DorisAdminSetReplicaStatusStatementTestCase expected) {
+ assertNotNull(actual.getProperties(),
assertContext.getText("Properties should not be null"));
+ if (!expected.getProperties().isEmpty()) {
+ assertThat(assertContext.getText("Properties size does not match:
"), actual.getProperties().getProperties().size(),
is(expected.getProperties().size()));
+ for (int i = 0; i < expected.getProperties().size(); i++) {
+ assertProperty(assertContext,
actual.getProperties().getProperties().get(i), expected.getProperties().get(i));
+ }
+ }
+ }
+
+ private static void assertProperty(final SQLCaseAssertContext
assertContext, final PropertySegment actual, final PropertyTestCase expected) {
+ assertThat(assertContext.getText(String.format("Property key '%s'
assertion error: ", expected.getKey())), actual.getKey(),
is(expected.getKey()));
+ assertThat(assertContext.getText(String.format("Property value for key
'%s' assertion error: ", expected.getKey())), actual.getValue(),
is(expected.getValue()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminSetReplicaVersionStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminSetReplicaVersionStatementAssert.java
new file mode 100644
index 00000000000..4ab19f4d247
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminSetReplicaVersionStatementAssert.java
@@ -0,0 +1,61 @@
+/*
+ * 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.core.segment.ddl.property.PropertySegment;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetReplicaVersionStatement;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminSetReplicaVersionStatementTestCase;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.PropertyTestCase;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * Admin set replica version statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisAdminSetReplicaVersionStatementAssert {
+
+ /**
+ * Assert admin set replica version statement is correct with expected
parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual admin set replica version statement
+ * @param expected expected admin set replica version statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext,
final DorisAdminSetReplicaVersionStatement actual, final
DorisAdminSetReplicaVersionStatementTestCase expected) {
+ assertNotNull(actual.getProperties(),
assertContext.getText("Properties should not be null"));
+ if (!expected.getProperties().isEmpty()) {
+ assertThat(assertContext.getText("Properties size does not match:
"), actual.getProperties().getProperties().size(),
is(expected.getProperties().size()));
+ for (int i = 0; i < expected.getProperties().size(); i++) {
+ assertProperty(assertContext,
actual.getProperties().getProperties().get(i), expected.getProperties().get(i));
+ }
+ }
+ }
+
+ private static void assertProperty(final SQLCaseAssertContext
assertContext, final PropertySegment actual, final PropertyTestCase expected) {
+ assertThat(assertContext.getText(String.format("Property key '%s'
assertion error: ", expected.getKey())), actual.getKey(),
is(expected.getKey()));
+ assertThat(assertContext.getText(String.format("Property value for key
'%s' assertion error: ", expected.getKey())), actual.getValue(),
is(expected.getValue()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
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 9dc40c235af..f2f5376d059 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
@@ -21,6 +21,9 @@ import com.google.common.base.Preconditions;
import lombok.Getter;
import lombok.SneakyThrows;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.CommonStatementTestCase;
+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;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAlterSystemStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCreateSqlBlockRuleStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCreateRepositoryStatementTestCase;
@@ -746,6 +749,15 @@ public final class RootSQLParserTestCases {
@XmlElement(name = "doris-alter-system")
private final List<DorisAlterSystemStatementTestCase>
dorisAlterSystemTestCases = new LinkedList<>();
+ @XmlElement(name = "admin-set-replica-status")
+ private final List<DorisAdminSetReplicaStatusStatementTestCase>
adminSetReplicaStatusTestCases = new LinkedList<>();
+
+ @XmlElement(name = "admin-set-replica-version")
+ private final List<DorisAdminSetReplicaVersionStatementTestCase>
adminSetReplicaVersionTestCases = new LinkedList<>();
+
+ @XmlElement(name = "admin-copy-tablet")
+ private final List<DorisAdminCopyTabletStatementTestCase>
adminCopyTabletTestCases = new LinkedList<>();
+
@XmlElement(name = "create-sql-block-rule")
private final List<DorisCreateSqlBlockRuleStatementTestCase>
createSqlBlockRuleTestCases = 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/DorisAdminCopyTabletStatementTestCase.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisAdminCopyTabletStatementTestCase.java
new file mode 100644
index 00000000000..6dd5b349678
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisAdminCopyTabletStatementTestCase.java
@@ -0,0 +1,44 @@
+/*
+ * 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.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Admin copy tablet statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisAdminCopyTabletStatementTestCase extends
SQLParserTestCase {
+
+ @XmlAttribute(name = "tablet-id")
+ private long tabletId;
+
+ @XmlElement(name = "property")
+ private final List<PropertyTestCase> properties = 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/DorisAdminSetReplicaStatusStatementTestCase.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisAdminSetReplicaStatusStatementTestCase.java
new file mode 100644
index 00000000000..cc996e88e90
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisAdminSetReplicaStatusStatementTestCase.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 set replica status statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisAdminSetReplicaStatusStatementTestCase extends
SQLParserTestCase {
+
+ @XmlElement(name = "property")
+ private final List<PropertyTestCase> properties = 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/DorisAdminSetReplicaVersionStatementTestCase.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisAdminSetReplicaVersionStatementTestCase.java
new file mode 100644
index 00000000000..477d6cd6799
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisAdminSetReplicaVersionStatementTestCase.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 set replica version statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisAdminSetReplicaVersionStatementTestCase extends
SQLParserTestCase {
+
+ @XmlElement(name = "property")
+ private final List<PropertyTestCase> properties = new LinkedList<>();
+}
diff --git a/test/it/parser/src/main/resources/case/dal/admin-copy-tablet.xml
b/test/it/parser/src/main/resources/case/dal/admin-copy-tablet.xml
new file mode 100644
index 00000000000..b7034acc37a
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/dal/admin-copy-tablet.xml
@@ -0,0 +1,26 @@
+<?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-copy-tablet sql-case-id="admin_copy_tablet_with_properties"
tablet-id="10010">
+ <property key="backend_id" value="10003" start-index="35"
stop-index="56" />
+ <property key="version" value="10" start-index="59" stop-index="74" />
+ </admin-copy-tablet>
+
+ <admin-copy-tablet sql-case-id="admin_copy_tablet_without_properties"
tablet-id="10010" />
+</sql-parser-test-cases>
diff --git
a/test/it/parser/src/main/resources/case/dal/admin-set-replica-status.xml
b/test/it/parser/src/main/resources/case/dal/admin-set-replica-status.xml
new file mode 100644
index 00000000000..7d0346e924b
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/dal/admin-set-replica-status.xml
@@ -0,0 +1,37 @@
+<?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-set-replica-status sql-case-id="admin_set_replica_status_to_drop">
+ <property key="tablet_id" value="10003" start-index="36"
stop-index="56" />
+ <property key="backend_id" value="10001" start-index="59"
stop-index="80" />
+ <property key="status" value="drop" start-index="83" stop-index="99" />
+ </admin-set-replica-status>
+
+ <admin-set-replica-status sql-case-id="admin_set_replica_status_to_bad">
+ <property key="tablet_id" value="10003" start-index="36"
stop-index="56" />
+ <property key="backend_id" value="10001" start-index="59"
stop-index="80" />
+ <property key="status" value="bad" start-index="83" stop-index="98" />
+ </admin-set-replica-status>
+
+ <admin-set-replica-status sql-case-id="admin_set_replica_status_to_ok">
+ <property key="tablet_id" value="10003" start-index="36"
stop-index="56" />
+ <property key="backend_id" value="10001" start-index="59"
stop-index="80" />
+ <property key="status" value="ok" start-index="83" stop-index="97" />
+ </admin-set-replica-status>
+</sql-parser-test-cases>
diff --git
a/test/it/parser/src/main/resources/case/dal/admin-set-replica-version.xml
b/test/it/parser/src/main/resources/case/dal/admin-set-replica-version.xml
new file mode 100644
index 00000000000..6e2dbea4e9f
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/dal/admin-set-replica-version.xml
@@ -0,0 +1,31 @@
+<?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-set-replica-version
sql-case-id="admin_set_replica_version_with_last_failed_version">
+ <property key="tablet_id" value="10003" start-index="37"
stop-index="57" />
+ <property key="backend_id" value="10001" start-index="60"
stop-index="81" />
+ <property key="last_failed_version" value="-1" start-index="84"
stop-index="111" />
+ </admin-set-replica-version>
+
+ <admin-set-replica-version
sql-case-id="admin_set_replica_version_with_version">
+ <property key="tablet_id" value="10003" start-index="37"
stop-index="57" />
+ <property key="backend_id" value="10001" start-index="60"
stop-index="81" />
+ <property key="version" value="100" start-index="84" stop-index="100"
/>
+ </admin-set-replica-version>
+</sql-parser-test-cases>
diff --git
a/test/it/parser/src/main/resources/sql/supported/dal/admin-copy-tablet.xml
b/test/it/parser/src/main/resources/sql/supported/dal/admin-copy-tablet.xml
new file mode 100644
index 00000000000..c2ed0651fae
--- /dev/null
+++ b/test/it/parser/src/main/resources/sql/supported/dal/admin-copy-tablet.xml
@@ -0,0 +1,22 @@
+<?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_copy_tablet_with_properties" value="ADMIN COPY TABLET
10010 PROPERTIES("backend_id" = "10003",
"version" = "10")" db-types="Doris" />
+ <sql-case id="admin_copy_tablet_without_properties" value="ADMIN COPY
TABLET 10010" db-types="Doris" />
+</sql-cases>
diff --git
a/test/it/parser/src/main/resources/sql/supported/dal/admin-set-replica-status.xml
b/test/it/parser/src/main/resources/sql/supported/dal/admin-set-replica-status.xml
new file mode 100644
index 00000000000..4eb3f736c30
--- /dev/null
+++
b/test/it/parser/src/main/resources/sql/supported/dal/admin-set-replica-status.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_set_replica_status_to_drop" value="ADMIN SET REPLICA
STATUS PROPERTIES("tablet_id" = "10003",
"backend_id" = "10001", "status" =
"drop")" db-types="Doris" />
+ <sql-case id="admin_set_replica_status_to_bad" value="ADMIN SET REPLICA
STATUS PROPERTIES("tablet_id" = "10003",
"backend_id" = "10001", "status" =
"bad")" db-types="Doris" />
+ <sql-case id="admin_set_replica_status_to_ok" value="ADMIN SET REPLICA
STATUS PROPERTIES("tablet_id" = "10003",
"backend_id" = "10001", "status" =
"ok")" db-types="Doris" />
+</sql-cases>
diff --git
a/test/it/parser/src/main/resources/sql/supported/dal/admin-set-replica-version.xml
b/test/it/parser/src/main/resources/sql/supported/dal/admin-set-replica-version.xml
new file mode 100644
index 00000000000..ff31009bb8f
--- /dev/null
+++
b/test/it/parser/src/main/resources/sql/supported/dal/admin-set-replica-version.xml
@@ -0,0 +1,22 @@
+<?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_set_replica_version_with_last_failed_version"
value="ADMIN SET REPLICA VERSION PROPERTIES("tablet_id" =
"10003", "backend_id" = "10001",
"last_failed_version" = "-1")" db-types="Doris" />
+ <sql-case id="admin_set_replica_version_with_version" value="ADMIN SET
REPLICA VERSION PROPERTIES("tablet_id" = "10003",
"backend_id" = "10001", "version" =
"100")" db-types="Doris" />
+</sql-cases>