You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2020/10/30 11:21:05 UTC
[shardingsphere] branch master updated: Merge
shardingsphere-distsql-parser-sql into shardingsphere-distsql-parser-engine
(#7986)
This is an automated email from the ASF dual-hosted git repository.
panjuan 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 37156ed Merge shardingsphere-distsql-parser-sql into shardingsphere-distsql-parser-engine (#7986)
37156ed is described below
commit 37156ed7cccef02897d3845159efc692120d7eb5
Author: Liang Zhang <te...@163.com>
AuthorDate: Fri Oct 30 19:20:37 2020 +0800
Merge shardingsphere-distsql-parser-sql into shardingsphere-distsql-parser-engine (#7986)
* Merge shardingsphere-distsql-parser-sql into shardingsphere-distsql-parser-engine
* Add g4 file
---
shardingsphere-distsql-parser/pom.xml | 1 -
.../shardingsphere-distsql-parser-engine/pom.xml | 29 ++++++++-
.../src/main/antlr4/imports/Alphabet.g4 | 0
.../src/main/antlr4/imports/Keyword.g4 | 0
.../src/main/antlr4/imports/Literals.g4 | 0
.../src/main/antlr4/imports/RDLStatement.g4 | 0
.../src/main/antlr4/imports/Symbol.g4 | 0
.../distsql/parser/autogen/DistSQLStatement.g4 | 0
.../{ => api}/DistSQLStatementParserEngine.java | 5 +-
.../distsql/parser/core}/DistSQLParser.java | 2 +-
.../parser/{ => core}/DistSQLParserFactory.java | 3 +-
.../parser/core}/DistSQLStatementVisitor.java | 2 +-
.../shardingsphere-distsql-parser-sql/pom.xml | 72 ----------------------
.../parser/ShardingSphereSQLParserEngine.java | 2 +-
14 files changed, 35 insertions(+), 81 deletions(-)
diff --git a/shardingsphere-distsql-parser/pom.xml b/shardingsphere-distsql-parser/pom.xml
index 5ae5202..356ab85 100644
--- a/shardingsphere-distsql-parser/pom.xml
+++ b/shardingsphere-distsql-parser/pom.xml
@@ -30,7 +30,6 @@
<name>${project.artifactId}</name>
<modules>
- <module>shardingsphere-distsql-parser-sql</module>
<module>shardingsphere-distsql-parser-statement</module>
<module>shardingsphere-distsql-parser-engine</module>
<module>shardingsphere-distsql-parser-binder</module>
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/pom.xml b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/pom.xml
index 7f8a12c..bf893ed 100644
--- a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/pom.xml
+++ b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/pom.xml
@@ -39,8 +39,35 @@
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-distsql-parser-sql</artifactId>
+ <artifactId>shardingsphere-distsql-parser-statement</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere</groupId>
+ <artifactId>shardingsphere-sql-parser-engine</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr4-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>antlr</id>
+ <configuration>
+ <libDirectory>src/main/antlr4/imports/</libDirectory>
+ <listener>false</listener>
+ <visitor>true</visitor>
+ </configuration>
+ <goals>
+ <goal>antlr4</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/imports/Alphabet.g4 b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/Alphabet.g4
similarity index 100%
rename from shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/imports/Alphabet.g4
rename to shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/Alphabet.g4
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/imports/Keyword.g4 b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/Keyword.g4
similarity index 100%
rename from shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/imports/Keyword.g4
rename to shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/Keyword.g4
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/imports/Literals.g4 b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/Literals.g4
similarity index 100%
rename from shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/imports/Literals.g4
rename to shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/Literals.g4
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/imports/RDLStatement.g4 b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/RDLStatement.g4
similarity index 100%
rename from shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/imports/RDLStatement.g4
rename to shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/RDLStatement.g4
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/imports/Symbol.g4 b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/Symbol.g4
similarity index 100%
rename from shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/imports/Symbol.g4
rename to shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/Symbol.g4
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/DistSQLStatement.g4 b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/DistSQLStatement.g4
similarity index 100%
rename from shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/DistSQLStatement.g4
rename to shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/DistSQLStatement.g4
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/DistSQLStatementParserEngine.java b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/api/DistSQLStatementParserEngine.java
similarity index 92%
rename from shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/DistSQLStatementParserEngine.java
rename to shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/api/DistSQLStatementParserEngine.java
index 1e60d39..0921fd9 100644
--- a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/DistSQLStatementParserEngine.java
+++ b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/api/DistSQLStatementParserEngine.java
@@ -15,14 +15,15 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.distsql.parser;
+package org.apache.shardingsphere.distsql.parser.api;
import org.antlr.v4.runtime.BailErrorStrategy;
import org.antlr.v4.runtime.Parser;
import org.antlr.v4.runtime.atn.PredictionMode;
import org.antlr.v4.runtime.misc.ParseCancellationException;
import org.antlr.v4.runtime.tree.ErrorNode;
-import org.apache.shardingsphere.distsql.parser.sql.visitor.DistSQLStatementVisitor;
+import org.apache.shardingsphere.distsql.parser.core.DistSQLParserFactory;
+import org.apache.shardingsphere.distsql.parser.core.DistSQLStatementVisitor;
import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
import org.apache.shardingsphere.sql.parser.core.parser.ParseASTNode;
import org.apache.shardingsphere.sql.parser.exception.SQLParsingException;
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/java/org/apache/shardingsphere/distsql/parser/sql/parser/DistSQLParser.java b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/DistSQLParser.java
similarity index 95%
rename from shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/java/org/apache/shardingsphere/distsql/parser/sql/parser/DistSQLParser.java
rename to shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/DistSQLParser.java
index 76c972d..00e6c47 100644
--- a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/java/org/apache/shardingsphere/distsql/parser/sql/parser/DistSQLParser.java
+++ b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/DistSQLParser.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.distsql.parser.sql.parser;
+package org.apache.shardingsphere.distsql.parser.core;
import org.antlr.v4.runtime.TokenStream;
import org.apache.shardingsphere.distsql.parser.autogen.DistSQLStatementParser;
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/DistSQLParserFactory.java b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/DistSQLParserFactory.java
similarity index 94%
rename from shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/DistSQLParserFactory.java
rename to shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/DistSQLParserFactory.java
index 5c6c006..1654a96 100644
--- a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/DistSQLParserFactory.java
+++ b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/DistSQLParserFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.distsql.parser;
+package org.apache.shardingsphere.distsql.parser.core;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@@ -26,7 +26,6 @@ import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.TokenStream;
import org.apache.shardingsphere.distsql.parser.autogen.DistSQLStatementLexer;
-import org.apache.shardingsphere.distsql.parser.sql.parser.DistSQLParser;
import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
import java.nio.CharBuffer;
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/java/org/apache/shardingsphere/distsql/parser/sql/visitor/DistSQLStatementVisitor.java b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/DistSQLStatementVisitor.java
similarity index 98%
rename from shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/java/org/apache/shardingsphere/distsql/parser/sql/visitor/DistSQLStatementVisitor.java
rename to shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/DistSQLStatementVisitor.java
index 1b16e6f..b89955c 100644
--- a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/src/main/java/org/apache/shardingsphere/distsql/parser/sql/visitor/DistSQLStatementVisitor.java
+++ b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/DistSQLStatementVisitor.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.distsql.parser.sql.visitor;
+package org.apache.shardingsphere.distsql.parser.core;
import org.apache.shardingsphere.distsql.parser.autogen.DistSQLStatementBaseVisitor;
import org.apache.shardingsphere.distsql.parser.autogen.DistSQLStatementParser.CreateDataSourcesContext;
diff --git a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/pom.xml b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/pom.xml
deleted file mode 100644
index 175e1a7..0000000
--- a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-sql/pom.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?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.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>shardingsphere-distsql-parser</artifactId>
- <groupId>org.apache.shardingsphere</groupId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>shardingsphere-distsql-parser-sql</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-collections4</artifactId>
- </dependency>
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr4-runtime</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-distsql-parser-statement</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-sql-parser-engine</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.antlr</groupId>
- <artifactId>antlr4-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>antlr</id>
- <configuration>
- <libDirectory>src/main/antlr4/imports/</libDirectory>
- <listener>false</listener>
- <visitor>true</visitor>
- </configuration>
- <goals>
- <goal>antlr4</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shardingsphere-infra/shardingsphere-infra-parser/src/main/java/org/apache/shardingsphere/infra/parser/ShardingSphereSQLParserEngine.java b/shardingsphere-infra/shardingsphere-infra-parser/src/main/java/org/apache/shardingsphere/infra/parser/ShardingSphereSQLParserEngine.java
index e20bef9..e96645d 100644
--- a/shardingsphere-infra/shardingsphere-infra-parser/src/main/java/org/apache/shardingsphere/infra/parser/ShardingSphereSQLParserEngine.java
+++ b/shardingsphere-infra/shardingsphere-infra-parser/src/main/java/org/apache/shardingsphere/infra/parser/ShardingSphereSQLParserEngine.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.parser;
-import org.apache.shardingsphere.distsql.parser.DistSQLStatementParserEngine;
+import org.apache.shardingsphere.distsql.parser.api.DistSQLStatementParserEngine;
import org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine;
import org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngineFactory;
import org.apache.shardingsphere.sql.parser.exception.SQLParsingException;