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 0c60610b7ad Support parsing Doris SHOW/STOP SYNC JOB syntax (#38155)
0c60610b7ad is described below

commit 0c60610b7ad0159ba4119354ea2f1ba72afed3d8
Author: cxy <[email protected]>
AuthorDate: Mon Feb 23 18:40:40 2026 +0800

    Support parsing Doris SHOW/STOP SYNC JOB syntax (#38155)
---
 .../core/database/visitor/SQLVisitorRule.java      |  4 ++
 .../src/main/antlr4/imports/doris/DALStatement.g4  |  5 +++
 .../src/main/antlr4/imports/doris/DDLStatement.g4  |  4 ++
 .../sql/parser/autogen/DorisStatement.g4           |  1 +
 .../statement/type/DorisDALStatementVisitor.java   | 12 +++++
 .../statement/type/DorisDDLStatementVisitor.java   | 13 ++++++
 .../doris/dal/DorisShowSyncJobStatement.java       | 49 +++++++++++++++++++++
 .../doris/ddl/DorisStopSyncJobStatement.java       | 49 +++++++++++++++++++++
 .../dal/dialect/doris/DorisDALStatementAssert.java |  5 +++
 .../type/DorisShowSyncJobStatementAssert.java      | 45 +++++++++++++++++++
 .../ddl/dialect/doris/DorisDDLStatementAssert.java |  4 ++
 .../doris/DorisStopSyncJobStatementAssert.java     | 51 ++++++++++++++++++++++
 .../cases/parser/jaxb/RootSQLParserTestCases.java  |  8 ++++
 .../doris/DorisShowSyncJobStatementTestCase.java   | 39 +++++++++++++++++
 .../doris/DorisStopSyncJobStatementTestCase.java   | 43 ++++++++++++++++++
 .../src/main/resources/case/dal/show-sync-job.xml  | 27 ++++++++++++
 .../src/main/resources/case/ddl/stop-sync-job.xml  | 28 ++++++++++++
 .../resources/sql/supported/dal/show-sync-job.xml  | 23 ++++++++++
 .../resources/sql/supported/ddl/stop-sync-job.xml  | 24 ++++++++++
 19 files changed, 434 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 941fc9333d3..0572ee66864 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
@@ -297,6 +297,10 @@ public enum SQLVisitorRule {
     
     CREATE_SYNC_JOB("CreateSyncJob", SQLStatementType.DDL),
     
+    STOP_SYNC_JOB("StopSyncJob", SQLStatementType.DDL),
+    
+    SHOW_SYNC_JOB("ShowSyncJob", SQLStatementType.DAL),
+    
     ALTER_CATALOG("AlterCatalog", SQLStatementType.DDL),
     
     SET_CONSTRAINTS("SetConstraints", SQLStatementType.TCL),
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 50500ee4ebc..359ba5e5923 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
@@ -505,6 +505,10 @@ showProc
     : SHOW PROC string_
     ;
 
+showSyncJob
+    : SHOW SYNC JOB (FROM databaseName)?
+    ;
+
 binlog
     : BINLOG stringLiterals
     ;
@@ -831,4 +835,5 @@ show
     | showRoutineLoadTask
     | showRoutineLoad
     | showProc
+    | showSyncJob
     ;
diff --git 
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4 
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4
index 077ec7bf497..2326530f188 100644
--- 
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4
+++ 
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4
@@ -973,6 +973,10 @@ pauseSyncJob
     : PAUSE SYNC JOB (owner DOT_)? identifier
     ;
 
+stopSyncJob
+    : STOP SYNC JOB (owner DOT_)? identifier
+    ;
+
 createSyncJob
     : CREATE SYNC (owner DOT_)? identifier LP_ channelDescription (COMMA_ 
channelDescription)* RP_ binlogDescription
     ;
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 93de0c7128c..96d91657da2 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
@@ -143,6 +143,7 @@ execute
     | resumeJob
     | resumeSyncJob
     | pauseSyncJob
+    | stopSyncJob
     | createSyncJob
     | dorisAlterSystem
     | createSqlBlockRule
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 219d8919e96..38e41340752 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
@@ -146,6 +146,7 @@ import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.Propert
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DorisAlterSystemActionContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowQueryStatsContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowProcContext;
+import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowSyncJobContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterSqlBlockRuleContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DropSqlBlockRuleContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowSqlBlockRuleContext;
@@ -214,6 +215,7 @@ import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisDropReposit
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisDropSqlBlockRuleStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowFunctionsStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowProcStatement;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowSyncJobStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowSqlBlockRuleStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowRoutineLoadTaskStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowRoutineLoadStatement;
@@ -1391,4 +1393,14 @@ public final class DorisDALStatementVisitor extends 
DorisStatementVisitor implem
         result.addParameterMarkers(getParameterMarkerSegments());
         return result;
     }
+    
+    @Override
+    public ASTNode visitShowSyncJob(final ShowSyncJobContext ctx) {
+        DorisShowSyncJobStatement result = new 
DorisShowSyncJobStatement(getDatabaseType());
+        if (null != ctx.databaseName()) {
+            result.setFromDatabase((DatabaseSegment) 
visit(ctx.databaseName()));
+        }
+        result.addParameterMarkers(getParameterMarkerSegments());
+        return result;
+    }
 }
diff --git 
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
 
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
index 201a216ae24..9e93f533b7a 100644
--- 
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
+++ 
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
@@ -27,6 +27,7 @@ import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterCa
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ResumeJobContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ResumeSyncJobContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PauseSyncJobContext;
+import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.StopSyncJobContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateSyncJobContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ChannelDescriptionContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.BinlogDescriptionContext;
@@ -236,6 +237,7 @@ import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisResumeJobSt
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisResumeSyncJobStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisPauseSyncJobStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisCreateSyncJobStatement;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisStopSyncJobStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.mysql.ddl.event.MySQLAlterEventStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.mysql.ddl.event.MySQLCreateEventStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.mysql.ddl.event.MySQLDropEventStatement;
@@ -389,6 +391,17 @@ public final class DorisDDLStatementVisitor extends 
DorisStatementVisitor implem
         return result;
     }
     
