sandynz commented on code in PR #20263:
URL: https://github.com/apache/shardingsphere/pull/20263#discussion_r948693804
##########
shardingsphere-distsql/shardingsphere-distsql-parser/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/KernelDistSQLStatement.g4:
##########
@@ -21,6 +21,7 @@ import Symbol, RALStatement, RDLStatement, RQLStatement;
execute
: (addResource
+ | addMigrationSourceResource
Review Comment:
It's better not add in common module, could we add it in migration related
grammer file?
##########
shardingsphere-distsql/shardingsphere-distsql-statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/rdl/create/AddMigrationResourceStatement.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.distsql.parser.statement.rdl.create;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.distsql.parser.segment.DataSourceSegment;
+import
org.apache.shardingsphere.distsql.parser.statement.rdl.ResourceDefinitionStatement;
+
+import java.util.Collection;
+
+/**
+ * Add resource statement.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class AddMigrationResourceStatement extends
ResourceDefinitionStatement {
+
Review Comment:
Class unit test and DistSQL parsing test could be added.
##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/RDLBackendHandlerFactory.java:
##########
@@ -51,6 +53,9 @@ public static ProxyBackendHandler newInstance(final
RDLStatement sqlStatement, f
if (sqlStatement instanceof AddResourceStatement) {
return new AddResourceBackendHandler((AddResourceStatement)
sqlStatement, connectionSession);
}
+ if (sqlStatement instanceof AddMigrationResourceStatement) {
+ return new
AddMigrationSourceResourceBackendHandler((AddMigrationResourceStatement)
sqlStatement, connectionSession);
+ }
Review Comment:
It should not put here
##########
shardingsphere-distsql/shardingsphere-distsql-parser/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/KernelDistSQLStatement.g4:
##########
@@ -21,6 +21,7 @@ import Symbol, RALStatement, RDLStatement, RQLStatement;
execute
: (addResource
+ | addMigrationSourceResource
Review Comment:
And also other grammer files in imports
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]