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 5e2570eca65 Support parsing Doris CREATE/DROP REPOSITORY syntax
(#38086)
5e2570eca65 is described below
commit 5e2570eca6592e83f393aafc640e562f862108a1
Author: cxy <[email protected]>
AuthorDate: Thu Feb 19 18:26:35 2026 +0800
Support parsing Doris CREATE/DROP REPOSITORY syntax (#38086)
---
.../core/database/visitor/SQLVisitorRule.java | 4 +
.../src/main/antlr4/imports/doris/BaseRule.g4 | 8 ++
.../src/main/antlr4/imports/doris/DALStatement.g4 | 11 +++
.../src/main/antlr4/imports/doris/DorisKeyword.g4 | 16 ++++
.../sql/parser/autogen/DorisStatement.g4 | 2 +
.../statement/type/DorisDALStatementVisitor.java | 28 +++++++
.../core/segment/dal/RepositoryNameSegment.java | 37 +++++++++
.../doris/dal/DorisCreateRepositoryStatement.java | 47 +++++++++++
.../doris/dal/DorisDropRepositoryStatement.java | 38 +++++++++
.../dal/dialect/doris/DorisDALStatementAssert.java | 10 +++
.../type/DorisCreateRepositoryStatementAssert.java | 93 ++++++++++++++++++++++
.../type/DorisDropRepositoryStatementAssert.java | 49 ++++++++++++
.../cases/parser/jaxb/RootSQLParserTestCases.java | 8 ++
.../impl/repository/ExpectedRepositoryName.java | 34 ++++++++
.../DorisCreateRepositoryStatementTestCase.java | 54 +++++++++++++
.../DorisDropRepositoryStatementTestCase.java | 39 +++++++++
.../parser/src/main/resources/case/dal/create.xml | 11 +++
.../it/parser/src/main/resources/case/dal/drop.xml | 3 +
.../main/resources/sql/supported/dal/create.xml | 2 +
.../src/main/resources/sql/supported/dal/drop.xml | 1 +
20 files changed, 495 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 d7a25f219d9..09e4d68d35d 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
@@ -505,6 +505,10 @@ public enum SQLVisitorRule {
ALTER_RESOURCE("AlterResource", SQLStatementType.DAL),
+ DROP_REPOSITORY("DropRepository", SQLStatementType.DAL),
+
+ CREATE_REPOSITORY("CreateRepository", SQLStatementType.DAL),
+
DORIS_ALTER_SYSTEM("DorisAlterSystem", SQLStatementType.DAL),
CREATE_SQL_BLOCK_RULE("CreateSqlBlockRule", SQLStatementType.DAL),
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 55a7c2538f6..bb722e22554 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
@@ -258,6 +258,7 @@ identifierKeywordsUnambiguous
| GROUP_REPLICATION
| GROUPS
| HASH
+ | HDFS
| HISTOGRAM
| HISTORY
| HOSTS
@@ -291,6 +292,7 @@ identifierKeywordsUnambiguous
| LEVEL
| LINESTRING
| LIST
+ | LOCATION
| LOCKED
| LOCKS
| LOGFILE
@@ -430,6 +432,7 @@ identifierKeywordsUnambiguous
| REPLICATE_REWRITE_DB
| REPLICATE_WILD_DO_TABLE
| REPLICATE_WILD_IGNORE_TABLE
+ | REPOSITORY
| REQUIRE_ROW_FORMAT
// | REQUIRE_TABLE_PRIMARY_KEY_CHECK
| USER_RESOURCES
@@ -499,6 +502,7 @@ identifierKeywordsUnambiguous
| SWAPS
| SWITCHES
| SYSTEM
+ | S3
| TABLE
| TABLES
| TABLESPACE
@@ -809,6 +813,10 @@ groupName
: identifier
;
+repositoryName
+ : identifier
+ ;
+
routineName
: identifier
;
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 dd3679cb277..1ce2e429c5f 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
@@ -465,6 +465,17 @@ dropResourceGroup
: DROP RESOURCE GROUP groupName FORCE?
;
+dropRepository
+ : DROP REPOSITORY repositoryName
+ ;
+
+createRepository
+ : CREATE (READ ONLY)? REPOSITORY repositoryName
+ WITH (S3 | HDFS)
+ ON LOCATION string_
+ propertiesClause
+ ;
+
setResourceGroup
: SET RESOURCE GROUP groupName (FOR NUMBER_ (COMMA_ NUMBER_)*)?
;
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 41f2a477fc9..2f55522749f 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
@@ -1011,6 +1011,10 @@ HAVING
: H A V I N G
;
+HDFS
+ : H D F S
+ ;
+
HELP
: H E L P
;
@@ -1367,6 +1371,10 @@ LOCKS
: L O C K S
;
+LOCATION
+ : L O C A T I O N
+ ;
+
LOGFILE
: L O G F I L E
;
@@ -2224,6 +2232,10 @@ REPLICATION
: R E P L I C A T I O N
;
+REPOSITORY
+ : R E P O S I T O R Y
+ ;
+
REQUIRE
: R E Q U I R E
;
@@ -2336,6 +2348,10 @@ ROWS
: R O W S
;
+S3
+ : S '3'
+ ;
+
ROW_COUNT
: R O W UL_ C O U N T
;
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 1b8e730ea25..53207b366dd 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
@@ -139,6 +139,8 @@ execute
| createSqlBlockRule
| alterSqlBlockRule
| dropSqlBlockRule
+ | dropRepository
+ | createRepository
| buildIndex
| cancelBuildIndex
| createFile
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 eb38b80b8e6..c90e53a1561 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
@@ -36,9 +36,11 @@ import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CloneAc
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CloneContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CloneInstanceContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateLoadableFunctionContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateRepositoryContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateResourceGroupContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DelimiterContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DropResourceGroupContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DropRepositoryContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ExplainContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ExplainableStatementContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.FlushContext;
@@ -60,6 +62,7 @@ import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.OptionV
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PartitionListContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PartitionNameContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.RepairTableContext;
+import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.RepositoryNameContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ResetOptionContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ResetPersistContext;
import
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ResetStatementContext;
@@ -196,13 +199,16 @@ import
org.apache.shardingsphere.sql.parser.statement.core.value.literal.impl.Te
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterResourceStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterSystemStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateSqlBlockRuleStatement;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateRepositoryStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisSwitchStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterSqlBlockRuleStatement;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisDropRepositoryStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisDropSqlBlockRuleStatement;
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.DorisSyncStatement;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.dal.RepositoryNameSegment;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.ShowBuildIndexStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.show.DorisShowQueryStatsStatement;
import
org.apache.shardingsphere.sql.parser.statement.mysql.dal.MySQLCloneStatement;
@@ -1036,6 +1042,28 @@ public final class DorisDALStatementVisitor extends
DorisStatementVisitor implem
return new MySQLDropResourceGroupStatement(getDatabaseType(),
((IdentifierValue) visit(ctx.groupName())).getValue());
}
+ @Override
+ public ASTNode visitDropRepository(final DropRepositoryContext ctx) {
+ DorisDropRepositoryStatement result = new
DorisDropRepositoryStatement(getDatabaseType());
+ RepositoryNameContext repositoryNameCtx = ctx.repositoryName();
+ IdentifierValue identifierValue = (IdentifierValue)
visit(repositoryNameCtx);
+ result.setRepositoryName(new
RepositoryNameSegment(repositoryNameCtx.start.getStartIndex(),
repositoryNameCtx.stop.getStopIndex(), identifierValue));
+ return result;
+ }
+
+ @Override
+ public ASTNode visitCreateRepository(final CreateRepositoryContext ctx) {
+ DorisCreateRepositoryStatement result = new
DorisCreateRepositoryStatement(getDatabaseType());
+ result.setReadOnly(null != ctx.READ() && null != ctx.ONLY());
+ RepositoryNameContext repositoryNameCtx = ctx.repositoryName();
+ IdentifierValue identifierValue = (IdentifierValue)
visit(repositoryNameCtx);
+ result.setRepositoryName(new
RepositoryNameSegment(repositoryNameCtx.start.getStartIndex(),
repositoryNameCtx.stop.getStopIndex(), identifierValue));
+ result.setStorageType(null != ctx.S3() ? "S3" : "HDFS");
+ result.setLocation(((StringLiteralValue)
visit(ctx.string_())).getValue());
+ result.setProperties(extractPropertiesSegment(ctx.propertiesClause()));
+ return result;
+ }
+
@Override
public ASTNode visitAlterResourceGroup(final AlterResourceGroupContext
ctx) {
return new MySQLAlterResourceGroupStatement(getDatabaseType(),
((IdentifierValue) visit(ctx.groupName())).getValue());
diff --git
a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/dal/RepositoryNameSegment.java
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/dal/RepositoryNameSegment.java
new file mode 100644
index 00000000000..0d000485ea1
--- /dev/null
+++
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/dal/RepositoryNameSegment.java
@@ -0,0 +1,37 @@
+/*
+ * 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.segment.dal;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.sql.parser.statement.core.segment.SQLSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.value.identifier.IdentifierValue;
+
+/**
+ * Repository name segment.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class RepositoryNameSegment implements SQLSegment {
+
+ private final int startIndex;
+
+ private final int stopIndex;
+
+ private final IdentifierValue identifier;
+}
diff --git
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisCreateRepositoryStatement.java
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisCreateRepositoryStatement.java
new file mode 100644
index 00000000000..679239a195f
--- /dev/null
+++
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisCreateRepositoryStatement.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.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.RepositoryNameSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertiesSegment;
+import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;
+
+/**
+ * Create repository statement for Doris.
+ */
+@Getter
+@Setter
+public final class DorisCreateRepositoryStatement extends DALStatement {
+
+ private boolean readOnly;
+
+ private RepositoryNameSegment repositoryName;
+
+ private String storageType;
+
+ private String location;
+
+ private PropertiesSegment properties;
+
+ public DorisCreateRepositoryStatement(final DatabaseType databaseType) {
+ super(databaseType);
+ }
+}
diff --git
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisDropRepositoryStatement.java
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisDropRepositoryStatement.java
new file mode 100644
index 00000000000..102bbd6ddb6
--- /dev/null
+++
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisDropRepositoryStatement.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.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.statement.type.dal.DALStatement;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.dal.RepositoryNameSegment;
+
+/**
+ * Drop repository statement for Doris.
+ */
+@Getter
+@Setter
+public final class DorisDropRepositoryStatement extends DALStatement {
+
+ private RepositoryNameSegment repositoryName;
+
+ public DorisDropRepositoryStatement(final DatabaseType databaseType) {
+ super(databaseType);
+ }
+}
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 783e93ff304..db154990d64 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
@@ -24,12 +24,16 @@ import
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.Un
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterResourceStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterSystemStatement;
import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateSqlBlockRuleStatement;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateRepositoryStatement;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisDropRepositoryStatement;
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;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAlterResourceStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAlterSystemStatementAssert;
import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisCreateSqlBlockRuleStatementAssert;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisCreateRepositoryStatementAssert;
+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.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;
@@ -37,6 +41,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.dal.dialect.doris.DorisAlterResourceStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAlterSystemStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCreateSqlBlockRuleStatementTestCase;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCreateRepositoryStatementTestCase;
+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.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;
@@ -67,6 +73,10 @@ public final class DorisDALStatementAssert {
DorisSwitchStatementAssert.assertIs(assertContext,
(DorisSwitchStatement) actual, (DorisSwitchStatementTestCase) expected);
} else if (actual instanceof UnsetVariableStatement) {
DorisUnsetVariableStatementAssert.assertIs(assertContext,
(UnsetVariableStatement) actual, (DorisUnsetVariableStatementTestCase)
expected);
+ } else if (actual instanceof DorisCreateRepositoryStatement) {
+ DorisCreateRepositoryStatementAssert.assertIs(assertContext,
(DorisCreateRepositoryStatement) actual,
(DorisCreateRepositoryStatementTestCase) expected);
+ } else if (actual instanceof DorisDropRepositoryStatement) {
+ DorisDropRepositoryStatementAssert.assertIs(assertContext,
(DorisDropRepositoryStatement) actual, (DorisDropRepositoryStatementTestCase)
expected);
}
}
}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisCreateRepositoryStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisCreateRepositoryStatementAssert.java
new file mode 100644
index 00000000000..eabcd9a81fd
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisCreateRepositoryStatementAssert.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertySegment;
+import
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateRepositoryStatement;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.identifier.IdentifierValueAssert;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCreateRepositoryStatementTestCase;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.PropertyTestCase;
+import org.hamcrest.MatcherAssert;
+import org.hamcrest.Matchers;
+import org.junit.jupiter.api.Assertions;
+
+/**
+ * Create repository statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisCreateRepositoryStatementAssert {
+
+ /**
+ * Assert create repository statement is correct with expected parser
result.
+ *
+ * @param assertContext assert context
+ * @param actual actual create repository statement
+ * @param expected expected create repository statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext,
final DorisCreateRepositoryStatement actual, final
DorisCreateRepositoryStatementTestCase expected) {
+ assertReadOnlyFlag(assertContext, actual, expected);
+ assertRepositoryName(assertContext, actual, expected);
+ assertStorageType(assertContext, actual, expected);
+ assertLocation(assertContext, actual, expected);
+ assertProperties(assertContext, actual, expected);
+ }
+
+ private static void assertReadOnlyFlag(final SQLCaseAssertContext
assertContext, final DorisCreateRepositoryStatement actual, final
DorisCreateRepositoryStatementTestCase expected) {
+ MatcherAssert.assertThat(assertContext.getText("read-only flag does
not match: "), actual.isReadOnly(), Matchers.is(expected.isReadOnly()));
+ }
+
+ private static void assertRepositoryName(final SQLCaseAssertContext
assertContext, final DorisCreateRepositoryStatement actual, final
DorisCreateRepositoryStatementTestCase expected) {
+ if (null != expected.getRepositoryName()) {
+ Assertions.assertNotNull(actual.getRepositoryName(),
assertContext.getText("Actual repository name should exist."));
+ IdentifierValueAssert.assertIs(assertContext,
actual.getRepositoryName().getIdentifier(), expected.getRepositoryName(),
"Repository name");
+ SQLSegmentAssert.assertIs(assertContext,
actual.getRepositoryName(), expected.getRepositoryName());
+ }
+ }
+
+ private static void assertStorageType(final SQLCaseAssertContext
assertContext, final DorisCreateRepositoryStatement actual, final
DorisCreateRepositoryStatementTestCase expected) {
+ if (null != expected.getStorageType()) {
+ MatcherAssert.assertThat(assertContext.getText("storage type does
not match: "), actual.getStorageType(), Matchers.is(expected.getStorageType()));
+ }
+ }
+
+ private static void assertLocation(final SQLCaseAssertContext
assertContext, final DorisCreateRepositoryStatement actual, final
DorisCreateRepositoryStatementTestCase expected) {
+ if (null != expected.getLocation()) {
+ MatcherAssert.assertThat(assertContext.getText("location does not
match: "), actual.getLocation(), Matchers.is(expected.getLocation()));
+ }
+ }
+
+ private static void assertProperties(final SQLCaseAssertContext
assertContext, final DorisCreateRepositoryStatement actual, final
DorisCreateRepositoryStatementTestCase expected) {
+ Assertions.assertNotNull(actual.getProperties(),
assertContext.getText("properties should not be null"));
+ if (!expected.getProperties().isEmpty()) {
+ MatcherAssert.assertThat(assertContext.getText("Properties size
does not match: "), actual.getProperties().getProperties().size(),
Matchers.is(expected.getProperties().size()));
+ for (int i = 0; i < expected.getProperties().size(); i++) {
+ assertProperty(assertContext,
actual.getProperties().getProperties().get(i), expected.getProperties().get(i));
+ }
+ }
+ }
+
+ private static void assertProperty(final SQLCaseAssertContext
assertContext, final PropertySegment actual, final PropertyTestCase expected) {
+ MatcherAssert.assertThat(assertContext.getText(String.format("Property
key '%s' assertion error: ", expected.getKey())), actual.getKey(),
Matchers.is(expected.getKey()));
+ MatcherAssert.assertThat(assertContext.getText(String.format("Property
value for key '%s' assertion error: ", expected.getKey())), actual.getValue(),
Matchers.is(expected.getValue()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisDropRepositoryStatementAssert.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisDropRepositoryStatementAssert.java
new file mode 100644
index 00000000000..c9ba5bb32cc
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisDropRepositoryStatementAssert.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.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.DorisDropRepositoryStatement;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.identifier.IdentifierValueAssert;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisDropRepositoryStatementTestCase;
+import org.junit.jupiter.api.Assertions;
+
+/**
+ * Drop repository statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisDropRepositoryStatementAssert {
+
+ /**
+ * Assert drop repository statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual drop repository statement
+ * @param expected expected drop repository statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext,
final DorisDropRepositoryStatement actual, final
DorisDropRepositoryStatementTestCase expected) {
+ if (null != expected.getRepositoryName()) {
+ Assertions.assertNotNull(actual.getRepositoryName(),
assertContext.getText("Actual repository name should exist."));
+ IdentifierValueAssert.assertIs(assertContext,
actual.getRepositoryName().getIdentifier(), expected.getRepositoryName(),
"Repository name");
+ SQLSegmentAssert.assertIs(assertContext,
actual.getRepositoryName(), expected.getRepositoryName());
+ }
+ }
+}
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 8abae8e85de..ef832823470 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
@@ -23,6 +23,8 @@ 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.dal.dialect.doris.DorisAlterSystemStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCreateSqlBlockRuleStatementTestCase;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCreateRepositoryStatementTestCase;
+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.DorisSwitchStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.CreateEncryptKeyStatementTestCase;
import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisAlterStoragePolicyStatementTestCase;
@@ -722,6 +724,12 @@ public final class RootSQLParserTestCases {
@XmlElement(name = "drop-resource-group")
private final List<MySQLDropResourceGroupStatementTestCase>
dropResourceGroupTestCases = new LinkedList<>();
+ @XmlElement(name = "create-repository")
+ private final List<DorisCreateRepositoryStatementTestCase>
createRepositoryTestCases = new LinkedList<>();
+
+ @XmlElement(name = "drop-repository")
+ private final List<DorisDropRepositoryStatementTestCase>
dropRepositoryTestCases = new LinkedList<>();
+
@XmlElement(name = "binlog")
private final List<MySQLBinlogStatementTestCase> binlogTestCases = new
LinkedList<>();
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/repository/ExpectedRepositoryName.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/repository/ExpectedRepositoryName.java
new file mode 100644
index 00000000000..4ffeb38ccd5
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/repository/ExpectedRepositoryName.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.repository;
+
+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 repository name.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class ExpectedRepositoryName extends
AbstractExpectedIdentifierSQLSegment {
+}
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisCreateRepositoryStatementTestCase.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisCreateRepositoryStatementTestCase.java
new file mode 100644
index 00000000000..9e6f853d853
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisCreateRepositoryStatementTestCase.java
@@ -0,0 +1,54 @@
+/*
+ * 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.repository.ExpectedRepositoryName;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Create repository statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisCreateRepositoryStatementTestCase extends
SQLParserTestCase {
+
+ @XmlAttribute(name = "read-only")
+ private boolean readOnly;
+
+ @XmlElement(name = "repository-name")
+ private ExpectedRepositoryName repositoryName;
+
+ @XmlAttribute(name = "storage-type")
+ private String storageType;
+
+ @XmlAttribute(name = "location")
+ private String location;
+
+ @XmlElement(name = "property")
+ private final List<PropertyTestCase> properties = 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/DorisDropRepositoryStatementTestCase.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisDropRepositoryStatementTestCase.java
new file mode 100644
index 00000000000..209c7598c2c
--- /dev/null
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisDropRepositoryStatementTestCase.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris;
+
+import lombok.Getter;
+import lombok.Setter;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.SQLParserTestCase;
+import
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.repository.ExpectedRepositoryName;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Drop repository statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisDropRepositoryStatementTestCase extends
SQLParserTestCase {
+
+ @XmlElement(name = "repository-name")
+ private ExpectedRepositoryName repositoryName;
+}
diff --git a/test/it/parser/src/main/resources/case/dal/create.xml
b/test/it/parser/src/main/resources/case/dal/create.xml
index 2cec4607ac2..0c8118395e7 100644
--- a/test/it/parser/src/main/resources/case/dal/create.xml
+++ b/test/it/parser/src/main/resources/case/dal/create.xml
@@ -50,4 +50,15 @@
<property key="global" value="false" start-index="95" stop-index="110"
/>
<property key="enable" value="true" start-index="112" stop-index="126"
/>
</create-sql-block-rule>
+ <create-repository sql-case-id="create_repository" read-only="false"
storage-type="S3" location="s3://s3-repo">
+ <repository-name name="s3_repo" start-index="18" stop-index="26"
start-delimiter="`" end-delimiter="`" />
+ <property key="s3.endpoint" value="http://s3-REGION.amazonaws.com"
start-index="74" stop-index="119" />
+ <property key="s3.access_key" value="AWS_ACCESS_KEY" start-index="121"
stop-index="152" />
+ <property key="s3.secret_key" value="AWS_SECRET_KEY" start-index="154"
stop-index="185" />
+ <property key="s3.region" value="REGION" start-index="187"
stop-index="206" />
+ </create-repository>
+ <create-repository sql-case-id="create_repository_readonly"
read-only="true" storage-type="HDFS" location="hdfs://hdfs-server:9000/backup">
+ <repository-name name="backup_repo" start-index="28" stop-index="38" />
+ <property key="hadoop.username" value="user" start-index="106"
stop-index="129" />
+ </create-repository>
</sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/dal/drop.xml
b/test/it/parser/src/main/resources/case/dal/drop.xml
index 50a29eb9b28..7f5195a3bfe 100644
--- a/test/it/parser/src/main/resources/case/dal/drop.xml
+++ b/test/it/parser/src/main/resources/case/dal/drop.xml
@@ -27,4 +27,7 @@
<rule-name name="test_rule1" start-index="20" stop-index="29" />
<rule-name name="test_rule2" start-index="32" stop-index="41" />
</drop-sql-block-rule>
+ <drop-repository sql-case-id="drop_repository">
+ <repository-name name="example_repo" start-index="16" stop-index="29"
start-delimiter="`" end-delimiter="`" />
+ </drop-repository>
</sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dal/create.xml
b/test/it/parser/src/main/resources/sql/supported/dal/create.xml
index 2b3bc4ef685..f276cec08fb 100644
--- a/test/it/parser/src/main/resources/sql/supported/dal/create.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dal/create.xml
@@ -24,4 +24,6 @@
<sql-case id="create_sql_block_rule_with_partition_num" value="CREATE
SQL_BLOCK_RULE limit_partition_rule
PROPERTIES("partition_num"="30","global"="true")"
db-types="Doris" />
<sql-case id="create_sql_block_rule_with_cardinality" value="CREATE
SQL_BLOCK_RULE limit_cardinality_rule
PROPERTIES("cardinality"="10000000000","tablet_num"="100")"
db-types="Doris" />
<sql-case id="create_sql_block_rule_mixed_properties" value="CREATE
SQL_BLOCK_RULE complex_rule
PROPERTIES("sql"="\\s*select\\s*\\*\\s*from
order_\\w*\\s*","global"="false","enable"="true")"
db-types="Doris" />
+ <sql-case id="create_repository" value="CREATE REPOSITORY `s3_repo` WITH
S3 ON LOCATION "s3://s3-repo"
PROPERTIES("s3.endpoint"="http://s3-REGION.amazonaws.com","s3.access_key"="AWS_ACCESS_KEY","s3.secret_key"="AWS_SECRET_KEY","s3.region"="REGION")"
db-types="Doris" />
+ <sql-case id="create_repository_readonly" value="CREATE READ ONLY
REPOSITORY backup_repo WITH HDFS ON LOCATION
"hdfs://hdfs-server:9000/backup"
PROPERTIES("hadoop.username"="user")" db-types="Doris" />
</sql-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dal/drop.xml
b/test/it/parser/src/main/resources/sql/supported/dal/drop.xml
index 00bc4ed9605..02581f4b0dc 100644
--- a/test/it/parser/src/main/resources/sql/supported/dal/drop.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dal/drop.xml
@@ -20,4 +20,5 @@
<sql-case id="drop_resource_group" value="DROP RESOURCE GROUP rg"
db-types="MySQL,Doris" />
<sql-case id="drop_sql_block_rule_single" value="DROP SQL_BLOCK_RULE
test_rule1" db-types="Doris" />
<sql-case id="drop_sql_block_rule_multiple" value="DROP SQL_BLOCK_RULE
test_rule1, test_rule2" db-types="Doris" />
+ <sql-case id="drop_repository" value="DROP REPOSITORY `example_repo`"
db-types="Doris" />
</sql-cases>