This is an automated email from the ASF dual-hosted git repository. duanzhengqiang 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 29f2404777f Support parsing Doris refresh SQL statement (#36446) 29f2404777f is described below commit 29f2404777fbec1ac344dd5ff8333329571f1c15 Author: Chakkk <chakk6...@gmail.com> AuthorDate: Tue Sep 9 08:30:16 2025 +0800 Support parsing Doris refresh SQL statement (#36446) * support parsing Doris refresh SQL statement * optimise fresh g4 statement --- .../core/database/visitor/SQLVisitorRule.java | 4 ++ .../src/main/antlr4/imports/doris/DALStatement.g4 | 4 ++ .../src/main/antlr4/imports/doris/DDLStatement.g4 | 4 ++ .../src/main/antlr4/imports/doris/DorisKeyword.g4 | 12 ++++++ .../sql/parser/autogen/DorisStatement.g4 | 2 + .../statement/type/DorisDALStatementVisitor.java | 7 ++++ .../statement/type/DorisDDLStatementVisitor.java | 7 ++++ .../statement/ddl/DropEncryptKeyStatement.java | 31 +++++++++++++++ .../core/statement/type/dal/RefreshStatement.java | 30 +++++++++++++++ .../cases/parser/jaxb/RootSQLParserTestCases.java | 8 ++++ .../dal/DorisRefreshStatementTestCase.java | 44 ++++++++++++++++++++++ .../ddl/DropEncryptKeyStatementTestCase.java | 35 +++++++++++++++++ .../parser/src/main/resources/case/dal/refresh.xml | 30 +++++++++++++++ .../main/resources/case/ddl/drop-encryptkey.xml | 22 +++++++++++ .../main/resources/sql/supported/dal/refresh.xml | 30 +++++++++++++++ .../sql/supported/ddl/drop-encryptkey.xml | 22 +++++++++++ 16 files changed, 292 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 9a4c7c74ff4..a9a7f8dbb87 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 @@ -701,6 +701,8 @@ public enum SQLVisitorRule { DROP_CONTEXT("DropContext", SQLStatementType.DDL), + DROP_ENCRYPT_KEY("DropEncryptKey", SQLStatementType.DDL), + SYSTEM_ACTION("SystemAction", SQLStatementType.DDL), EMPTY_STATEMENT("EmptyStatement", SQLStatementType.DAL), @@ -721,6 +723,8 @@ public enum SQLVisitorRule { START_REPLICA("StartReplica", SQLStatementType.DAL), + REFRESH("Refresh", SQLStatementType.DAL), + OPEN("Open", SQLStatementType.DDL); private final String name; 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 3286b817ab2..5bc5062c33c 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 @@ -615,6 +615,10 @@ assignGtidsToAnonymousTransactionsDef : (OFF | LOCAL | string_) ; +refresh + : REFRESH (LDAP (ALL | (FOR identifier)?)? | CATALOG identifier | DATABASE (identifier DOT_)? identifier | TABLE ((identifier DOT_)? (identifier DOT_)?)? identifier) + ; + show : showDatabases | showTables 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 62d492f7621..76d6b681d16 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 @@ -349,6 +349,10 @@ dropServer : DROP SERVER ifExists? serverName ; +dropEncryptKey + : DROP ENCRYPTKEY identifier + ; + createView : CREATE (OR REPLACE)? (ALGORITHM EQ_ (UNDEFINED | MERGE | TEMPTABLE))? 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 d0192ffea2f..fbcf6c4debc 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 @@ -237,6 +237,10 @@ CASE : C A S E ; +CATALOG + : C A T A L O G + ; + CATALOG_NAME : C A T A L O G UL_ N A M E ; @@ -685,6 +689,10 @@ ENCRYPTION : E N C R Y P T I O N ; +ENCRYPTKEY + : E N C R Y P T K E Y + ; + END : E N D ; @@ -1232,6 +1240,10 @@ LAG : L A G ; +LDAP + : L D A P + ; + LANGUAGE : L A N G U A G E ; 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 e3029e78255..70f5965ed6d 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 @@ -45,6 +45,7 @@ execute | dropLogfileGroup | createServer | dropServer + | dropEncryptKey | createView | dropView | createTrigger @@ -100,6 +101,7 @@ execute | explain | doStatement | show + | refresh | setVariable | setCharacter | call 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 5490a4fe1f3..9f586bccc64 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 @@ -45,6 +45,7 @@ import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.FlushCo import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.FromDatabaseContext; import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.FromTableContext; import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.HelpContext; +import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.RefreshContext; import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.IndexNameContext; import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.InstallComponentContext; import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.InstallPluginContext; @@ -146,6 +147,7 @@ import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table import org.apache.shardingsphere.sql.parser.statement.core.statement.SQLStatement; import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.AnalyzeTableStatement; import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.ExplainStatement; +import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.RefreshStatement; import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.SetStatement; import org.apache.shardingsphere.sql.parser.statement.core.value.collection.CollectionValue; import org.apache.shardingsphere.sql.parser.statement.core.value.identifier.IdentifierValue; @@ -930,4 +932,9 @@ public final class DorisDALStatementVisitor extends DorisStatementVisitor implem public ASTNode visitHelp(final HelpContext ctx) { return new MySQLHelpStatement(getDatabaseType(), ctx.textOrIdentifier().getText()); } + + @Override + public ASTNode visitRefresh(final RefreshContext ctx) { + return new RefreshStatement(getDatabaseType()); + } } 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 fc0b6b8f315..ae0eed35d1e 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 @@ -48,6 +48,7 @@ import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterTa import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterTablespaceNdbContext; import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterViewContext; import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.BeginStatementContext; +import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DropEncryptKeyContext; import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CaseStatementContext; import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ChangeColumnContext; import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CharsetNameContext; @@ -180,6 +181,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.CreateMaterializedViewStatement; import org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.view.CreateViewStatement; import org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.view.DropViewStatement; +import org.apache.shardingsphere.sql.parser.statement.core.statement.ddl.DropEncryptKeyStatement; import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.DeleteStatement; import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.InsertStatement; import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.SelectStatement; @@ -1037,4 +1039,9 @@ public final class DorisDDLStatementVisitor extends DorisStatementVisitor implem public ASTNode visitCreateMaterializedView(final CreateMaterializedViewContext ctx) { return new CreateMaterializedViewStatement(getDatabaseType()); } + + @Override + public ASTNode visitDropEncryptKey(final DropEncryptKeyContext ctx) { + return new DropEncryptKeyStatement(getDatabaseType()); + } } diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/ddl/DropEncryptKeyStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/ddl/DropEncryptKeyStatement.java new file mode 100644 index 00000000000..6f3ff2ace7d --- /dev/null +++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/ddl/DropEncryptKeyStatement.java @@ -0,0 +1,31 @@ +/* + * 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.ddl; + +import org.apache.shardingsphere.database.connector.core.type.DatabaseType; +import org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.DDLStatement; + +/** + * Drop encrypt key statement. + */ +public final class DropEncryptKeyStatement extends DDLStatement { + + public DropEncryptKeyStatement(final DatabaseType databaseType) { + super(databaseType); + } +} diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/RefreshStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/RefreshStatement.java new file mode 100644 index 00000000000..696b0f5d5e7 --- /dev/null +++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/RefreshStatement.java @@ -0,0 +1,30 @@ +/* + * 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.dal; + +import org.apache.shardingsphere.database.connector.core.type.DatabaseType; + +/** + * Refresh statement. + */ +public final class RefreshStatement extends DALStatement { + + public RefreshStatement(final DatabaseType databaseType) { + super(databaseType); + } +} 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 d772b898893..275f4a1a0f4 100644 --- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java @@ -78,6 +78,7 @@ import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.s import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.standard.ExplainStatementTestCase; import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.standard.SetParameterStatementTestCase; import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.standard.ShowStatementTestCase; +import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.DorisRefreshStatementTestCase; import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dcl.dialect.mysql.MySQLRenameUserStatementTestCase; import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dcl.dialect.mysql.MySQLSetDefaultRoleStatementTestCase; import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dcl.dialect.mysql.MySQLSetPasswordStatementTestCase; @@ -283,6 +284,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.table.AlterTableStatementTestCase; import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.table.CreateTableStatementTestCase; import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.table.DropTableStatementTestCase; +import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.DropEncryptKeyStatementTestCase; import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.table.RenameTableStatementTestCase; import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.tablespace.AlterTablespaceStatementTestCase; import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.standard.tablespace.CreateTablespaceStatementTestCase; @@ -505,6 +507,9 @@ public final class RootSQLParserTestCases { @XmlElement(name = "drop-table") private final List<DropTableStatementTestCase> dropTableTestCases = new LinkedList<>(); + @XmlElement(name = "drop-encryptkey") + private final List<DropEncryptKeyStatementTestCase> dropEncryptKeyTestCases = new LinkedList<>(); + @XmlElement(name = "drop-text-search") private final List<PostgreSQLDropTextSearchStatementTestCase> dropTextSearchTestCases = new LinkedList<>(); @@ -607,6 +612,9 @@ public final class RootSQLParserTestCases { @XmlElement(name = "describe") private final List<MySQLDescribeStatementTestCase> describeTestCases = new LinkedList<>(); + @XmlElement(name = "refresh") + private final List<DorisRefreshStatementTestCase> refreshTestCases = new LinkedList<>(); + @XmlElement(name = "show-databases") private final List<MySQLShowDatabasesStatementTestCase> showDatabasesTestCases = new LinkedList<>(); diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/DorisRefreshStatementTestCase.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/DorisRefreshStatementTestCase.java new file mode 100644 index 00000000000..abf0f606cfe --- /dev/null +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/DorisRefreshStatementTestCase.java @@ -0,0 +1,44 @@ +/* + * 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; + +import lombok.Getter; +import lombok.Setter; +import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.SQLParserTestCase; + +import javax.xml.bind.annotation.XmlElement; + +/** + * Doris refresh statement test case. + */ +@Getter +@Setter +public final class DorisRefreshStatementTestCase extends SQLParserTestCase { + + @XmlElement(name = "refresh-type") + private String refreshType; + + @XmlElement(name = "target-name") + private String targetName; + + @XmlElement(name = "user-name") + private String userName; + + @XmlElement(name = "refresh-all") + private Boolean refreshAll; +} diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/DropEncryptKeyStatementTestCase.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/DropEncryptKeyStatementTestCase.java new file mode 100644 index 00000000000..c3a692384c8 --- /dev/null +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/DropEncryptKeyStatementTestCase.java @@ -0,0 +1,35 @@ +/* + * 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; + +import lombok.Getter; +import lombok.Setter; +import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.SQLParserTestCase; + +import javax.xml.bind.annotation.XmlElement; + +/** + * Drop encrypt key statement test case. + */ +@Getter +@Setter +public final class DropEncryptKeyStatementTestCase extends SQLParserTestCase { + + @XmlElement(name = "key-name") + private String keyName; +} diff --git a/test/it/parser/src/main/resources/case/dal/refresh.xml b/test/it/parser/src/main/resources/case/dal/refresh.xml new file mode 100644 index 00000000000..a78fc4b02d4 --- /dev/null +++ b/test/it/parser/src/main/resources/case/dal/refresh.xml @@ -0,0 +1,30 @@ +<?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> + <refresh sql-case-id="refresh_ldap" /> + <refresh sql-case-id="refresh_ldap_all" /> + <refresh sql-case-id="refresh_ldap_for_user" /> + <refresh sql-case-id="refresh_ldap_for_user_name" /> + <refresh sql-case-id="refresh_catalog" /> + <refresh sql-case-id="refresh_database" /> + <refresh sql-case-id="refresh_database_with_catalog" /> + <refresh sql-case-id="refresh_table" /> + <refresh sql-case-id="refresh_table_with_database" /> + <refresh sql-case-id="refresh_table_with_catalog_database" /> +</sql-parser-test-cases> diff --git a/test/it/parser/src/main/resources/case/ddl/drop-encryptkey.xml b/test/it/parser/src/main/resources/case/ddl/drop-encryptkey.xml new file mode 100644 index 00000000000..c7994ad20e0 --- /dev/null +++ b/test/it/parser/src/main/resources/case/ddl/drop-encryptkey.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one or more + ~ contributor license agreements. See the NOTICE file distributed with + ~ this work for additional information regarding copyright ownership. + ~ The ASF licenses this file to You under the Apache License, Version 2.0 + ~ (the "License"); you may not use this file except in compliance with + ~ the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<sql-parser-test-cases> + <drop-encryptkey sql-case-id="drop_encryptkey" /> + <drop-encryptkey sql-case-id="drop_encryptkey_my_key" /> +</sql-parser-test-cases> diff --git a/test/it/parser/src/main/resources/sql/supported/dal/refresh.xml b/test/it/parser/src/main/resources/sql/supported/dal/refresh.xml new file mode 100644 index 00000000000..e345ab44ef1 --- /dev/null +++ b/test/it/parser/src/main/resources/sql/supported/dal/refresh.xml @@ -0,0 +1,30 @@ +<?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="refresh_ldap" value="REFRESH LDAP" db-types="Doris" /> + <sql-case id="refresh_ldap_all" value="REFRESH LDAP ALL" db-types="Doris" /> + <sql-case id="refresh_ldap_for_user" value="REFRESH LDAP for user1" db-types="Doris" /> + <sql-case id="refresh_ldap_for_user_name" value="REFRESH LDAP for user_name" db-types="Doris" /> + <sql-case id="refresh_catalog" value="REFRESH CATALOG catalog_name" db-types="Doris" /> + <sql-case id="refresh_database" value="REFRESH DATABASE database_name" db-types="Doris" /> + <sql-case id="refresh_database_with_catalog" value="REFRESH DATABASE catalog_name.database_name" db-types="Doris" /> + <sql-case id="refresh_table" value="REFRESH TABLE table_name" db-types="Doris" /> + <sql-case id="refresh_table_with_database" value="REFRESH TABLE database_name.table_name" db-types="Doris" /> + <sql-case id="refresh_table_with_catalog_database" value="REFRESH TABLE catalog_name.database_name.table_name" db-types="Doris" /> +</sql-cases> diff --git a/test/it/parser/src/main/resources/sql/supported/ddl/drop-encryptkey.xml b/test/it/parser/src/main/resources/sql/supported/ddl/drop-encryptkey.xml new file mode 100644 index 00000000000..5560b4831a4 --- /dev/null +++ b/test/it/parser/src/main/resources/sql/supported/ddl/drop-encryptkey.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one or more + ~ contributor license agreements. See the NOTICE file distributed with + ~ this work for additional information regarding copyright ownership. + ~ The ASF licenses this file to You under the Apache License, Version 2.0 + ~ (the "License"); you may not use this file except in compliance with + ~ the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<sql-cases> + <sql-case id="drop_encryptkey" value="DROP ENCRYPTKEY key_name" db-types="Doris" /> + <sql-case id="drop_encryptkey_my_key" value="DROP ENCRYPTKEY my_key" db-types="Doris" /> +</sql-cases>