Liangda-w commented on a change in pull request #10052:
URL: https://github.com/apache/shardingsphere/pull/10052#discussion_r613640234
##########
File path:
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -941,9 +945,51 @@ addListPartitionClause
;
dropTablePartition
- : DROP partitionExtendedNames
+ : DROP partitionExtendedNames (updateIndexClauses parallelClause?)?
;
partitionExtendedNames
- : (PARTITION | PARTITIONS) partition
+ : (PARTITION | PARTITIONS) (partitionName | partitionForClauses) (COMMA_
(partitionName | partitionForClauses))*
+ ;
+
+partitionForClauses
+ : FOR LP_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+ ;
+
+updateIndexClauses
+ : updateGlobalIndexClause | updateAllIndexesClause
+ ;
+
+updateGlobalIndexClause
+ : (UPDATE | INVALIDATE) GLOBAL INDEXES
+ ;
+
+updateAllIndexesClause
+ : UPDATE INDEXES
+ (LP_ indexName LP_ (updateIndexPartition | updateIndexSubpartition)
+ (COMMA_ indexName LP_ (updateIndexPartition | updateIndexSubpartition)
RP_)* RP_)?
+ ;
+
+updateIndexPartition
+ : indexPartitionDesc indexSubpartitionClause?
+ (COMMA_ indexPartitionDesc indexSubpartitionClause?)*
+ ;
+
+indexPartitionDesc
+ : PARTITION
+ (partitionName
+ ((segmentAttributesClause | indexCompression) | PARAMETERS LP_ SQ_
odciParameters SQ_ RP_ )?
Review comment:
Yes! It should be `(segmentAttributesClause | indexCompression)+`.
Actually this relates to my question in #10016. Before when I add this `+`,
it give me the following error
`rule XXX contains an optional block with at least one alternative that can
match an empty string`
I notice that you changed the rule `physicalAttributesClause` from
`(PCTFREE NUMBER_ | PCTUSED NUMBER_ | INITRANS NUMBER_ | storageClause)*` to
`(PCTFREE NUMBER_ | PCTUSED NUMBER_ | INITRANS NUMBER_ | storageClause)+` to
avoid this error.
However, I think the former rule is more accurate as it could also be empty?

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