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 d47c7d6b6ee Support for the ALTER CATALOG statement and the RESUME JOB
statement (#37491)
d47c7d6b6ee is described below
commit d47c7d6b6eee6bf18a7911534ed4967cab997555
Author: cxy <[email protected]>
AuthorDate: Thu Dec 25 13:09:15 2025 +0800
Support for the ALTER CATALOG statement and the RESUME JOB statement
(#37491)
* Support for the ALTER CATALOG statement and the RESUME JOB statement
* Support for the ALTER CATALOG statement and the RESUME JOB statement
---
.../core/database/visitor/SQLVisitorRule.java | 4 +
.../src/main/antlr4/imports/doris/BaseRule.g4 | 9 +++
.../src/main/antlr4/imports/doris/DDLStatement.g4 | 9 +++
.../src/main/antlr4/imports/doris/DorisKeyword.g4 | 4 +
.../sql/parser/autogen/DorisStatement.g4 | 1 +
.../statement/type/DorisDDLStatementVisitor.java | 33 ++++++++
.../type/ddl/catalog/AlterCatalogStatement.java | 65 ++++++++++++++++
.../doris/ddl/DorisResumeJobStatement.java | 36 +++++++++
.../asserts/segment/catalog/CatalogAssert.java | 91 ++++++++++++++++++++++
.../asserts/statement/ddl/DDLStatementAssert.java | 2 +
.../doris/DorisDDLStatementAssert.java} | 21 +++--
.../doris/DorisResumeJobStatementAssert.java} | 32 ++++----
.../ddl/standard/StandardDDLStatementAssert.java | 5 ++
.../standard/type/AlterCatalogStatementAssert.java | 74 ++++++++++++++++++
.../cases/parser/jaxb/RootSQLParserTestCases.java | 8 ++
.../impl/catalog/ExpectedCatalogComment.java | 38 +++++++++
.../segment/impl/catalog/ExpectedCatalogName.java | 34 ++++++++
.../impl/catalog/ExpectedCatalogProperties.java | 39 ++++++++++
.../impl/catalog/ExpectedCatalogProperty.java | 41 ++++++++++
.../impl/catalog/ExpectedRenameCatalog.java | 38 +++++++++
.../doris/DorisResumeJobStatementTestCase.java | 38 +++++++++
.../catalog/AlterCatalogStatementTestCase.java | 48 ++++++++++++
.../src/main/resources/case/ddl/alter-catalog.xml | 41 ++++++++++
.../src/main/resources/case/ddl/resume-job.xml | 29 +++++++
.../resources/sql/supported/ddl/alter-catalog.xml | 24 ++++++
.../resources/sql/supported/ddl/resume-job.xml | 23 ++++++
26 files changed, 758 insertions(+), 29 deletions(-)
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 99162f1e29e..410a2611d7d 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
@@ -275,6 +275,10 @@ public enum SQLVisitorRule {
UNLISTEN("Unlisten", SQLStatementType.DDL),
+ RESUME_JOB("ResumeJob", SQLStatementType.DDL),
+
+ ALTER_CATALOG("AlterCatalog", SQLStatementType.DDL),
+
SET_CONSTRAINTS("SetConstraints", SQLStatementType.TCL),
SET_TRANSACTION("SetTransaction", SQLStatementType.TCL),
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 81e18359d07..85113a5d9ae 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
@@ -585,6 +585,7 @@ identifierKeywordsAmbiguous2Labels
identifierKeywordsAmbiguous3Roles
: EVENT
| FILE
+ | JOB
| NONE
| PROCESS
| PROXY
@@ -671,6 +672,14 @@ databaseNames
: databaseName (COMMA_ databaseName)*
;
+jobName
+ : identifier
+ ;
+
+catalogName
+ : identifier
+ ;
+
charsetName
: textOrIdentifier | BINARY | DEFAULT
;
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 76d6b681d16..fadc6185096 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
@@ -29,6 +29,7 @@ alterStatement
| alterLogfileGroup
| alterInstance
| alterServer
+ | alterCatalog
;
createTable
@@ -266,6 +267,10 @@ dropDatabase
: DROP (DATABASE | SCHEMA) ifExists? databaseName
;
+alterCatalog
+ : ALTER CATALOG catalogName (RENAME identifier | SET PROPERTIES LP_
properties RP_ | MODIFY COMMENT string_)
+ ;
+
alterInstance
: ALTER INSTANCE instanceAction
;
@@ -899,6 +904,10 @@ signalInformationItem
: conditionInformationItemName EQ_ expr
;
+resumeJob
+ : RESUME JOB WHERE jobName EQ_ stringLiterals
+ ;
+
prepare
: PREPARE identifier FROM (stringLiterals | userVariable)
;
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 fbcf6c4debc..500f9648758 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
@@ -1220,6 +1220,10 @@ JSON_VALUE
: J S O N UL_ V A L U E
;
+JOB
+ : J O B
+ ;
+
KEY
: K E Y
;
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 b41b1ebe08d..a4a928d7c73 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
@@ -132,6 +132,7 @@ execute
| delimiter
| startReplica
| createMaterializedView
+ | resumeJob
// TODO consider refactor following sytax to SEMI_? EOF
) (SEMI_ EOF? | EOF)
| EOF
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 ae0eed35d1e..dade6bd0a3e 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
@@ -23,6 +23,8 @@ import org.antlr.v4.runtime.misc.Interval;
import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
import org.apache.shardingsphere.sql.parser.api.ASTNode;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.type.DDLStatementVisitor;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterCatalogContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ResumeJobContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AddColumnContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AddTableConstraintContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterAlgorithmOptionContext;
@@ -154,6 +156,7 @@ import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.De
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.ExecuteStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.PrepareStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.TruncateStatement;
+import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.catalog.AlterCatalogStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.database.AlterDatabaseStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.database.CreateDatabaseStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.database.DropDatabaseStatement;
@@ -186,8 +189,10 @@ import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.De
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.InsertStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.SelectStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.UpdateStatement;
+import org.apache.shardingsphere.sql.parser.statement.core.util.SQLUtils;
import
org.apache.shardingsphere.sql.parser.statement.core.value.collection.CollectionValue;
import
org.apache.shardingsphere.sql.parser.statement.core.value.identifier.IdentifierValue;
+import
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisResumeJobStatement;
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;
@@ -254,6 +259,34 @@ public final class DorisDDLStatementVisitor extends
DorisStatementVisitor implem
return new DropDatabaseStatement(getDatabaseType(), new
IdentifierValue(ctx.databaseName().getText()).getValue(), null !=
ctx.ifExists());
}
+ @Override
+ public ASTNode visitAlterCatalog(final AlterCatalogContext ctx) {
+ AlterCatalogStatement result = new
AlterCatalogStatement(getDatabaseType());
+ result.setCatalogName(new
IdentifierValue(ctx.catalogName().getText()).getValue());
+ if (null != ctx.RENAME()) {
+ result.setNewCatalogName(new
IdentifierValue(ctx.identifier().getText()).getValue());
+ }
+ if (null != ctx.PROPERTIES()) {
+ for (int i = 0; i < ctx.properties().property().size(); i++) {
+ String key = null !=
ctx.properties().property(i).SINGLE_QUOTED_TEXT()
+ ?
SQLUtils.getExactlyValue(ctx.properties().property(i).SINGLE_QUOTED_TEXT().getText())
+ :
SQLUtils.getExactlyValue(ctx.properties().property(i).identifier().getText());
+ String value =
SQLUtils.getExactlyValue(ctx.properties().property(i).literals().getText());
+ result.getProperties().put(key, value);
+ }
+ }
+ if (null != ctx.COMMENT()) {
+
result.setComment(SQLUtils.getExactlyValue(ctx.string_().getText()));
+ }
+ return result;
+ }
+
+ @Override
+ public ASTNode visitResumeJob(final ResumeJobContext ctx) {
+ String jobName =
SQLUtils.getExactlyValue(ctx.stringLiterals().getText());
+ return new DorisResumeJobStatement(getDatabaseType(), jobName);
+ }
+
@SuppressWarnings("unchecked")
@Override
public ASTNode visitCreateTable(final CreateTableContext ctx) {
diff --git
a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/catalog/AlterCatalogStatement.java
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/catalog/AlterCatalogStatement.java
new file mode 100644
index 00000000000..e64d90df491
--- /dev/null
+++
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/catalog/AlterCatalogStatement.java
@@ -0,0 +1,65 @@
+/*
+ * 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.core.statement.type.ddl.catalog;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.DDLStatement;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * Alter catalog statement.
+ */
+@Getter
+@Setter
+public final class AlterCatalogStatement extends DDLStatement {
+
+ private String catalogName;
+
+ private String newCatalogName;
+
+ private String comment;
+
+ private Map<String, String> properties = new LinkedHashMap<>();
+
+ public AlterCatalogStatement(final DatabaseType databaseType) {
+ super(databaseType);
+ }
+
+ /**
+ * Get new catalog name.
+ *
+ * @return new catalog name
+ */
+ public Optional<String> getNewCatalogName() {
+ return Optional.ofNullable(newCatalogName);
+ }
+
+ /**
+ * Get comment.
+ *
+ * @return comment
+ */
+ public Optional<String> getComment() {
+ return Optional.ofNullable(comment);
+ }
+}
diff --git
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/ddl/DorisResumeJobStatement.java
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/ddl/DorisResumeJobStatement.java
new file mode 100644
index 00000000000..935bc0aaaa6
--- /dev/null
+++
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/ddl/DorisResumeJobStatement.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.sql.parser.statement.doris.ddl;
+
+import lombok.Getter;
+import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.DDLStatement;
+
+/**
+ * Resume job statement for Doris.
+ */
+@Getter
+public final class DorisResumeJobStatement extends DDLStatement {
+
+ private final String jobName;
+
+ public DorisResumeJobStatement(final DatabaseType databaseType, final
String jobName) {
+ super(databaseType);
+ this.jobName = jobName;
+ }
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/catalog/CatalogAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/catalog/CatalogAssert.java
new file mode 100644
index 00000000000..976a89ffb54
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/catalog/CatalogAssert.java
@@ -0,0 +1,91 @@
+/*
+ * 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.segment.catalog;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog.ExpectedCatalogComment;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog.ExpectedCatalogProperties;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog.ExpectedCatalogName;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog.ExpectedCatalogProperty;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog.ExpectedRenameCatalog;
+
+import java.util.Map;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Catalog assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class CatalogAssert {
+
+ /**
+ * Assert catalog name is correct with expected catalog name.
+ *
+ * @param assertContext assert context
+ * @param actual actual catalog name
+ * @param expected expected catalog name
+ */
+ public static void assertCatalogName(final SQLCaseAssertContext
assertContext, final String actual, final ExpectedCatalogName expected) {
+ assertThat(assertContext.getText("Catalog name assertion error: "),
actual, is(expected.getName()));
+ }
+
+ /**
+ * Assert rename catalog is correct with expected rename catalog.
+ *
+ * @param assertContext assert context
+ * @param actual actual new catalog name
+ * @param expected expected rename catalog
+ */
+ public static void assertRenameCatalog(final SQLCaseAssertContext
assertContext, final String actual, final ExpectedRenameCatalog expected) {
+ assertThat(assertContext.getText("Rename catalog assertion error: "),
actual, is(expected.getValue()));
+ }
+
+ /**
+ * Assert properties are correct with expected properties.
+ *
+ * @param assertContext assert context
+ * @param actual actual properties
+ * @param expected expected properties
+ */
+ public static void assertProperties(final SQLCaseAssertContext
assertContext, final Map<String, String> actual, final
ExpectedCatalogProperties expected) {
+ assertThat(assertContext.getText("Properties size assertion error: "),
actual.size(), is(expected.getProperties().size()));
+ for (ExpectedCatalogProperty each : expected.getProperties()) {
+ assertProperty(assertContext, actual, each);
+ }
+ }
+
+ private static void assertProperty(final SQLCaseAssertContext
assertContext, final Map<String, String> actual, final ExpectedCatalogProperty
expected) {
+ assertThat(assertContext.getText(String.format("Property key '%s'
assertion error: ", expected.getKey())), actual.containsKey(expected.getKey()),
is(true));
+ assertThat(assertContext.getText(String.format("Property value '%s'
assertion error: ", expected.getKey())), actual.get(expected.getKey()),
is(expected.getValue()));
+ }
+
+ /**
+ * Assert catalog comment is correct with expected catalog comment.
+ *
+ * @param assertContext assert context
+ * @param actual actual comment
+ * @param expected expected catalog comment
+ */
+ public static void assertCatalogComment(final SQLCaseAssertContext
assertContext, final String actual, final ExpectedCatalogComment expected) {
+ assertThat(assertContext.getText("Catalog comment assertion error: "),
actual, is(expected.getValue()));
+ }
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/DDLStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/DDLStatementAssert.java
index 3255fdb1362..396c02fa7db 100644
---
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/DDLStatementAssert.java
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/DDLStatementAssert.java
@@ -21,6 +21,7 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.DDLStatement;
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.DorisDDLStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.oracle.OracleDDLStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.postgresql.PostgreSQLDDLStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.sqlserver.SQLServerDDLStatementAssert;
@@ -45,5 +46,6 @@ public final class DDLStatementAssert {
PostgreSQLDDLStatementAssert.assertIs(assertContext, actual, expected);
OracleDDLStatementAssert.assertIs(assertContext, actual, expected);
SQLServerDDLStatementAssert.assertIs(assertContext, actual, expected);
+ DorisDDLStatementAssert.assertIs(assertContext, actual, expected);
}
}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/DDLStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisDDLStatementAssert.java
similarity index 62%
copy from
test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/DDLStatementAssert.java
copy to
test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisDDLStatementAssert.java
index 3255fdb1362..019cd340f4a 100644
---
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/DDLStatementAssert.java
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisDDLStatementAssert.java
@@ -15,35 +15,32 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl;
+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.core.statement.type.ddl.DDLStatement;
+import
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisResumeJobStatement;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.oracle.OracleDDLStatementAssert;
-import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.postgresql.PostgreSQLDDLStatementAssert;
-import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.sqlserver.SQLServerDDLStatementAssert;
-import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.standard.StandardDDLStatementAssert;
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.ddl.dialect.doris.DorisResumeJobStatementTestCase;
/**
- * DDL statement assert.
+ * DDL statement assert for Doris.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class DDLStatementAssert {
+public final class DorisDDLStatementAssert {
/**
* Assert DDL statement is correct with expected parser result.
*
* @param assertContext assert context
* @param actual actual DDL statement
- * @param expected expected parser result
+ * @param expected expected DDL statement test case
*/
public static void assertIs(final SQLCaseAssertContext assertContext,
final DDLStatement actual, final SQLParserTestCase expected) {
- StandardDDLStatementAssert.assertIs(assertContext, actual, expected);
- PostgreSQLDDLStatementAssert.assertIs(assertContext, actual, expected);
- OracleDDLStatementAssert.assertIs(assertContext, actual, expected);
- SQLServerDDLStatementAssert.assertIs(assertContext, actual, expected);
+ if (actual instanceof DorisResumeJobStatement) {
+ DorisResumeJobStatementAssert.assertIs(assertContext,
(DorisResumeJobStatement) actual, (DorisResumeJobStatementTestCase) expected);
+ }
}
}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/DDLStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisResumeJobStatementAssert.java
similarity index 50%
copy from
test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/DDLStatementAssert.java
copy to
test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisResumeJobStatementAssert.java
index 3255fdb1362..2bfdbff3ef9 100644
---
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/DDLStatementAssert.java
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisResumeJobStatementAssert.java
@@ -15,35 +15,33 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl;
+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.core.statement.type.ddl.DDLStatement;
+import
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisResumeJobStatement;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.oracle.OracleDDLStatementAssert;
-import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.postgresql.PostgreSQLDDLStatementAssert;
-import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.sqlserver.SQLServerDDLStatementAssert;
-import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.standard.StandardDDLStatementAssert;
-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.ddl.dialect.doris.DorisResumeJobStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
/**
- * DDL statement assert.
+ * Resume job statement assert for Doris.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class DDLStatementAssert {
+public final class DorisResumeJobStatementAssert {
/**
- * Assert DDL statement is correct with expected parser result.
+ * Assert resume job statement is correct with expected parser result.
*
* @param assertContext assert context
- * @param actual actual DDL statement
- * @param expected expected parser result
+ * @param actual actual resume job statement
+ * @param expected expected resume job statement test case
*/
- public static void assertIs(final SQLCaseAssertContext assertContext,
final DDLStatement actual, final SQLParserTestCase expected) {
- StandardDDLStatementAssert.assertIs(assertContext, actual, expected);
- PostgreSQLDDLStatementAssert.assertIs(assertContext, actual, expected);
- OracleDDLStatementAssert.assertIs(assertContext, actual, expected);
- SQLServerDDLStatementAssert.assertIs(assertContext, actual, expected);
+ public static void assertIs(final SQLCaseAssertContext assertContext,
final DorisResumeJobStatement actual, final DorisResumeJobStatementTestCase
expected) {
+ if (null != expected.getJobName()) {
+ assertThat(assertContext.getText("Job name does not match: "),
actual.getJobName(), is(expected.getJobName()));
+ }
}
}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/standard/StandardDDLStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/standard/StandardDDLStatementAssert.java
index 949f844f5c9..dc6b8d3d397 100644
---
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/standard/StandardDDLStatementAssert.java
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/standard/StandardDDLStatementAssert.java
@@ -26,6 +26,7 @@ import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.DD
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.FetchStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.MoveStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.TruncateStatement;
+import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.catalog.AlterCatalogStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.index.AlterIndexStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.index.CreateIndexStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.index.DropIndexStatement;
@@ -42,6 +43,7 @@ import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.vi
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.view.DropViewStatement;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.view.RefreshMatViewStmtStatement;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.standard.type.AlterCatalogStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.standard.type.AlterIndexStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.standard.type.AlterSynonymStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.standard.type.AlterTableStatementAssert;
@@ -70,6 +72,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.standard.FetchStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.MoveStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.TruncateStatementTestCase;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.catalog.AlterCatalogStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.index.AlterIndexStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.index.CreateIndexStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.index.DropIndexStatementTestCase;
@@ -142,6 +145,8 @@ public final class StandardDDLStatementAssert {
CreateSequenceStatementAssert.assertIs(assertContext,
(CreateSequenceStatement) actual, (CreateSequenceStatementTestCase) expected);
} else if (actual instanceof CreateProcedureStatement) {
CreateProcedureStatementAssert.assertIs(assertContext,
(CreateProcedureStatement) actual, (CreateProcedureTestCase) expected);
+ } else if (actual instanceof AlterCatalogStatement) {
+ AlterCatalogStatementAssert.assertIs(assertContext,
(AlterCatalogStatement) actual, (AlterCatalogStatementTestCase) expected);
}
}
}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/standard/type/AlterCatalogStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/standard/type/AlterCatalogStatementAssert.java
new file mode 100644
index 00000000000..7990f07194e
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/standard/type/AlterCatalogStatementAssert.java
@@ -0,0 +1,74 @@
+/*
+ * 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.standard.type;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.catalog.AlterCatalogStatement;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.catalog.CatalogAssert;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.catalog.AlterCatalogStatementTestCase;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Alter catalog statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class AlterCatalogStatementAssert {
+
+ /**
+ * Assert alter catalog statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual alter catalog statement
+ * @param expected expected alter catalog statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext,
final AlterCatalogStatement actual, final AlterCatalogStatementTestCase
expected) {
+ assertCatalogName(assertContext, actual, expected);
+ assertRenameCatalog(assertContext, actual, expected);
+ assertProperties(assertContext, actual, expected);
+ assertCatalogComment(assertContext, actual, expected);
+ }
+
+ private static void assertCatalogName(final SQLCaseAssertContext
assertContext, final AlterCatalogStatement actual, final
AlterCatalogStatementTestCase expected) {
+ if (null != expected.getCatalogName()) {
+ CatalogAssert.assertCatalogName(assertContext,
actual.getCatalogName(), expected.getCatalogName());
+ }
+ }
+
+ private static void assertRenameCatalog(final SQLCaseAssertContext
assertContext, final AlterCatalogStatement actual, final
AlterCatalogStatementTestCase expected) {
+ if (null != expected.getRenameCatalog()) {
+ assertTrue(actual.getNewCatalogName().isPresent(),
assertContext.getText("Actual new catalog name should exist."));
+ CatalogAssert.assertRenameCatalog(assertContext,
actual.getNewCatalogName().get(), expected.getRenameCatalog());
+ }
+ }
+
+ private static void assertProperties(final SQLCaseAssertContext
assertContext, final AlterCatalogStatement actual, final
AlterCatalogStatementTestCase expected) {
+ if (null != expected.getProperties()) {
+ CatalogAssert.assertProperties(assertContext,
actual.getProperties(), expected.getProperties());
+ }
+ }
+
+ private static void assertCatalogComment(final SQLCaseAssertContext
assertContext, final AlterCatalogStatement actual, final
AlterCatalogStatementTestCase expected) {
+ if (null != expected.getCatalogComment()) {
+ assertTrue(actual.getComment().isPresent(),
assertContext.getText("Actual catalog comment should exist."));
+ CatalogAssert.assertCatalogComment(assertContext,
actual.getComment().get(), expected.getCatalogComment());
+ }
+ }
+}
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 e76a915e849..5bb77e0b25b 100644
---
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
@@ -21,6 +21,8 @@ import com.google.common.base.Preconditions;
import lombok.Getter;
import lombok.SneakyThrows;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.CommonStatementTestCase;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisResumeJobStatementTestCase;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.catalog.AlterCatalogStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.tcl.HiveAbortStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.mysql.MySQLCloneStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.mysql.MySQLCreateLoadableFunctionTestCase;
@@ -506,6 +508,12 @@ public final class RootSQLParserTestCases {
@XmlElement(name = "rename-table")
private final List<RenameTableStatementTestCase> renameTableTestCases =
new LinkedList<>();
+ @XmlElement(name = "resume-job")
+ private final List<DorisResumeJobStatementTestCase> resumeJobTestCases =
new LinkedList<>();
+
+ @XmlElement(name = "alter-catalog")
+ private final List<AlterCatalogStatementTestCase> alterCatalogTestCases =
new LinkedList<>();
+
@XmlElement(name = "drop-table")
private final List<DropTableStatementTestCase> dropTableTestCases = new
LinkedList<>();
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogComment.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogComment.java
new file mode 100644
index 00000000000..3b066a2b9ec
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogComment.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog;
+
+import lombok.Getter;
+import lombok.Setter;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.AbstractExpectedSQLSegment;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * Expected catalog comment.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class ExpectedCatalogComment extends AbstractExpectedSQLSegment {
+
+ @XmlAttribute
+ private String value;
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogName.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogName.java
new file mode 100644
index 00000000000..644fbbaba8e
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogName.java
@@ -0,0 +1,34 @@
+/*
+ * 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.catalog;
+
+import lombok.Getter;
+import lombok.Setter;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.AbstractExpectedIdentifierSQLSegment;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+
+/**
+ * Expected catalog name.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class ExpectedCatalogName extends
AbstractExpectedIdentifierSQLSegment {
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogProperties.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogProperties.java
new file mode 100644
index 00000000000..34e13910ab4
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogProperties.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.segment.impl.catalog;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Expected catalog properties.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class ExpectedCatalogProperties {
+
+ @XmlElement(name = "property")
+ private final List<ExpectedCatalogProperty> properties = new
LinkedList<>();
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogProperty.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogProperty.java
new file mode 100644
index 00000000000..f3e0082463f
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedCatalogProperty.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog;
+
+import lombok.Getter;
+import lombok.Setter;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.AbstractExpectedSQLSegment;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * Expected catalog property.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class ExpectedCatalogProperty extends AbstractExpectedSQLSegment {
+
+ @XmlAttribute
+ private String key;
+
+ @XmlAttribute
+ private String value;
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedRenameCatalog.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedRenameCatalog.java
new file mode 100644
index 00000000000..f7e6c94f326
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/catalog/ExpectedRenameCatalog.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog;
+
+import lombok.Getter;
+import lombok.Setter;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.AbstractExpectedSQLSegment;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * Expected rename catalog.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class ExpectedRenameCatalog extends AbstractExpectedSQLSegment {
+
+ @XmlAttribute
+ private String value;
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/dialect/doris/DorisResumeJobStatementTestCase.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/dialect/doris/DorisResumeJobStatementTestCase.java
new file mode 100644
index 00000000000..09d09152a79
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/dialect/doris/DorisResumeJobStatementTestCase.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package
org.apache.shardingsphere.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 javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Resume job statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisResumeJobStatementTestCase extends SQLParserTestCase {
+
+ @XmlElement(name = "job-name")
+ private String jobName;
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/standard/catalog/AlterCatalogStatementTestCase.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/standard/catalog/AlterCatalogStatementTestCase.java
new file mode 100644
index 00000000000..faa32d059ca
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/standard/catalog/AlterCatalogStatementTestCase.java
@@ -0,0 +1,48 @@
+/*
+ * 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.standard.catalog;
+
+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.catalog.ExpectedCatalogComment;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog.ExpectedCatalogName;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog.ExpectedCatalogProperties;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog.ExpectedRenameCatalog;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Alter catalog statement test case.
+ */
+@Getter
+@Setter
+public final class AlterCatalogStatementTestCase extends SQLParserTestCase {
+
+ @XmlElement(name = "catalog-name")
+ private ExpectedCatalogName catalogName;
+
+ @XmlElement(name = "rename-name")
+ private ExpectedRenameCatalog renameCatalog;
+
+ @XmlElement(name = "properties")
+ private ExpectedCatalogProperties properties;
+
+ @XmlElement(name = "catalog-comment")
+ private ExpectedCatalogComment catalogComment;
+}
diff --git a/test/it/parser/src/main/resources/case/ddl/alter-catalog.xml
b/test/it/parser/src/main/resources/case/ddl/alter-catalog.xml
new file mode 100644
index 00000000000..45e56dd7a4d
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/ddl/alter-catalog.xml
@@ -0,0 +1,41 @@
+<?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>
+ <alter-catalog sql-case-id="alter_catalog_rename">
+ <catalog-name start-index="14" stop-index="22" name="ctlg_hive" />
+ <rename-catalog start-index="31" stop-index="34" value="hive" />
+ </alter-catalog>
+ <alter-catalog sql-case-id="alter_catalog_set_properties">
+ <catalog-name start-index="14" stop-index="18" name="hive" />
+ <properties>
+ <property key="hive.metastore.uris"
value="thrift://172.21.0.1:9083" start-index="34" stop-index="79" />
+ </properties>
+ </alter-catalog>
+ <alter-catalog sql-case-id="alter_catalog_modify_comment">
+ <catalog-name start-index="14" stop-index="18" name="hive" />
+ <catalog-comment start-index="34" stop-index="54" value="new catalog
comment" />
+ </alter-catalog>
+ <alter-catalog sql-case-id="alter_catalog_set_properties_multiple">
+ <catalog-name start-index="14" stop-index="18" name="hive" />
+ <properties>
+ <property key="hive.metastore.uris"
value="thrift://172.21.0.1:9083" start-index="34" stop-index="79" />
+ <property key="hive.metastore" value="thrift" start-index="84"
stop-index="109" />
+ </properties>
+ </alter-catalog>
+</sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/ddl/resume-job.xml
b/test/it/parser/src/main/resources/case/ddl/resume-job.xml
new file mode 100644
index 00000000000..90ccd2ac3f8
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/ddl/resume-job.xml
@@ -0,0 +1,29 @@
+<?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>
+ <resume-job sql-case-id="resume_job_with_job_name">
+ <job-name>example</job-name>
+ </resume-job>
+ <resume-job sql-case-id="resume_job_with_double_quotes">
+ <job-name>my_job</job-name>
+ </resume-job>
+ <resume-job sql-case-id="resume_job_with_single_quotes">
+ <job-name>daily_sync_job</job-name>
+ </resume-job>
+</sql-parser-test-cases>
diff --git
a/test/it/parser/src/main/resources/sql/supported/ddl/alter-catalog.xml
b/test/it/parser/src/main/resources/sql/supported/ddl/alter-catalog.xml
new file mode 100644
index 00000000000..827389eca3c
--- /dev/null
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/alter-catalog.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="alter_catalog_rename" value="ALTER CATALOG ctlg_hive RENAME
hive;" db-types="Doris" />
+ <sql-case id="alter_catalog_set_properties" value="ALTER CATALOG hive SET
PROPERTIES ('hive.metastore.uris'='thrift://172.21.0.1:9083');"
db-types="Doris" />
+ <sql-case id="alter_catalog_modify_comment" value="ALTER CATALOG hive
MODIFY COMMENT "new catalog comment"" db-types="Doris" />
+ <sql-case id="alter_catalog_set_properties_multiple" value="ALTER CATALOG
hive SET PROPERTIES
('hive.metastore.uris'='thrift://172.21.0.1:9083','hive.metastore'='thrift');"
db-types="Doris" />
+</sql-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/ddl/resume-job.xml
b/test/it/parser/src/main/resources/sql/supported/ddl/resume-job.xml
new file mode 100644
index 00000000000..9196740780c
--- /dev/null
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/resume-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="resume_job_with_job_name" value="RESUME JOB WHERE jobName =
'example'" db-types="Doris" />
+ <sql-case id="resume_job_with_double_quotes" value="RESUME JOB WHERE
jobName = "my_job"" db-types="Doris" />
+ <sql-case id="resume_job_with_single_quotes" value="RESUME JOB WHERE
jobName = 'daily_sync_job'" db-types="Doris" />
+</sql-cases>