+    @Override
+    public ASTNode visitStopSyncJob(final StopSyncJobContext ctx) {
+        DorisStopSyncJobStatement result = new 
DorisStopSyncJobStatement(getDatabaseType());
+        JobNameSegment jobName = new 
JobNameSegment(ctx.identifier().start.getStartIndex(), 
ctx.identifier().stop.getStopIndex(), (IdentifierValue) 
visit(ctx.identifier()));
+        if (null != ctx.owner()) {
+            jobName.setOwner((OwnerSegment) visit(ctx.owner()));
+        }
+        result.setJobName(jobName);
+        return result;
+    }
+    
     @Override
     public ASTNode visitCreateSyncJob(final CreateSyncJobContext ctx) {
         DorisCreateSyncJobStatement result = new 
DorisCreateSyncJobStatement(getDatabaseType());
diff --git 
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisShowSyncJobStatement.java
 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisShowSyncJobStatement.java
new file mode 100644
index 00000000000..8f2149c8633
--- /dev/null
+++ 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisShowSyncJobStatement.java
@@ -0,0 +1,49 @@
+/*
+ * 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.generic.DatabaseSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;
+
+import java.util.Optional;
+
+/**
+ * Show sync job statement for Doris.
+ */
+@Getter
+@Setter
+public final class DorisShowSyncJobStatement extends DALStatement {
+    
+    private DatabaseSegment fromDatabase;
+    
+    public DorisShowSyncJobStatement(final DatabaseType databaseType) {
+        super(databaseType);
+    }
+    
+    /**
+     * Get from database segment.
+     *
+     * @return from database segment
+     */
+    public Optional<DatabaseSegment> getFromDatabase() {
+        return Optional.ofNullable(fromDatabase);
+    }
+}
diff --git 
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/ddl/DorisStopSyncJobStatement.java
 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/ddl/DorisStopSyncJobStatement.java
new file mode 100644
index 00000000000..f4074430e8b
--- /dev/null
+++ 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/ddl/DorisStopSyncJobStatement.java
@@ -0,0 +1,49 @@
+/*
+ * 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.ddl;
+
+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.job.JobNameSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.DDLStatement;
+
+import java.util.Optional;
+
+/**
+ * Stop sync job statement for Doris.
+ */
+@Getter
+@Setter
+public final class DorisStopSyncJobStatement extends DDLStatement {
+    
+    private JobNameSegment jobName;
+    
+    public DorisStopSyncJobStatement(final DatabaseType databaseType) {
+        super(databaseType);
+    }
+    
+    /**
+     * Get job name segment.
+     *
+     * @return job name segment
+     */
+    public Optional<JobNameSegment> getJobName() {
+        return Optional.ofNullable(jobName);
+    }
+}
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 709fe264d90..93482afab53 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
@@ -30,6 +30,7 @@ import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisDropReposit
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowFunctionsStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowProcStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowCreateRoutineLoadStatement;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowSyncJobStatement;
 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;
@@ -43,6 +44,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.DorisShowProcStatementAssert;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisShowCreateRoutineLoadStatementAssert;
 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.asserts.statement.dal.dialect.doris.type.DorisShowSyncJobStatementAssert;
 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;
@@ -55,6 +57,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.DorisShowFunctionsStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowProcStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowCreateRoutineLoadStatementTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowSyncJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisSwitchStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisUnsetVariableStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.show.DorisShowQueryStatsStatementTestCase;
@@ -97,6 +100,8 @@ public final class DorisDALStatementAssert {
             DorisShowProcStatementAssert.assertIs(assertContext, 
(DorisShowProcStatement) actual, (DorisShowProcStatementTestCase) expected);
         } else if (actual instanceof DorisShowCreateRoutineLoadStatement) {
             DorisShowCreateRoutineLoadStatementAssert.assertIs(assertContext, 
(DorisShowCreateRoutineLoadStatement) actual, 
(DorisShowCreateRoutineLoadStatementTestCase) expected);
+        } else if (actual instanceof DorisShowSyncJobStatement) {
+            DorisShowSyncJobStatementAssert.assertIs(assertContext, 
(DorisShowSyncJobStatement) actual, (DorisShowSyncJobStatementTestCase) 
expected);
         }
     }
 }
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisShowSyncJobStatementAssert.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisShowSyncJobStatementAssert.java
new file mode 100644
index 00000000000..d3ebb2ceef2
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisShowSyncJobStatementAssert.java
@@ -0,0 +1,45 @@
+/*
+ * 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.DorisShowSyncJobStatement;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.database.DatabaseAssert;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowSyncJobStatementTestCase;
+
+/**
+ * Show sync job statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisShowSyncJobStatementAssert {
+    
+    /**
+     * Assert show sync job statement is correct with expected parser result.
+     *
+     * @param assertContext assert context
+     * @param actual actual show sync job statement
+     * @param expected expected show sync job statement test case
+     */
+    public static void assertIs(final SQLCaseAssertContext assertContext, 
final DorisShowSyncJobStatement actual, final DorisShowSyncJobStatementTestCase 
expected) {
+        if (null != expected.getFromDatabase()) {
+            DatabaseAssert.assertIs(assertContext, 
actual.getFromDatabase().orElse(null), expected.getFromDatabase());
+        }
+    }
+}
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisDDLStatementAssert.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisDDLStatementAssert.java
index 8de054fb40e..1cc91c5a069 100644
--- 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisDDLStatementAssert.java
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisDDLStatementAssert.java
@@ -26,6 +26,7 @@ import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisDropFunctio
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisResumeJobStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisResumeSyncJobStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisPauseSyncJobStatement;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisStopSyncJobStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisCreateSyncJobStatement;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.doris.type.DorisAlterStoragePolicyStatementAssert;
@@ -35,6 +36,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.ddl.dialect.doris.DorisResumeJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisResumeSyncJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisPauseSyncJobStatementTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisStopSyncJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisCreateSyncJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.function.CreateFunctionStatementTestCase;
 
