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 b89baf1853e Support for the SHOW QUERY STATS statement and the kill 
statement (#37554)
b89baf1853e is described below

commit b89baf1853ea219ffdfd99351304bc76ffac17aa
Author: cxy <[email protected]>
AuthorDate: Sun Dec 28 01:39:29 2025 +0800

    Support for the SHOW QUERY STATS statement and the kill statement (#37554)
---
 .../src/main/antlr4/imports/doris/BaseRule.g4      |  2 +
 .../src/main/antlr4/imports/doris/DALStatement.g4  |  7 +-
 .../src/main/antlr4/imports/doris/DorisKeyword.g4  |  8 ++
 .../statement/type/DorisDALStatementVisitor.java   | 29 ++++++-
 .../dal/show/DorisShowQueryStatsStatement.java     | 90 ++++++++++++++++++++++
 .../dal/dialect/doris/DorisDALStatementAssert.java |  5 ++
 .../type/DorisShowQueryStatsStatementAssert.java   | 63 +++++++++++++++
 .../cases/parser/jaxb/RootSQLParserTestCases.java  |  4 +
 .../jaxb/segment/impl/from/ExpectedFromTable.java  | 36 +++++++++
 .../show/DorisShowQueryStatsStatementTestCase.java | 47 +++++++++++
 .../it/parser/src/main/resources/case/dal/kill.xml |  3 +
 .../it/parser/src/main/resources/case/dal/show.xml | 22 ++++++
 .../src/main/resources/sql/supported/dal/kill.xml  |  3 +
 .../src/main/resources/sql/supported/dal/show.xml  |  6 ++
 14 files changed, 323 insertions(+), 2 deletions(-)

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 db3f58255bf..1e654b4c27e 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
@@ -474,6 +474,7 @@ identifierKeywordsUnambiguous
     | SRID
     | STACKED
     | STARTS
+    | STATS
     | STATS_AUTO_RECALC
     | STATS_PERSISTENT
     | STATS_SAMPLE_PAGES
@@ -527,6 +528,7 @@ identifierKeywordsUnambiguous
     | VALUE
     | VARIABLES
     | VCPU
+    | VERBOSE
     | 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 7bfdb72a776..d20917fb59a 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
@@ -421,6 +421,10 @@ setResourceGroup
     : SET RESOURCE GROUP groupName (FOR NUMBER_ (COMMA_ NUMBER_)*)?
     ;
 
+showQueryStats
+    : SHOW QUERY STATS (FOR databaseName | fromTable)? ALL? VERBOSE?
+    ;
+
 binlog
     : BINLOG stringLiterals
     ;
@@ -455,7 +459,7 @@ tablesOption
     ;
 
 kill
-    : KILL (CONNECTION | QUERY)? AT_? IDENTIFIER_
+    : KILL (CONNECTION | QUERY)? (AT_? IDENTIFIER_ | NUMBER_)
     ;
 
 loadIndexInfo
@@ -729,6 +733,7 @@ show
     | showProfile
     | showProcedureStatus
     | showProfiles
+    | showQueryStats
     | showSlaveHosts
     | showSlaveStatus
     | showRelaylogEvent
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 b8f8e87fe74..0f4cf009817 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
@@ -2608,6 +2608,10 @@ STARTS
     : S T A R T S
     ;
 
+STATS
+    : S T A T S
+    ;
+
 STATS_AUTO_RECALC
     : S T A T S UL_ A U T O UL_ R E C A L C
     ;
@@ -3062,6 +3066,10 @@ VCPU
     : V C P U
     ;
 
+VERBOSE
+    : V E R B O S E
+    ;
+
 VIEW
     : V I E W
     ;
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 a66bea827f2..bd40ab01c8f 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
@@ -135,6 +135,7 @@ import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateS
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PropertiesClauseContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PropertyContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DorisAlterSystemActionContext;
+import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowQueryStatsContext;
 import 
org.apache.shardingsphere.sql.parser.engine.doris.visitor.statement.DorisStatementVisitor;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dal.CacheTableIndexSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dal.CloneActionSegment;
@@ -180,6 +181,7 @@ import 
org.apache.shardingsphere.sql.parser.statement.core.value.literal.impl.Te
 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.DorisCreateSqlBlockRuleStatement;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.show.DorisShowQueryStatsStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.mysql.dal.MySQLCloneStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.mysql.dal.MySQLCreateLoadableFunctionStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.mysql.dal.MySQLDelimiterStatement;
@@ -466,7 +468,13 @@ public final class DorisDALStatementVisitor extends 
DorisStatementVisitor implem
     
     @Override
     public ASTNode visitKill(final KillContext ctx) {
-        return new MySQLKillStatement(getDatabaseType(), null == ctx.AT_() ? 
ctx.IDENTIFIER_().getText() : ctx.AT_().getText() + 
ctx.IDENTIFIER_().getText(), null);
+        String processId;
+        if (null != ctx.NUMBER_()) {
+            processId = ctx.NUMBER_().getText();
+        } else {
+            processId = null == ctx.AT_() ? ctx.IDENTIFIER_().getText() : 
ctx.AT_().getText() + ctx.IDENTIFIER_().getText();
+        }
+        return new MySQLKillStatement(getDatabaseType(), processId, null);
     }
     
     @Override
@@ -768,6 +776,8 @@ public final class DorisDALStatementVisitor extends 
DorisStatementVisitor implem
     @Override
     public ASTNode visitFromTable(final FromTableContext ctx) {
         FromTableSegment result = new FromTableSegment();
+        result.setStartIndex(ctx.getStart().getStartIndex());
+        result.setStopIndex(ctx.getStop().getStopIndex());
         result.setTable((SimpleTableSegment) visit(ctx.tableName()));
         return result;
     }
@@ -931,6 +941,23 @@ public final class DorisDALStatementVisitor extends 
DorisStatementVisitor implem
         return new ShowLikeSegment(ctx.getStart().getStartIndex(), 
ctx.getStop().getStopIndex(), literalValue.getValue());
     }
     
+    @Override
+    public ASTNode visitShowQueryStats(final ShowQueryStatsContext ctx) {
+        DatabaseSegment database = null;
+        FromTableSegment fromTable = null;
+        if (null != ctx.databaseName()) {
+            database = (DatabaseSegment) visit(ctx.databaseName());
+        }
+        if (null != ctx.fromTable()) {
+            fromTable = (FromTableSegment) visit(ctx.fromTable());
+        }
+        boolean all = null != ctx.ALL();
+        boolean verbose = null != ctx.VERBOSE();
+        DorisShowQueryStatsStatement result = new 
DorisShowQueryStatsStatement(getDatabaseType(), database, fromTable, all, 
verbose);
+        result.addParameterMarkers(getParameterMarkerSegments());
+        return result;
+    }
+    
     @Override
     public ASTNode visitCreateLoadableFunction(final 
CreateLoadableFunctionContext ctx) {
         return new MySQLCreateLoadableFunctionStatement(getDatabaseType());
diff --git 
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/show/DorisShowQueryStatsStatement.java
 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/show/DorisShowQueryStatsStatement.java
new file mode 100644
index 00000000000..63eb3711b16
--- /dev/null
+++ 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/show/DorisShowQueryStatsStatement.java
@@ -0,0 +1,90 @@
+/*
+ * 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.show;
+
+import lombok.Getter;
+import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dal.FromTableSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.segment.generic.DatabaseSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table.SimpleTableSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
+import 
org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.AllowNotUseDatabaseSQLStatementAttribute;
+import 
org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.DatabaseSelectRequiredSQLStatementAttribute;
+import 
org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.TableSQLStatementAttribute;
+import 
org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.TablelessDataSourceBroadcastRouteSQLStatementAttribute;
+import 
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;
+
+import java.util.Optional;
+
+/**
+ * Show query stats statement for Doris.
+ */
+@Getter
+public final class DorisShowQueryStatsStatement extends DALStatement {
+    
+    private final DatabaseSegment database;
+    
+    private final FromTableSegment fromTable;
+    
+    private final boolean all;
+    
+    private final boolean verbose;
+    
+    public DorisShowQueryStatsStatement(final DatabaseType databaseType, final 
DatabaseSegment database, final FromTableSegment fromTable, final boolean all, 
final boolean verbose) {
+        super(databaseType);
+        this.database = database;
+        this.fromTable = fromTable;
+        this.all = all;
+        this.verbose = verbose;
+    }
+    
+    /**
+     * Get database.
+     *
+     * @return database
+     */
+    public Optional<DatabaseSegment> getDatabase() {
+        return Optional.ofNullable(database);
+    }
+    
+    /**
+     * Get from table.
+     *
+     * @return from table
+     */
+    public Optional<FromTableSegment> getFromTable() {
+        return Optional.ofNullable(fromTable);
+    }
+    
+    /**
+     * Get table.
+     *
+     * @return table
+     */
+    public Optional<SimpleTableSegment> getTable() {
+        return null == fromTable ? Optional.empty() : 
Optional.ofNullable(fromTable.getTable());
+    }
+    
+    @Override
+    public SQLStatementAttributes getAttributes() {
+        String databaseName = null == database ? null : 
database.getIdentifier().getValue();
+        SimpleTableSegment table = null == fromTable ? null : 
fromTable.getTable();
+        return new SQLStatementAttributes(new 
DatabaseSelectRequiredSQLStatementAttribute(), new 
TableSQLStatementAttribute(table),
+                new TablelessDataSourceBroadcastRouteSQLStatementAttribute(), 
new AllowNotUseDatabaseSQLStatementAttribute(true, databaseName));
+    }
+}
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 16ee0ba71e7..b3cf9727bd1 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
@@ -23,14 +23,17 @@ import 
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
 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.DorisCreateSqlBlockRuleStatement;
+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.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.DorisCreateSqlBlockRuleStatementAssert;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisShowQueryStatsStatementAssert;
 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.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.DorisCreateSqlBlockRuleStatementTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.show.DorisShowQueryStatsStatementTestCase;
 
 /**
  * DAL statement assert for Doris.
@@ -52,6 +55,8 @@ public final class DorisDALStatementAssert {
             DorisAlterSystemStatementAssert.assertIs(assertContext, 
(DorisAlterSystemStatement) actual, (DorisAlterSystemStatementTestCase) 
expected);
         } else if (actual instanceof DorisCreateSqlBlockRuleStatement) {
             DorisCreateSqlBlockRuleStatementAssert.assertIs(assertContext, 
(DorisCreateSqlBlockRuleStatement) actual, 
(DorisCreateSqlBlockRuleStatementTestCase) expected);
+        } else if (actual instanceof DorisShowQueryStatsStatement) {
+            DorisShowQueryStatsStatementAssert.assertIs(assertContext, 
(DorisShowQueryStatsStatement) actual, (DorisShowQueryStatsStatementTestCase) 
expected);
         }
     }
 }
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisShowQueryStatsStatementAssert.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisShowQueryStatsStatementAssert.java
new file mode 100644
index 00000000000..3f8e6f9cade
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisShowQueryStatsStatementAssert.java
@@ -0,0 +1,63 @@
+/*
+ * 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.show.DorisShowQueryStatsStatement;
+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.database.DatabaseAssert;
+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.show.DorisShowQueryStatsStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Show query stats statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisShowQueryStatsStatementAssert {
+    
+    /**
+     * Assert show query stats statement is correct with expected parser 
result.
+     *
+     * @param assertContext assert context
+     * @param actual actual show query stats statement
+     * @param expected expected show query stats statement test case
+     */
+    public static void assertIs(final SQLCaseAssertContext assertContext, 
final DorisShowQueryStatsStatement actual, final 
DorisShowQueryStatsStatementTestCase expected) {
+        if (null != expected.getDatabase()) {
+            DatabaseAssert.assertIs(assertContext, 
actual.getDatabase().orElse(null), expected.getDatabase());
+        }
+        assertFromTable(assertContext, actual, expected);
+        assertThat(assertContext.getText("Assertion error: all flag does not 
match."), actual.isAll(), is(expected.isAll()));
+        assertThat(assertContext.getText("Assertion error: verbose flag does 
not match."), actual.isVerbose(), is(expected.isVerbose()));
+    }
+    
+    private static void assertFromTable(final SQLCaseAssertContext 
assertContext, final DorisShowQueryStatsStatement actual, final 
DorisShowQueryStatsStatementTestCase expected) {
+        if (null == expected.getFrom() || !actual.getFromTable().isPresent()) {
+            return;
+        }
+        SQLSegmentAssert.assertIs(assertContext, actual.getFromTable().get(), 
expected.getFrom());
+        if (null != expected.getFrom().getTable()) {
+            TableAssert.assertIs(assertContext, 
actual.getTable().orElse(null), expected.getFrom().getTable());
+        }
+    }
+}
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 7ea516342f1..0a78408d5ff 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
@@ -78,6 +78,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.mysql.table.MySQLOptimizeTableStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.mysql.table.MySQLRepairTableStatementTestCase;
 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.show.DorisShowQueryStatsStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.oracle.OracleSpoolStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.postgresql.PostgreSQLResetParameterStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.standard.EmptyStatementTestCase;
@@ -1276,6 +1277,9 @@ public final class RootSQLParserTestCases {
     @XmlElement(name = "show-open-tables")
     private final List<MySQLShowOpenTablesStatementTestCase> 
showOpenTablesTestCases = new LinkedList<>();
     
+    @XmlElement(name = "show-query-stats")
+    private final List<DorisShowQueryStatsStatementTestCase> 
showQueryStatsTestCases = new LinkedList<>();
+    
     @XmlElement(name = "check-table")
     private final List<MySQLCheckTableStatementTestCase> checkTableTestCases = 
new LinkedList<>();
     
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/from/ExpectedFromTable.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/from/ExpectedFromTable.java
new file mode 100644
index 00000000000..2e8ed68b9e6
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/from/ExpectedFromTable.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.from;
+
+import lombok.Getter;
+import lombok.Setter;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.AbstractExpectedSQLSegment;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.table.ExpectedSimpleTable;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Expected from table segment.
+ */
+@Getter
+@Setter
+public final class ExpectedFromTable extends AbstractExpectedSQLSegment {
+    
+    @XmlElement(name = "table")
+    private ExpectedSimpleTable table;
+}
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/show/DorisShowQueryStatsStatementTestCase.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/show/DorisShowQueryStatsStatementTestCase.java
new file mode 100644
index 00000000000..1498f503390
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/show/DorisShowQueryStatsStatementTestCase.java
@@ -0,0 +1,47 @@
+/*
+ * 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.show;
+
+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.database.ExpectedDatabase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.from.ExpectedFromTable;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Show query stats statement test case for Doris.
+ */
+@Getter
+@Setter
+public final class DorisShowQueryStatsStatementTestCase extends 
SQLParserTestCase {
+    
+    @XmlElement(name = "database")
+    private ExpectedDatabase database;
+    
+    @XmlElement(name = "from")
+    private ExpectedFromTable from;
+    
+    @XmlAttribute(name = "all")
+    private boolean all;
+    
+    @XmlAttribute(name = "verbose")
+    private boolean verbose;
+}
diff --git a/test/it/parser/src/main/resources/case/dal/kill.xml 
b/test/it/parser/src/main/resources/case/dal/kill.xml
index 0e5d050dc34..8dbdfa69031 100644
--- a/test/it/parser/src/main/resources/case/dal/kill.xml
+++ b/test/it/parser/src/main/resources/case/dal/kill.xml
@@ -19,4 +19,7 @@
 <sql-parser-test-cases>
     <kill sql-case-id="kill_process_id" process-id="abc" />
     <kill sql-case-id="kill_process_with_id" process-id="@id" />
+    <kill sql-case-id="kill_connection_with_numeric_id" process-id="16" />
+    <kill sql-case-id="kill_query_with_numeric_id" process-id="16" />
+    <kill sql-case-id="kill_with_numeric_id" process-id="16" />
 </sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/dal/show.xml 
b/test/it/parser/src/main/resources/case/dal/show.xml
index 158f7b6b9a7..e7399303205 100644
--- a/test/it/parser/src/main/resources/case/dal/show.xml
+++ b/test/it/parser/src/main/resources/case/dal/show.xml
@@ -1071,6 +1071,28 @@
         </filter>
     </show-columns>
 
+    <show-query-stats sql-case-id="show_query_stats" />
+
+    <show-query-stats sql-case-id="show_query_stats_for_database">
+        <database name="baseall" start-index="21" stop-index="27" />
+    </show-query-stats>
+
+    <show-query-stats sql-case-id="show_query_stats_from_table">
+        <from start-index="17" stop-index="31">
+            <table name="test_table" start-index="22" stop-index="31" />
+        </from>
+    </show-query-stats>
+
+    <show-query-stats sql-case-id="show_query_stats_all" all="true" />
+
+    <show-query-stats sql-case-id="show_query_stats_verbose" verbose="true" />
+
+    <show-query-stats sql-case-id="show_query_stats_from_table_all_verbose" 
all="true" verbose="true">
+        <from start-index="17" stop-index="31">
+            <table name="test_table" start-index="22" stop-index="31" />
+        </from>
+    </show-query-stats>
+
     <show sql-case-id="show_functions_basic" />
     <show sql-case-id="show_functions_with_like" />
     <show sql-case-id="show_role_grant_basic" />
diff --git a/test/it/parser/src/main/resources/sql/supported/dal/kill.xml 
b/test/it/parser/src/main/resources/sql/supported/dal/kill.xml
index d3cc51b6776..eecf4c809dc 100644
--- a/test/it/parser/src/main/resources/sql/supported/dal/kill.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dal/kill.xml
@@ -19,4 +19,7 @@
 <sql-cases>
     <sql-case id="kill_process_id" value="KILL abc" db-types="MySQL" />
     <sql-case id="kill_process_with_id" value="KILL QUERY @id" 
db-types="MySQL" />
+    <sql-case id="kill_connection_with_numeric_id" value="KILL CONNECTION 16" 
db-types="Doris" />
+    <sql-case id="kill_query_with_numeric_id" value="KILL QUERY 16" 
db-types="Doris" />
+    <sql-case id="kill_with_numeric_id" value="KILL 16" db-types="Doris" />
 </sql-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dal/show.xml 
b/test/it/parser/src/main/resources/sql/supported/dal/show.xml
index 0ebdfa0697b..7e3e0366596 100644
--- a/test/it/parser/src/main/resources/sql/supported/dal/show.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dal/show.xml
@@ -235,4 +235,10 @@
     <sql-case id="show_compactions_with_limit" value="SHOW COMPACTIONS LIMIT 
10;" db-types="Hive" />
     <sql-case id="show_compactions_with_compaction_ID" value="SHOW COMPACTIONS 
compactionid=1;" db-types="Hive" />
     <sql-case id="show_compactions_all_options" value="SHOW COMPACTIONS 
db1.tbl0 PARTITION (p=101, day='Monday') POOL 'pool0' TYPE 'minor' STATE 'ready 
for cleaning' ORDER BY `start` DESC LIMIT 5;" db-types="Hive" />
+    <sql-case id="show_query_stats" value="SHOW QUERY STATS" db-types="Doris" 
/>
+    <sql-case id="show_query_stats_for_database" value="SHOW QUERY STATS FOR 
baseall" db-types="Doris" />
+    <sql-case id="show_query_stats_from_table" value="SHOW QUERY STATS FROM 
test_table" db-types="Doris" />
+    <sql-case id="show_query_stats_all" value="SHOW QUERY STATS ALL" 
db-types="Doris" />
+    <sql-case id="show_query_stats_verbose" value="SHOW QUERY STATS VERBOSE" 
db-types="Doris" />
+    <sql-case id="show_query_stats_from_table_all_verbose" value="SHOW QUERY 
STATS FROM test_table ALL VERBOSE" db-types="Doris" />
 </sql-cases>

Reply via email to