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 27597b0c49c Support parsing Doris SHOW CREATE/STOP ROUTINE LOAD syntax
(#38149)
27597b0c49c is described below
commit 27597b0c49cbe54cf3856b6a8e9051260a12de54
Author: cxy <[email protected]>
AuthorDate: Mon Feb 23 11:10:20 2026 +0800
Support parsing Doris SHOW CREATE/STOP ROUTINE LOAD syntax (#38149)
---
.../core/database/visitor/SQLVisitorRule.java | 4 ++
.../src/main/antlr4/imports/doris/DALStatement.g4 | 5 +++
.../src/main/antlr4/imports/doris/DMLStatement.g4 | 4 ++
.../sql/parser/autogen/DorisStatement.g4 | 1 +
.../statement/type/DorisDALStatementVisitor.java | 13 ++++++
.../statement/type/DorisDMLStatementVisitor.java | 17 ++++++++
.../dal/DorisShowCreateRoutineLoadStatement.java | 51 ++++++++++++++++++++++
.../doris/dml/DorisStopRoutineLoadStatement.java | 49 +++++++++++++++++++++
.../dal/dialect/doris/DorisDALStatementAssert.java | 5 +++
.../DorisShowCreateRoutineLoadStatementAssert.java | 51 ++++++++++++++++++++++
.../dml/dialect/doris/DorisDMLStatementAssert.java | 4 ++
.../doris/DorisStopRoutineLoadStatementAssert.java | 50 +++++++++++++++++++++
.../cases/parser/jaxb/RootSQLParserTestCases.java | 8 ++++
...orisShowCreateRoutineLoadStatementTestCase.java | 46 +++++++++++++++++++
.../DorisStopRoutineLoadStatementTestCase.java | 43 ++++++++++++++++++
.../case/dal/show-create-routine-load.xml | 27 ++++++++++++
.../main/resources/case/dml/stop-routine-load.xml | 25 +++++++++++
.../sql/supported/dal/show-create-routine-load.xml | 23 ++++++++++
.../sql/supported/dml/stop-routine-load.xml | 22 ++++++++++
19 files changed, 448 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 04685c67bb1..941fc9333d3 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
@@ -431,6 +431,10 @@ public enum SQLVisitorRule {
RESUME_ROUTINE_LOAD("ResumeRoutineLoad", SQLStatementType.DML),
+ STOP_ROUTINE_LOAD("StopRoutineLoad", SQLStatementType.DML),
+
+ SHOW_CREATE_ROUTINE_LOAD("ShowCreateRoutineLoad", SQLStatementType.DAL),
+
SHOW_CREATE_TABLE("ShowCreateTable", SQLStatementType.DAL),
SHOW_OTHER("ShowOther", 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 b019faa979a..50500ee4ebc 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
@@ -138,6 +138,10 @@ showCreateTable
: SHOW CREATE TABLE tableName
;
+showCreateRoutineLoad
+ : SHOW ALL? CREATE ROUTINE LOAD FOR qualifiedJobName
+ ;
+
showCreateTrigger
: SHOW CREATE TRIGGER triggerName
;
@@ -791,6 +795,7 @@ show
| showCreateEvent
| showCreateFunction
| showCreateProcedure
+ | showCreateRoutineLoad
| showCreateTrigger
| showCreateUser
| showCreateView
diff --git
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DMLStatement.g4
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DMLStatement.g4
index a85ea71f89e..257537690b2 100644
---
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DMLStatement.g4
+++
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DMLStatement.g4
@@ -275,6 +275,10 @@ resumeRoutineLoad
: RESUME (ALL ROUTINE LOAD | (ROUTINE LOAD FOR (owner DOT_)? jobName))
;
+stopRoutineLoad
+ : STOP ROUTINE LOAD FOR (owner DOT_)? jobName
+ ;
+
loadDataStatement
: LOAD DATA
(LOW_PRIORITY | CONCURRENT)? LOCAL?
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 c17be2b7bee..93de0c7128c 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
@@ -90,6 +90,7 @@ execute
| alterRoutineLoad
| pauseRoutineLoad
| resumeRoutineLoad
+ | stopRoutineLoad
| cacheIndex
| loadIndexInfo
| optimizeTable
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 2ad85bc5d5c..219d8919e96 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
@@ -81,6 +81,7 @@ import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowCre
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowCreateEventContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowCreateFunctionContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowCreateProcedureContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowCreateRoutineLoadContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowCreateTableContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowCreateTriggerContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowCreateUserContext;
@@ -216,6 +217,7 @@ import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowProcSta
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;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowCreateRoutineLoadStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisSyncStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.segment.dal.RepositoryNameSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.ShowBuildIndexStatement;
@@ -1248,6 +1250,17 @@ public final class DorisDALStatementVisitor extends
DorisStatementVisitor implem
return result;
}
+ @Override
+ public ASTNode visitShowCreateRoutineLoad(final
ShowCreateRoutineLoadContext ctx) {
+ DorisShowCreateRoutineLoadStatement result = new
DorisShowCreateRoutineLoadStatement(getDatabaseType());
+ result.setAll(null != ctx.ALL());
+ if (null != ctx.qualifiedJobName()) {
+ result.setJobName((JobNameSegment) visit(ctx.qualifiedJobName()));
+ }
+ result.addParameterMarkers(getParameterMarkerSegments());
+ return result;
+ }
+
@Override
public ASTNode visitQualifiedJobName(final QualifiedJobNameContext ctx) {
int startIndex = ctx.start.getStartIndex();
diff --git
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDMLStatementVisitor.java
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDMLStatementVisitor.java
index 62dd4479826..d05241e9239 100644
---
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDMLStatementVisitor.java
+++
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDMLStatementVisitor.java
@@ -29,6 +29,7 @@ import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateR
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DataSourcePropertyContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PauseRoutineLoadContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ResumeRoutineLoadContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.StopRoutineLoadContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DoStatementContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.HandlerStatementContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ImportStatementContext;
@@ -70,6 +71,7 @@ import
org.apache.shardingsphere.sql.parser.statement.doris.dml.DorisAlterRoutin
import
org.apache.shardingsphere.sql.parser.statement.doris.dml.DorisCreateRoutineLoadStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dml.DorisPauseRoutineLoadStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dml.DorisResumeRoutineLoadStatement;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dml.DorisStopRoutineLoadStatement;
import
org.apache.shardingsphere.sql.parser.statement.mysql.dml.MySQLHandlerStatement;
import
org.apache.shardingsphere.sql.parser.statement.mysql.dml.MySQLImportStatement;
import
org.apache.shardingsphere.sql.parser.statement.mysql.dml.MySQLLoadDataStatement;
@@ -277,6 +279,21 @@ public final class DorisDMLStatementVisitor extends
DorisStatementVisitor implem
return result;
}
+ @Override
+ public ASTNode visitStopRoutineLoad(final StopRoutineLoadContext ctx) {
+ DorisStopRoutineLoadStatement result = new
DorisStopRoutineLoadStatement(getDatabaseType());
+ if (null != ctx.jobName()) {
+ JobNameSegment jobName = new
JobNameSegment(ctx.jobName().start.getStartIndex(),
ctx.jobName().stop.getStopIndex(), new
IdentifierValue(ctx.jobName().getText()));
+ if (null != ctx.owner()) {
+ OwnerSegment owner = (OwnerSegment) visit(ctx.owner());
+ jobName.setOwner(owner);
+ }
+ result.setJobName(jobName);
+ }
+ result.addParameterMarkers(getParameterMarkerSegments());
+ return result;
+ }
+
private void processColumnMappings(final ColumnsClauseContext
columnsClauseCtx, final DorisCreateRoutineLoadStatement statement) {
for (int i = 0; i < columnsClauseCtx.columnMapping().size(); i++) {
ColumnMappingContext mappingCtx =
columnsClauseCtx.columnMapping(i);
diff --git
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisShowCreateRoutineLoadStatement.java
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisShowCreateRoutineLoadStatement.java
new file mode 100644
index 00000000000..0fbdc498918
--- /dev/null
+++
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisShowCreateRoutineLoadStatement.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.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.dal.JobNameSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;
+
+import java.util.Optional;
+
+/**
+ * Doris show create routine load statement.
+ */
+@Getter
+@Setter
+public final class DorisShowCreateRoutineLoadStatement extends DALStatement {
+
+ private boolean all;
+
+ private JobNameSegment jobName;
+
+ public DorisShowCreateRoutineLoadStatement(final DatabaseType
databaseType) {
+ super(databaseType);
+ }
+
+ /**
+ * Get job name segment.
+ *
+ * @return job name segment
+ */
+ public Optional<JobNameSegment> getJobName() {
+ return Optional.ofNullable(jobName);
+ }
+}
diff --git
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dml/DorisStopRoutineLoadStatement.java
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dml/DorisStopRoutineLoadStatement.java
new file mode 100644
index 00000000000..c58a4e1d36d
--- /dev/null
+++
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dml/DorisStopRoutineLoadStatement.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.dml;
+
+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.dml.DMLStatement;
+
+import java.util.Optional;
+
+/**
+ * Doris stop routine load statement.
+ */
+@Getter
+@Setter
+public final class DorisStopRoutineLoadStatement extends DMLStatement {
+
+ private JobNameSegment jobName;
+
+ public DorisStopRoutineLoadStatement(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 0fe7bc17269..709fe264d90 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
@@ -29,6 +29,7 @@ import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisDescFunctio
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisDropRepositoryStatement;
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.DorisSwitchStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.show.DorisShowQueryStatsStatement;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
@@ -40,6 +41,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.DorisDropRepositoryStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisShowFunctionsStatementAssert;
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.DorisSwitchStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisUnsetVariableStatementAssert;
@@ -52,6 +54,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.DorisDropRepositoryStatementTestCase;
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.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;
@@ -92,6 +95,8 @@ public final class DorisDALStatementAssert {
DorisDescFunctionStatementAssert.assertIs(assertContext,
(DorisDescFunctionStatement) actual, (DorisDescFunctionStatementTestCase)
expected);
} else if (actual instanceof DorisShowProcStatement) {
DorisShowProcStatementAssert.assertIs(assertContext,
(DorisShowProcStatement) actual, (DorisShowProcStatementTestCase) expected);
+ } else if (actual instanceof DorisShowCreateRoutineLoadStatement) {
+ DorisShowCreateRoutineLoadStatementAssert.assertIs(assertContext,
(DorisShowCreateRoutineLoadStatement) actual,
(DorisShowCreateRoutineLoadStatementTestCase) expected);
}
}
}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisShowCreateRoutineLoadStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisShowCreateRoutineLoadStatementAssert.java
new file mode 100644
index 00000000000..40974db2c61
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisShowCreateRoutineLoadStatementAssert.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.dal.dialect.doris.type;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisShowCreateRoutineLoadStatement;
+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.DorisShowCreateRoutineLoadStatementTestCase;
+import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
+
+/**
+ * Show create routine load statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisShowCreateRoutineLoadStatementAssert {
+
+ /**
+ * Assert show create routine load statement is correct with expected
parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual show create routine load statement
+ * @param expected expected show create routine load statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext,
final DorisShowCreateRoutineLoadStatement actual, final
DorisShowCreateRoutineLoadStatementTestCase expected) {
+ MatcherAssert.assertThat(assertContext.getText("All flag does not
match: "), actual.isAll(), CoreMatchers.is(expected.isAll()));
+ if (actual.getJobName().isPresent()) {
+ MatcherAssert.assertThat(assertContext.getText("Job name does not
match: "), actual.getJobName().get().getIdentifier().getValue(),
CoreMatchers.is(expected.getJobName()));
+ if (null != expected.getDatabase()) {
+ DatabaseAssert.assertIs(assertContext,
actual.getJobName().get().getDatabase().orElse(null), expected.getDatabase());
+ }
+ }
+ }
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/dialect/doris/DorisDMLStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/dialect/doris/DorisDMLStatementAssert.java
index ad8f31f900a..8909d95d138 100644
---
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/dialect/doris/DorisDMLStatementAssert.java
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/dialect/doris/DorisDMLStatementAssert.java
@@ -24,12 +24,14 @@ import
org.apache.shardingsphere.sql.parser.statement.doris.dml.DorisAlterRoutin
import
org.apache.shardingsphere.sql.parser.statement.doris.dml.DorisCreateRoutineLoadStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dml.DorisPauseRoutineLoadStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dml.DorisResumeRoutineLoadStatement;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dml.DorisStopRoutineLoadStatement;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
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.dml.dialect.doris.DorisAlterRoutineLoadStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dml.dialect.doris.DorisCreateRoutineLoadStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dml.dialect.doris.DorisPauseRoutineLoadStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dml.dialect.doris.DorisResumeRoutineLoadStatementTestCase;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dml.dialect.doris.DorisStopRoutineLoadStatementTestCase;
/**
* Doris DML statement assert.
@@ -53,6 +55,8 @@ public final class DorisDMLStatementAssert {
DorisPauseRoutineLoadStatementAssert.assertIs(assertContext,
(DorisPauseRoutineLoadStatement) actual,
(DorisPauseRoutineLoadStatementTestCase) expected);
} else if (actual instanceof DorisResumeRoutineLoadStatement) {
DorisResumeRoutineLoadStatementAssert.assertIs(assertContext,
(DorisResumeRoutineLoadStatement) actual,
(DorisResumeRoutineLoadStatementTestCase) expected);
+ } else if (actual instanceof DorisStopRoutineLoadStatement) {
+ DorisStopRoutineLoadStatementAssert.assertIs(assertContext,
(DorisStopRoutineLoadStatement) actual, (DorisStopRoutineLoadStatementTestCase)
expected);
}
}
}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/dialect/doris/DorisStopRoutineLoadStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/dialect/doris/DorisStopRoutineLoadStatementAssert.java
new file mode 100644
index 00000000000..79114022404
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/dialect/doris/DorisStopRoutineLoadStatementAssert.java
@@ -0,0 +1,50 @@
+/*
+ * 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.dml.dialect.doris;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dml.DorisStopRoutineLoadStatement;
+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.dml.dialect.doris.DorisStopRoutineLoadStatementTestCase;
+import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
+
+/**
+ * Stop routine load statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisStopRoutineLoadStatementAssert {
+
+ /**
+ * Assert stop routine load statement is correct with expected parser
result.
+ *
+ * @param assertContext assert context
+ * @param actual actual stop routine load statement
+ * @param expected expected stop routine load statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext,
final DorisStopRoutineLoadStatement actual, final
DorisStopRoutineLoadStatementTestCase expected) {
+ if (actual.getJobName().isPresent()) {
+ MatcherAssert.assertThat(assertContext.getText("Job name does not
match: "), actual.getJobName().get().getIdentifier().getValue(),
CoreMatchers.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 3470feef953..a0f69cbb133 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
@@ -35,6 +35,8 @@ 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.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.DorisShowSqlBlockRuleStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowRoutineLoadTaskStatementTestCase;
@@ -635,6 +637,12 @@ public final class RootSQLParserTestCases {
@XmlElement(name = "resume-routine-load")
private final List<DorisResumeRoutineLoadStatementTestCase>
resumeRoutineLoadTestCases = new LinkedList<>();
+ @XmlElement(name = "show-create-routine-load")
+ private final List<DorisShowCreateRoutineLoadStatementTestCase>
showCreateRoutineLoadTestCases = new LinkedList<>();
+
+ @XmlElement(name = "stop-routine-load")
+ private final List<DorisStopRoutineLoadStatementTestCase>
stopRoutineLoadTestCases = new LinkedList<>();
+
@XmlElement(name = "set-constraints")
private final List<SetConstraintsStatementTestCase>
setConstraintsTestCases = 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/DorisShowCreateRoutineLoadStatementTestCase.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisShowCreateRoutineLoadStatementTestCase.java
new file mode 100644
index 00000000000..95e9d25d12a
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisShowCreateRoutineLoadStatementTestCase.java
@@ -0,0 +1,46 @@
+/*
+ * 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.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Doris show create routine load statement test case.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisShowCreateRoutineLoadStatementTestCase extends
SQLParserTestCase {
+
+ @XmlAttribute
+ private boolean all;
+
+ @XmlAttribute(name = "job-name")
+ private String jobName;
+
+ @XmlElement
+ private ExpectedDatabase database;
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dml/dialect/doris/DorisStopRoutineLoadStatementTestCase.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dml/dialect/doris/DorisStopRoutineLoadStatementTestCase.java
new file mode 100644
index 00000000000..d441bca89fb
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dml/dialect/doris/DorisStopRoutineLoadStatementTestCase.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.dml.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;
+
+/**
+ * Doris stop routine load statement test case.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisStopRoutineLoadStatementTestCase 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-create-routine-load.xml
b/test/it/parser/src/main/resources/case/dal/show-create-routine-load.xml
new file mode 100644
index 00000000000..262200cc082
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/dal/show-create-routine-load.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-create-routine-load sql-case-id="show_create_routine_load_simple"
job-name="test_load" all="false" />
+
+ <show-create-routine-load
sql-case-id="show_create_routine_load_with_owner" job-name="job1" all="false">
+ <database name="db1" start-index="29" stop-index="31" />
+ </show-create-routine-load>
+
+ <show-create-routine-load sql-case-id="show_create_routine_load_all"
job-name="test_load" all="true" />
+</sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/dml/stop-routine-load.xml
b/test/it/parser/src/main/resources/case/dml/stop-routine-load.xml
new file mode 100644
index 00000000000..9e0c42a2ab5
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/dml/stop-routine-load.xml
@@ -0,0 +1,25 @@
+<?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-routine-load sql-case-id="stop_routine_load_simple" job-name="test1"
/>
+
+ <stop-routine-load sql-case-id="stop_routine_load_with_owner"
job-name="test1">
+ <owner name="example_db" start-index="22" stop-index="31" />
+ </stop-routine-load>
+</sql-parser-test-cases>
diff --git
a/test/it/parser/src/main/resources/sql/supported/dal/show-create-routine-load.xml
b/test/it/parser/src/main/resources/sql/supported/dal/show-create-routine-load.xml
new file mode 100644
index 00000000000..5d940d285fc
--- /dev/null
+++
b/test/it/parser/src/main/resources/sql/supported/dal/show-create-routine-load.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_create_routine_load_simple" value="SHOW CREATE ROUTINE
LOAD for test_load" db-types="Doris" />
+ <sql-case id="show_create_routine_load_with_owner" value="SHOW CREATE
ROUTINE LOAD for db1.job1" db-types="Doris" />
+ <sql-case id="show_create_routine_load_all" value="SHOW ALL CREATE ROUTINE
LOAD for test_load" db-types="Doris" />
+</sql-cases>
diff --git
a/test/it/parser/src/main/resources/sql/supported/dml/stop-routine-load.xml
b/test/it/parser/src/main/resources/sql/supported/dml/stop-routine-load.xml
new file mode 100644
index 00000000000..c51dd28e124
--- /dev/null
+++ b/test/it/parser/src/main/resources/sql/supported/dml/stop-routine-load.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="stop_routine_load_simple" value="STOP ROUTINE LOAD FOR
test1" db-types="Doris" />
+ <sql-case id="stop_routine_load_with_owner" value="STOP ROUTINE LOAD FOR
example_db.test1" db-types="Doris" />
+</sql-cases>