wgy8283335 commented on a change in pull request #10558:
URL: https://github.com/apache/shardingsphere/pull/10558#discussion_r647035687



##########
File path: 
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
##########
@@ -121,7 +121,223 @@ unionClause
     ;
 
 queryBlock
-    : SELECT duplicateSpecification? projections fromClause? whereClause? 
groupByClause? havingClause?
+    : withClause? SELECT duplicateSpecification? projections fromClause? 
whereClause? groupByClause? havingClause?
+    ;
+
+withClause
+    : WITH plsqlDeclarations? ((subqueryFactoringClause | 
subavFactoringClause) (COMMA_ (subqueryFactoringClause | 
subavFactoringClause))*)?
+    ;
+
+plsqlDeclarations
+    : (functionDeclaration | procedureDeclaration)+
+    ;
+
+functionDeclaration
+    : functionHeading ((DETERMINISTIC | PIPELINED | PARALLEL_ENABLE | 
RESULT_CACHE)+)?
+    ;
+
+functionHeading
+    : FUNCTION functionName (LP_ parameterDeclaration (SQ_ 
parameterDeclaration)* RP_)? RETURN dataType
+    ;
+
+parameterDeclaration
+    : parameterName ((IN? dataType ((COLON_ EQ_ | DEFAULT) expr)?) | (IN? OUT 
NOCOPY? dataType))?
+    ;
+
+procedureDeclaration
+    : procedureHeading procedureProperties
+    ;
+
+procedureHeading
+    : PROCEDURE procedureName (LP_ parameterDeclaration (SQ_ 
parameterDeclaration)* RP_)?
+    ;
+
+procedureProperties
+    : (accessibleByClause | defaultCollationClause | invokerRightsClause)*
+    ;
+
+accessibleByClause
+    : ACCESSIBLE BY LP_ accessor (COMMA_ accessor)* RP_
+    ;
+
+accessor
+    : unitKind? unitName
+    ;
+
+unitKind
+    : FUNCTION | PROCEDURE | PACKAGE | TRIGGER | TYPE
+    ;
+
+defaultCollationClause
+    : DEFAULT COLLATION collationOption
+    ;
+
+collationOption
+    : USING_NLS_COMP
+    ;
+
+invokerRightsClause
+    : AUTHID (CURRENT_USER | DEFINER)
+    ;
+
+subqueryFactoringClause
+    : queryName (LP_ alias (COMMA_ alias)* RP_)? AS LP_ selectSubquery RP_ 
searchClause? cycleClause? 
+    ;
+
+searchClause
+    : SEARCH (DEPTH | BREADTH) FIRST BY (alias (ASC | DESC)? (NULLS FIRST | 
NULLS LAST)?) (COMMA_ (alias (ASC | DESC)? (NULLS FIRST | NULLS LAST)?))* SET 
orderingColumn
+    ;
+
+cycleClause
+    : CYCLE alias (COMMA_ alias)* SET alias TO cycleValue DEFAULT noCycleValue
+    ;
+
+subavFactoringClause
+    : subavName ANALYTIC VIEW AS LP_ subavClause RP_
+    ;
+
+subavClause
+    : USING baseAvName hierarchiesClause? filterClauses? addCalcsClause?
+    ;
+
+hierarchiesClause
+    : HIERARCHIES LP_ ((alias DOT_)? alias (COMMA_ (alias DOT_)? alias)*)? RP_
+    ;
+
+filterClauses
+    : FILTER FACT LP_ filterClause (COMMA_ filterClause)* RP_
+    ;
+
+filterClause

Review comment:
       Maybe you should add some rules for the predicate.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to