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 965f3a95440 Support parsing Doris ADMIN SET TABLE STATUS syntax 
(#39588)
965f3a95440 is described below

commit 965f3a95440d2f8e9016de18974b25d59af9a949
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Aug 24 00:44:47 2026 +0800

    Support parsing Doris ADMIN SET TABLE STATUS syntax (#39588)
    
    * Support parsing Doris ADMIN CANCEL REBALANCE DISK statement, and add 
Doris sql-cases for YEARWEEK and RTRIM
    
    Fixes #31507
    
    * Support parsing Doris ADMIN SET TABLE STATUS syntax
    
    Fixes #31501
    
    - Support ADMIN SET TABLE STATUS statement with table name and PROPERTIES 
clause for Doris
    - Add Doris parser IT cases for simple and qualified table names
---
 .../core/database/visitor/SQLVisitorRule.java      |  2 +
 .../src/main/antlr4/imports/doris/DALStatement.g4  |  6 ++
 .../sql/parser/autogen/DorisStatement.g4           |  1 +
 .../statement/type/DorisDALStatementVisitor.java   | 11 ++++
 .../dal/DorisAdminSetTableStatusStatement.java     | 42 ++++++++++++++
 .../dal/dialect/doris/DorisDALStatementAssert.java |  5 ++
 .../DorisAdminSetTableStatusStatementAssert.java   | 64 ++++++++++++++++++++++
 .../cases/parser/jaxb/RootSQLParserTestCases.java  |  4 ++
 .../DorisAdminSetTableStatusStatementTestCase.java | 44 +++++++++++++++
 .../resources/case/dal/admin-set-table-status.xml  | 32 +++++++++++
 .../sql/supported/dal/admin-set-table-status.xml   | 22 ++++++++
 11 files changed, 233 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 951858b65ac..d5146dfcde9 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
@@ -605,6 +605,8 @@ public enum SQLVisitorRule {
     
     ADMIN_SET_PARTITION_VERSION("AdminSetPartitionVersion", 
SQLStatementType.DAL),
     
+    ADMIN_SET_TABLE_STATUS("AdminSetTableStatus", SQLStatementType.DAL),
+    
     ADMIN_CLEAN_TRASH("AdminCleanTrash", SQLStatementType.DAL),
     
     ADMIN_REBALANCE_DISK("AdminRebalanceDisk", 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 806d7b026bd..ea981fa3ad9 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
@@ -510,6 +510,12 @@ adminSetPartitionVersion
     : ADMIN SET TABLE tableName PARTITION VERSION propertiesClause
     ;
 
+// DORIS ADDED BEGIN
+adminSetTableStatus
+    : ADMIN SET TABLE tableName STATUS propertiesClause
+    ;
+// DORIS ADDED END
+
 adminRebalanceDisk
     : ADMIN REBALANCE DISK (ON LP_ string_ (COMMA_ string_)* RP_)?
     ;
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 daca1ea7ab4..7c81f4d3bf1 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
@@ -157,6 +157,7 @@ execute
     | adminCopyTablet
     | adminCheckTablet
     | adminSetPartitionVersion
+    | adminSetTableStatus
     | adminCleanTrash
     | adminRebalanceDisk
     | adminCancelRebalanceDisk
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 c3fcd2bd172..aac3a263bde 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
@@ -161,6 +161,7 @@ import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminSe
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminCopyTabletContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminCheckTabletContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminSetPartitionVersionContext;
+import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminSetTableStatusContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateSqlBlockRuleContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateWorkloadGroupContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PropertiesClauseContext;
@@ -256,6 +257,7 @@ import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetRep
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCopyTabletStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCheckTabletStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetPartitionVersionStatement;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetTableStatusStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminRebalanceDiskStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCancelRebalanceDiskStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminRepairStatement;
@@ -1422,6 +1424,15 @@ public final class DorisDALStatementVisitor extends 
DorisStatementVisitor implem
         return result;
     }
     
+    // DORIS ADDED BEGIN
+    @Override
+    public ASTNode visitAdminSetTableStatus(final AdminSetTableStatusContext 
ctx) {
+        DorisAdminSetTableStatusStatement result = new 
DorisAdminSetTableStatusStatement(getDatabaseType(), (SimpleTableSegment) 
visit(ctx.tableName()));
+        result.setProperties(extractPropertiesSegment(ctx.propertiesClause()));
+        return result;
+    }
+    // DORIS ADDED END
+    
     @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/DorisAdminSetTableStatusStatement.java
 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminSetTableStatusStatement.java
new file mode 100644
index 00000000000..3855fd8a61a
--- /dev/null
+++ 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisAdminSetTableStatusStatement.java
@@ -0,0 +1,42 @@
+/*
+ * 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.segment.generic.table.SimpleTableSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;
+
+/**
+ * Admin set table status statement for Doris.
+ */
+@Getter
+@Setter
+public final class DorisAdminSetTableStatusStatement extends DALStatement {
+    
+    private final SimpleTableSegment table;
+    
+    private PropertiesSegment properties;
+    
+    public DorisAdminSetTableStatusStatement(final DatabaseType databaseType, 
final SimpleTableSegment table) {
+        super(databaseType);
+        this.table = table;
+    }
+}
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 9cd30aa7118..92f0fdd3cc7 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
@@ -31,6 +31,7 @@ import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisPlanReplaye
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCopyTabletStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCheckTabletStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetPartitionVersionStatement;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetTableStatusStatement;
 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;
@@ -76,6 +77,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.DorisAdminCopyTabletStatementAssert;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAdminCheckTabletStatementAssert;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAdminSetPartitionVersionStatementAssert;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAdminSetTableStatusStatementAssert;
 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;
@@ -122,6 +124,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.dialect.doris.DorisAdminCopyTabletStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminCheckTabletStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminSetPartitionVersionStatementTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminSetTableStatusStatementTestCase;
 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;
@@ -222,6 +225,8 @@ public final class DorisDALStatementAssert {
             DorisAdminCheckTabletStatementAssert.assertIs(assertContext, 
(DorisAdminCheckTabletStatement) actual, 
(DorisAdminCheckTabletStatementTestCase) expected);
         } else if (actual instanceof DorisAdminSetPartitionVersionStatement) {
             
DorisAdminSetPartitionVersionStatementAssert.assertIs(assertContext, 
(DorisAdminSetPartitionVersionStatement) actual, 
(DorisAdminSetPartitionVersionStatementTestCase) expected);
+        } else if (actual instanceof DorisAdminSetTableStatusStatement) {
+            DorisAdminSetTableStatusStatementAssert.assertIs(assertContext, 
(DorisAdminSetTableStatusStatement) actual, 
(DorisAdminSetTableStatusStatementTestCase) expected);
         } else if (actual instanceof DorisShowFileStatement) {
             DorisShowFileStatementAssert.assertIs(assertContext, 
(DorisShowFileStatement) actual, (DorisShowFileStatementTestCase) expected);
         } else if (actual instanceof DorisShowEncryptKeysStatement) {
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminSetTableStatusStatementAssert.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminSetTableStatusStatementAssert.java
new file mode 100644
index 00000000000..693828c7f32
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisAdminSetTableStatusStatementAssert.java
@@ -0,0 +1,64 @@
+/*
+ * 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.DorisAdminSetTableStatusStatement;
+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.asserts.segment.table.TableAssert;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminSetTableStatusStatementTestCase;
+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 table status statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisAdminSetTableStatusStatementAssert {
+    
+    /**
+     * Assert admin set table status statement is correct with expected parser 
result.
+     *
+     * @param assertContext assert context
+     * @param actual actual admin set table status statement
+     * @param expected expected admin set table status statement test case
+     */
+    public static void assertIs(final SQLCaseAssertContext assertContext, 
final DorisAdminSetTableStatusStatement actual, final 
DorisAdminSetTableStatusStatementTestCase expected) {
+        assertNotNull(actual.getTable(), assertContext.getText("Table should 
not be null"));
+        TableAssert.assertIs(assertContext, actual.getTable(), 
expected.getTable());
+        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 1df997fc240..56ace0c2853 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
@@ -32,6 +32,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.dialect.doris.DorisAdminCopyTabletStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminCheckTabletStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminSetPartitionVersionStatementTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminSetTableStatusStatementTestCase;
 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;
@@ -871,6 +872,9 @@ public final class RootSQLParserTestCases {
     @XmlElement(name = "admin-set-partition-version")
     private final List<DorisAdminSetPartitionVersionStatementTestCase> 
adminSetPartitionVersionTestCases = new LinkedList<>();
     
+    @XmlElement(name = "admin-set-table-status")
+    private final List<DorisAdminSetTableStatusStatementTestCase> 
adminSetTableStatusTestCases = 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/DorisAdminSetTableStatusStatementTestCase.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisAdminSetTableStatusStatementTestCase.java
new file mode 100644
index 00000000000..c6839af8258
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisAdminSetTableStatusStatementTestCase.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 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.table.ExpectedSimpleTable;
+
+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 table status statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisAdminSetTableStatusStatementTestCase extends 
SQLParserTestCase {
+    
+    @XmlElement
+    private ExpectedSimpleTable table;
+    
+    @XmlElement(name = "property")
+    private final List<PropertyTestCase> properties = new LinkedList<>();
+}
diff --git 
a/test/it/parser/src/main/resources/case/dal/admin-set-table-status.xml 
b/test/it/parser/src/main/resources/case/dal/admin-set-table-status.xml
new file mode 100644
index 00000000000..2acceb46182
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/dal/admin-set-table-status.xml
@@ -0,0 +1,32 @@
+<?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-table-status sql-case-id="admin_set_table_status_to_normal">
+        <table name="tbl1" start-index="16" stop-index="19" />
+        <property key="state" value="NORMAL" start-index="39" stop-index="56" 
/>
+    </admin-set-table-status>
+
+    <admin-set-table-status 
sql-case-id="admin_set_table_status_with_qualified_table">
+        <table name="tbl2" start-index="16" stop-index="30">
+            <owner name="example_db" start-index="16" stop-index="25" />
+        </table>
+        <property key="state" value="SCHEMA_CHANGE" start-index="50" 
stop-index="74" />
+        <property key="comment" value="emergency recovery" start-index="77" 
stop-index="108" />
+    </admin-set-table-status>
+</sql-parser-test-cases>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/dal/admin-set-table-status.xml
 
b/test/it/parser/src/main/resources/sql/supported/dal/admin-set-table-status.xml
new file mode 100644
index 00000000000..267573017df
--- /dev/null
+++ 
b/test/it/parser/src/main/resources/sql/supported/dal/admin-set-table-status.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_table_status_to_normal" value="ADMIN SET TABLE 
tbl1 STATUS PROPERTIES(&quot;state&quot; = &quot;NORMAL&quot;)" 
db-types="Doris" />
+    <sql-case id="admin_set_table_status_with_qualified_table" value="ADMIN 
SET TABLE example_db.tbl2 STATUS PROPERTIES(&quot;state&quot; = 
&quot;SCHEMA_CHANGE&quot;, &quot;comment&quot; = &quot;emergency 
recovery&quot;)" db-types="Doris" />
+</sql-cases>

Reply via email to