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 2021/09/03 04:23:53 UTC

[shardingsphere] branch master updated: remove unnecessary rules and todos that are already implemented (#12184)

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 3ead803  remove unnecessary rules and todos that are already implemented (#12184)
3ead803 is described below

commit 3ead803563ceb4b994d22d205ade5eda790f9d50
Author: Thanoshan MV <48...@users.noreply.github.com>
AuthorDate: Fri Sep 3 09:53:10 2021 +0530

    remove unnecessary rules and todos that are already implemented (#12184)
---
 .../src/main/antlr4/imports/oracle/DMLStatement.g4 | 41 ----------------------
 .../impl/OracleDMLStatementSQLVisitor.java         |  9 -----
 2 files changed, 50 deletions(-)

diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
index 4478ed1..6084807 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
@@ -147,10 +147,6 @@ parenthesisSelectSubquery
     : LP_ selectSubquery RP_
     ;
 
-unionClause
-    : queryBlock (UNION (ALL | DISTINCT)? queryBlock)*
-    ;
-
 queryBlock
     : withClause? SELECT hint? duplicateSpecification? selectList selectFromClause whereClause? hierarchicalQueryClause? groupByClause? modelClause?
     ;
@@ -405,22 +401,10 @@ duplicateSpecification
     : (DISTINCT | UNIQUE) | ALL
     ;
 
-projections
-    : (unqualifiedShorthand | projection) (COMMA_ projection)*
-    ;
-
-projection
-    : (columnName | expr) (AS? alias)? | qualifiedShorthand
-    ;
-
 unqualifiedShorthand
     : ASTERISK_
     ;
 
-qualifiedShorthand
-    : identifier DOT_ASTERISK_
-    ;
-
 selectList
     : unqualifiedShorthand
     | selectProjection (COMMA_ selectProjection)*
@@ -435,31 +419,6 @@ selectProjectionExprClause
     : expr (AS? alias)?
     ;
 
-fromClause
-    : FROM tableReferences
-    ;
-
-tableReferences
-    : tableReference (COMMA_ tableReference)*
-    ;
-
-tableReference
-    : tableFactor joinedTable*
-    ;
-
-tableFactor
-    : tableName (AS? alias)? | subquery AS? alias? columnNames? | LP_ tableReferences RP_
-    ;
-
-joinedTable
-    : NATURAL? ((INNER | CROSS)? JOIN) tableFactor joinSpecification?
-    | NATURAL? (LEFT | RIGHT | FULL) OUTER? JOIN tableFactor joinSpecification?
-    ;
-
-joinSpecification
-    : ON expr | USING columnNames
-    ;
-
 selectFromClause
     : FROM fromClauseList
     ;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleDMLStatementSQLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleDMLStatementSQLVisitor.java
index 1675bee..05c1e31 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleDMLStatementSQLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleDMLStatementSQLVisitor.java
@@ -92,7 +92,6 @@ import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.Subque
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.SubqueryFactoringClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.TableCollectionExprContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.TableNameContext;
-import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.UnionClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.UpdateContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.UpdateSetClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.UpdateSetColumnClauseContext;
@@ -169,7 +168,6 @@ public final class OracleDMLStatementSQLVisitor extends OracleStatementSQLVisito
     @Override
     public ASTNode visitInsert(final InsertContext ctx) {
         // TODO :FIXME, since there is no segment for insertValuesClause, InsertStatement is created by sub rule.
-        // TODO :deal with insert select
         if (null != ctx.insertSingleTable()) {
             OracleInsertStatement result = (OracleInsertStatement) visit(ctx.insertSingleTable());
             return result;
@@ -470,7 +468,6 @@ public final class OracleDMLStatementSQLVisitor extends OracleStatementSQLVisito
     
     @Override
     public ASTNode visitSelect(final SelectContext ctx) {
-        // TODO :Unsupported for withClause.
         OracleSelectStatement result = (OracleSelectStatement) visit(ctx.selectSubquery());
         result.setParameterCount(getCurrentParameterIndex());
         if (null != ctx.forUpdateClause()) {
@@ -480,12 +477,6 @@ public final class OracleDMLStatementSQLVisitor extends OracleStatementSQLVisito
     }
     
     @Override
-    public ASTNode visitUnionClause(final UnionClauseContext ctx) {
-        // TODO :Unsupported for union SQL.
-        return visit(ctx.queryBlock(0));
-    }
-    
-    @Override
     public ASTNode visitSelectSubquery(final SelectSubqueryContext ctx) {
         OracleSelectStatement result;
         if (null != ctx.queryBlock()) {