@@ -66,6 +68,8 @@ public final class DorisDDLStatementAssert {
             DorisPauseSyncJobStatementAssert.assertIs(assertContext, 
(DorisPauseSyncJobStatement) actual, (DorisPauseSyncJobStatementTestCase) 
expected);
         } else if (actual instanceof DorisCreateSyncJobStatement) {
             DorisCreateSyncJobStatementAssert.assertIs(assertContext, 
(DorisCreateSyncJobStatement) actual, (DorisCreateSyncJobStatementTestCase) 
expected);
+        } else if (actual instanceof DorisStopSyncJobStatement) {
+            DorisStopSyncJobStatementAssert.assertIs(assertContext, 
(DorisStopSyncJobStatement) actual, (DorisStopSyncJobStatementTestCase) 
expected);
         }
     }
 }
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisStopSyncJobStatementAssert.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisStopSyncJobStatementAssert.java
new file mode 100644
index 00000000000..562b1793c55
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisStopSyncJobStatementAssert.java
@@ -0,0 +1,51 @@
+/*
+ * 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.ddl.dialect.doris;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisStopSyncJobStatement;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.owner.OwnerAssert;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisStopSyncJobStatementTestCase;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+/**
+ * Stop sync job statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisStopSyncJobStatementAssert {
+    
+    /**
+     * Assert stop sync job statement is correct with expected parser result.
+     *
+     * @param assertContext assert context
+     * @param actual actual stop sync job statement
+     * @param expected expected stop sync job statement test case
+     */
+    public static void assertIs(final SQLCaseAssertContext assertContext, 
final DorisStopSyncJobStatement actual, final DorisStopSyncJobStatementTestCase 
expected) {
+        if (actual.getJobName().isPresent()) {
+            assertThat(assertContext.getText("Job name does not match: "), 
actual.getJobName().get().getIdentifier().getValue(), 
is(expected.getJobName()));
+            if (null != expected.getOwner()) {
+                OwnerAssert.assertIs(assertContext, 
actual.getJobName().get().getOwner().orElse(null), expected.getOwner());
+            }
+        }
+    }
+}
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 a0f69cbb133..175fb9d130e 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,12 +32,14 @@ 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.ddl.dialect.doris.DorisResumeJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisResumeSyncJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisPauseSyncJobStatementTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisStopSyncJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisCreateSyncJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAlterSqlBlockRuleStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisDropSqlBlockRuleStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowCreateRoutineLoadStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dml.dialect.doris.DorisStopRoutineLoadStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowProcStatementTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowSyncJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowSqlBlockRuleStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowRoutineLoadTaskStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowRoutineLoadStatementTestCase;
@@ -553,6 +555,12 @@ public final class RootSQLParserTestCases {
     @XmlElement(name = "pause-sync-job")
     private final List<DorisPauseSyncJobStatementTestCase> 
pauseSyncJobTestCases = new LinkedList<>();
     
+    @XmlElement(name = "stop-sync-job")
+    private final List<DorisStopSyncJobStatementTestCase> stopSyncJobTestCases 
= new LinkedList<>();
+    
+    @XmlElement(name = "show-sync-job")
+    private final List<DorisShowSyncJobStatementTestCase> 
dorisShowSyncJobTestCases = new LinkedList<>();
+    
     @XmlElement(name = "create-sync-job")
     private final List<DorisCreateSyncJobStatementTestCase> 
createSyncJobTestCases = 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/DorisShowSyncJobStatementTestCase.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisShowSyncJobStatementTestCase.java
new file mode 100644
index 00000000000..a04aeacb7a6
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisShowSyncJobStatementTestCase.java
@@ -0,0 +1,39 @@
+/*
+ * 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.database.ExpectedDatabase;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Show sync job statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisShowSyncJobStatementTestCase extends SQLParserTestCase 
{
+    
+    @XmlElement(name = "from-database")
+    private ExpectedDatabase fromDatabase;
+}
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/dialect/doris/DorisStopSyncJobStatementTestCase.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/dialect/doris/DorisStopSyncJobStatementTestCase.java
new file mode 100644
index 00000000000..c932bdd0774
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/dialect/doris/DorisStopSyncJobStatementTestCase.java
@@ -0,0 +1,43 @@
+/*
+ * 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.ddl.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.ExpectedOwner;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Stop sync job statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisStopSyncJobStatementTestCase extends SQLParserTestCase 
{
+    
+    @XmlAttribute(name = "job-name")
+    private String jobName;
+    
+    @XmlElement
+    private ExpectedOwner owner;
+}
diff --git a/test/it/parser/src/main/resources/case/dal/show-sync-job.xml 
b/test/it/parser/src/main/resources/case/dal/show-sync-job.xml
new file mode 100644
index 00000000000..69c8546cacd
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/dal/show-sync-job.xml
@@ -0,0 +1,27 @@
+<?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>
+    <show-sync-job sql-case-id="show_sync_job_without_from" />
+    <show-sync-job sql-case-id="show_sync_job_with_from">
+        <from-database name="test_db" start-index="19" stop-index="27" 
start-delimiter="`" end-delimiter="`" />
+    </show-sync-job>
+    <show-sync-job sql-case-id="show_sync_job_from_db">
+        <from-database name="my_database" start-index="19" stop-index="29" />
+    </show-sync-job>
+</sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/ddl/stop-sync-job.xml 
b/test/it/parser/src/main/resources/case/ddl/stop-sync-job.xml
new file mode 100644
index 00000000000..6a2eec8609d
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/ddl/stop-sync-job.xml
@@ -0,0 +1,28 @@
+<?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>
+    <stop-sync-job sql-case-id="stop_sync_job_with_schema" job-name="job_name">
+        <owner name="testdb" start-index="14" stop-index="19" />
+    </stop-sync-job>
+    <stop-sync-job sql-case-id="stop_sync_job_simple" job-name="my_sync_job" />
+    <stop-sync-job sql-case-id="stop_sync_job_with_backticks" 
job-name="sync_job_123" />
+    <stop-sync-job sql-case-id="stop_sync_job_with_schema_backticks" 
job-name="my_job">
+        <owner name="my_db" start-index="14" stop-index="20" 
start-delimiter="`" end-delimiter="`" />
+    </stop-sync-job>
+</sql-parser-test-cases>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/dal/show-sync-job.xml 
b/test/it/parser/src/main/resources/sql/supported/dal/show-sync-job.xml
new file mode 100644
index 00000000000..79aa9b3e86f
--- /dev/null
+++ b/test/it/parser/src/main/resources/sql/supported/dal/show-sync-job.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="show_sync_job_without_from" value="SHOW SYNC JOB" 
db-types="Doris" />
+    <sql-case id="show_sync_job_with_from" value="SHOW SYNC JOB FROM 
`test_db`" db-types="Doris" />
+    <sql-case id="show_sync_job_from_db" value="SHOW SYNC JOB FROM 
my_database" db-types="Doris" />
+</sql-cases>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/ddl/stop-sync-job.xml 
b/test/it/parser/src/main/resources/sql/supported/ddl/stop-sync-job.xml
new file mode 100644
index 00000000000..0208215e76d
--- /dev/null
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/stop-sync-job.xml
@@ -0,0 +1,24 @@
+<?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="stop_sync_job_with_schema" value="STOP SYNC JOB 
testdb.job_name" db-types="Doris" />
+    <sql-case id="stop_sync_job_simple" value="STOP SYNC JOB my_sync_job" 
db-types="Doris" />
+    <sql-case id="stop_sync_job_with_backticks" value="STOP SYNC JOB 
`sync_job_123`" db-types="Doris" />
+    <sql-case id="stop_sync_job_with_schema_backticks" value="STOP SYNC JOB 
`my_db`.`my_job`" db-types="Doris" />
+</sql-cases>


Reply via email to