You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/05/20 15:13:47 UTC

[GitHub] [shardingsphere] zhujunxxxxx opened a new pull request #10410: complete alter table partition grammar

zhujunxxxxx opened a new pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410


   Fixes #10409
   
   Changes proposed in this pull request:
   - support `modifyTablePartition` `moveTablePartition` `coalesceTablePartition` grammar
   


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] zhujunxxxxx commented on pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
zhujunxxxxx commented on pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#issuecomment-851126886


   @Liangda-w Can you give me a contact number, maybe we have a chance to work together in the future.


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] Liangda-w commented on a change in pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
Liangda-w commented on a change in pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#discussion_r637452339



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_

Review comment:
       A comma is missing, should be: 
   `(COMMA_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_`

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_
+    ;
+
+addHashSubpartition
+    : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause?
+    ;
+
+addListSubpartition
+    : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+coalesceTableSubpartition
+    : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering?
+    ;
+
+allowDisallowClustering
+    : (ALLOW | DISALLOW) CLUSTERING
+    ;
+
+alterMappingTableClauses
+    : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause)
+    ;
+
+deallocateUnusedClause
+    : DEALLOCATE UNUSED (KEEP sizeClause)?
+    ;
+
+allocateExtentClause
+    : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_) RP_)?
+    ;
+
+partitionSpec
+    : PARTITION partitionName? tablePartitionDescription?
+    ;
+
+partitionAttributes
+    : (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)?
+      (OVERFLOW (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause)?)?
+      tableCompression? inmemoryClause?

Review comment:
       This part is missing, or will it come in next PR?
   
   ![image](https://user-images.githubusercontent.com/66914151/119241388-3ecaed00-bb56-11eb-9888-a06794b99e7a.png)
   

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_
+    ;
+
+addHashSubpartition
+    : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause?
+    ;
+
+addListSubpartition
+    : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+coalesceTableSubpartition
+    : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering?
+    ;
+
+allowDisallowClustering
+    : (ALLOW | DISALLOW) CLUSTERING
+    ;
+
+alterMappingTableClauses
+    : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause)
+    ;
+
+deallocateUnusedClause
+    : DEALLOCATE UNUSED (KEEP sizeClause)?
+    ;
+
+allocateExtentClause
+    : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_) RP_)?

Review comment:
       Shouldn't it be `(SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_)*` ?

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_
+    ;
+
+addHashSubpartition
+    : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause?
+    ;
+
+addListSubpartition
+    : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+coalesceTableSubpartition
+    : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering?
+    ;
+
+allowDisallowClustering
+    : (ALLOW | DISALLOW) CLUSTERING
+    ;
+
+alterMappingTableClauses
+    : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause)
+    ;
+
+deallocateUnusedClause
+    : DEALLOCATE UNUSED (KEEP sizeClause)?
+    ;
+
+allocateExtentClause
+    : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_) RP_)?
+    ;
+
+partitionSpec
+    : PARTITION partitionName? tablePartitionDescription?
+    ;
+
+partitionAttributes
+    : (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)?
+      (OVERFLOW (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause)?)?

Review comment:
       `(OVERFLOW (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause)*)?`

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_
+    ;
+
+addHashSubpartition
+    : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause?
+    ;
+
+addListSubpartition
+    : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+coalesceTableSubpartition
+    : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering?
+    ;
+
+allowDisallowClustering
+    : (ALLOW | DISALLOW) CLUSTERING
+    ;
+
+alterMappingTableClauses
+    : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause)
+    ;
+
+deallocateUnusedClause
+    : DEALLOCATE UNUSED (KEEP sizeClause)?
+    ;
+
+allocateExtentClause
+    : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_) RP_)?
+    ;
+
+partitionSpec
+    : PARTITION partitionName? tablePartitionDescription?
+    ;
+
+partitionAttributes
+    : (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)?
+      (OVERFLOW (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause)?)?
+      tableCompression? inmemoryClause?
+    ;
+
+shrinkClause
+    : SHRINK SPACE COMPACT? CASCADE?
+    ;
+
+moveTablePartition
+    : MOVE partitionExtendedName (MAPPING TABLE)? tablePartitionDescription? filterCondition? updateAllIndexesClause? parallelClause? allowDisallowClustering? ONLINE?
+    ;
+
+filterCondition
+    : INCLUDING ROWS whereClause
+    ;
+
+whereClause
+    : WHERE expr
+    ;
+
+coalesceTablePartition
+    : COALESCE PARTITION updateIndexClauses? parallelClause? allowDisallowClustering?
     ;
 
 addTablePartition
-    : ADD (addRangePartitionClause | addListPartitionClause)
+    : ADD ((PARTITION partitionName? addRangePartitionClause (COMMA_ PARTITION partitionName? addRangePartitionClause)*)
+        |  (PARTITION partitionName? addListPartitionClause (COMMA_ PARTITION partitionName? addListPartitionClause)*)
+        |  (PARTITION partitionName? addSystemPartitionClause (COMMA_ PARTITION partitionName? addSystemPartitionClause)*)
+        |  (PARTITION partitionName? addHashPartitionClause (COMMA_ PARTITION partitionName? addHashPartitionClause)*)
+        ) dependentTablesClause?
     ;
 
 addRangePartitionClause
-    : PARTITION partitionName? rangeValuesClause tablePartitionDescription
+    : rangeValuesClause tablePartitionDescription? externalPartSubpartDataProps?
     ((LP_? rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* | listSubpartitionDesc (COMMA_ listSubpartitionDesc)* | individualHashSubparts (COMMA_ individualHashSubparts)* RP_?)
-        | hashSubpartitionQuantity)?
+    | hashSubpartitionQuantity)? updateIndexClauses?

Review comment:
       I think it should be:
   ```
   ((LP_? (rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* | listSubpartitionDesc (COMMA_ listSubpartitionDesc)* | individualHashSubparts (COMMA_ individualHashSubparts)*) RP_?)
   | hashSubpartitionQuantity)? updateIndexClauses?
   ```

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_
+    ;
+
+addHashSubpartition
+    : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause?
+    ;
+
+addListSubpartition
+    : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+coalesceTableSubpartition
+    : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering?
+    ;
+
+allowDisallowClustering
+    : (ALLOW | DISALLOW) CLUSTERING
+    ;
+
+alterMappingTableClauses
+    : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause)
+    ;
+
+deallocateUnusedClause
+    : DEALLOCATE UNUSED (KEEP sizeClause)?
+    ;
+
+allocateExtentClause
+    : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_) RP_)?
+    ;
+
+partitionSpec
+    : PARTITION partitionName? tablePartitionDescription?
+    ;
+
+partitionAttributes
+    : (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)?
+      (OVERFLOW (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause)?)?
+      tableCompression? inmemoryClause?
+    ;
+
+shrinkClause
+    : SHRINK SPACE COMPACT? CASCADE?
+    ;
+
+moveTablePartition
+    : MOVE partitionExtendedName (MAPPING TABLE)? tablePartitionDescription? filterCondition? updateAllIndexesClause? parallelClause? allowDisallowClustering? ONLINE?
+    ;
+
+filterCondition
+    : INCLUDING ROWS whereClause
+    ;
+
+whereClause
+    : WHERE expr
+    ;
+
+coalesceTablePartition
+    : COALESCE PARTITION updateIndexClauses? parallelClause? allowDisallowClustering?
     ;
 
 addTablePartition
-    : ADD (addRangePartitionClause | addListPartitionClause)
+    : ADD ((PARTITION partitionName? addRangePartitionClause (COMMA_ PARTITION partitionName? addRangePartitionClause)*)
+        |  (PARTITION partitionName? addListPartitionClause (COMMA_ PARTITION partitionName? addListPartitionClause)*)
+        |  (PARTITION partitionName? addSystemPartitionClause (COMMA_ PARTITION partitionName? addSystemPartitionClause)*)
+        |  (PARTITION partitionName? addHashPartitionClause (COMMA_ PARTITION partitionName? addHashPartitionClause)*)

Review comment:
       `PARTITION partitionName? addHashPartitionClause` 

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_
+    ;
+
+addHashSubpartition
+    : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause?
+    ;
+
+addListSubpartition
+    : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+coalesceTableSubpartition
+    : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering?
+    ;
+
+allowDisallowClustering
+    : (ALLOW | DISALLOW) CLUSTERING
+    ;
+
+alterMappingTableClauses
+    : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause)
+    ;
+
+deallocateUnusedClause
+    : DEALLOCATE UNUSED (KEEP sizeClause)?
+    ;
+
+allocateExtentClause
+    : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_) RP_)?
+    ;
+
+partitionSpec
+    : PARTITION partitionName? tablePartitionDescription?
+    ;
+
+partitionAttributes
+    : (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)?
+      (OVERFLOW (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause)?)?
+      tableCompression? inmemoryClause?
+    ;
+
+shrinkClause
+    : SHRINK SPACE COMPACT? CASCADE?
+    ;
+
+moveTablePartition
+    : MOVE partitionExtendedName (MAPPING TABLE)? tablePartitionDescription? filterCondition? updateAllIndexesClause? parallelClause? allowDisallowClustering? ONLINE?
+    ;
+
+filterCondition
+    : INCLUDING ROWS whereClause
+    ;
+
+whereClause
+    : WHERE expr
+    ;
+
+coalesceTablePartition
+    : COALESCE PARTITION updateIndexClauses? parallelClause? allowDisallowClustering?
     ;
 
 addTablePartition
-    : ADD (addRangePartitionClause | addListPartitionClause)
+    : ADD ((PARTITION partitionName? addRangePartitionClause (COMMA_ PARTITION partitionName? addRangePartitionClause)*)
+        |  (PARTITION partitionName? addListPartitionClause (COMMA_ PARTITION partitionName? addListPartitionClause)*)
+        |  (PARTITION partitionName? addSystemPartitionClause (COMMA_ PARTITION partitionName? addSystemPartitionClause)*)

Review comment:
       This part is missing 
   
   ![image](https://user-images.githubusercontent.com/66914151/119241657-573c0700-bb58-11eb-8828-bae66df73c57.png)
   

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_
+    ;
+
+addHashSubpartition
+    : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause?
+    ;
+
+addListSubpartition
+    : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+coalesceTableSubpartition
+    : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering?
+    ;
+
+allowDisallowClustering
+    : (ALLOW | DISALLOW) CLUSTERING
+    ;
+
+alterMappingTableClauses
+    : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause)
+    ;
+
+deallocateUnusedClause
+    : DEALLOCATE UNUSED (KEEP sizeClause)?
+    ;
+
+allocateExtentClause
+    : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_) RP_)?
+    ;
+
+partitionSpec
+    : PARTITION partitionName? tablePartitionDescription?
+    ;
+
+partitionAttributes
+    : (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)?
+      (OVERFLOW (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause)?)?
+      tableCompression? inmemoryClause?
+    ;
+
+shrinkClause
+    : SHRINK SPACE COMPACT? CASCADE?
+    ;
+
+moveTablePartition
+    : MOVE partitionExtendedName (MAPPING TABLE)? tablePartitionDescription? filterCondition? updateAllIndexesClause? parallelClause? allowDisallowClustering? ONLINE?
+    ;
+
+filterCondition
+    : INCLUDING ROWS whereClause
+    ;
+
+whereClause
+    : WHERE expr
+    ;
+
+coalesceTablePartition
+    : COALESCE PARTITION updateIndexClauses? parallelClause? allowDisallowClustering?
     ;
 
 addTablePartition
-    : ADD (addRangePartitionClause | addListPartitionClause)
+    : ADD ((PARTITION partitionName? addRangePartitionClause (COMMA_ PARTITION partitionName? addRangePartitionClause)*)
+        |  (PARTITION partitionName? addListPartitionClause (COMMA_ PARTITION partitionName? addListPartitionClause)*)
+        |  (PARTITION partitionName? addSystemPartitionClause (COMMA_ PARTITION partitionName? addSystemPartitionClause)*)
+        |  (PARTITION partitionName? addHashPartitionClause (COMMA_ PARTITION partitionName? addHashPartitionClause)*)
+        ) dependentTablesClause?
     ;
 
 addRangePartitionClause
-    : PARTITION partitionName? rangeValuesClause tablePartitionDescription
+    : rangeValuesClause tablePartitionDescription? externalPartSubpartDataProps?
     ((LP_? rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* | listSubpartitionDesc (COMMA_ listSubpartitionDesc)* | individualHashSubparts (COMMA_ individualHashSubparts)* RP_?)
-        | hashSubpartitionQuantity)?
+    | hashSubpartitionQuantity)? updateIndexClauses?
     ;
 
 addListPartitionClause
-    : PARTITION partitionName? listValuesClause tablePartitionDescription
+    : listValuesClause tablePartitionDescription? externalPartSubpartDataProps?
     ((LP_? rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* | listSubpartitionDesc (COMMA_ listSubpartitionDesc)* | individualHashSubparts (COMMA_ individualHashSubparts)* RP_?)
-    | hashSubpartitionQuantity)?
+    | hashSubpartitionQuantity)? updateIndexClauses?

Review comment:
       I think it should be:
   
   ```
   ((LP_? (rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* | listSubpartitionDesc (COMMA_ listSubpartitionDesc)* | individualHashSubparts (COMMA_ individualHashSubparts)*) RP_?)
   | hashSubpartitionQuantity)? updateIndexClauses?
   ```

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_
+    ;
+
+addHashSubpartition
+    : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause?
+    ;
+
+addListSubpartition
+    : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+coalesceTableSubpartition
+    : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering?
+    ;
+
+allowDisallowClustering
+    : (ALLOW | DISALLOW) CLUSTERING
+    ;
+
+alterMappingTableClauses
+    : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause)
+    ;
+
+deallocateUnusedClause
+    : DEALLOCATE UNUSED (KEEP sizeClause)?
+    ;
+
+allocateExtentClause
+    : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_) RP_)?
+    ;
+
+partitionSpec
+    : PARTITION partitionName? tablePartitionDescription?
+    ;
+
+partitionAttributes
+    : (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)?
+      (OVERFLOW (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause)?)?
+      tableCompression? inmemoryClause?
+    ;
+
+shrinkClause
+    : SHRINK SPACE COMPACT? CASCADE?
+    ;
+
+moveTablePartition
+    : MOVE partitionExtendedName (MAPPING TABLE)? tablePartitionDescription? filterCondition? updateAllIndexesClause? parallelClause? allowDisallowClustering? ONLINE?
+    ;
+
+filterCondition
+    : INCLUDING ROWS whereClause
+    ;
+
+whereClause
+    : WHERE expr
+    ;
+
+coalesceTablePartition
+    : COALESCE PARTITION updateIndexClauses? parallelClause? allowDisallowClustering?
     ;
 
 addTablePartition
-    : ADD (addRangePartitionClause | addListPartitionClause)
+    : ADD ((PARTITION partitionName? addRangePartitionClause (COMMA_ PARTITION partitionName? addRangePartitionClause)*)
+        |  (PARTITION partitionName? addListPartitionClause (COMMA_ PARTITION partitionName? addListPartitionClause)*)
+        |  (PARTITION partitionName? addSystemPartitionClause (COMMA_ PARTITION partitionName? addSystemPartitionClause)*)
+        |  (PARTITION partitionName? addHashPartitionClause (COMMA_ PARTITION partitionName? addHashPartitionClause)*)
+        ) dependentTablesClause?
     ;
 
 addRangePartitionClause
-    : PARTITION partitionName? rangeValuesClause tablePartitionDescription
+    : rangeValuesClause tablePartitionDescription? externalPartSubpartDataProps?
     ((LP_? rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* | listSubpartitionDesc (COMMA_ listSubpartitionDesc)* | individualHashSubparts (COMMA_ individualHashSubparts)* RP_?)
-        | hashSubpartitionQuantity)?
+    | hashSubpartitionQuantity)? updateIndexClauses?

Review comment:
       `hashSubpartitionQuantity` is not the same as `hash_subparts_by_quantity`, please have a check:)

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_
+    ;
+
+addHashSubpartition
+    : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause?
+    ;
+
+addListSubpartition
+    : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+coalesceTableSubpartition
+    : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering?
+    ;
+
+allowDisallowClustering
+    : (ALLOW | DISALLOW) CLUSTERING
+    ;
+
+alterMappingTableClauses
+    : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause)
+    ;
+
+deallocateUnusedClause
+    : DEALLOCATE UNUSED (KEEP sizeClause)?
+    ;
+
+allocateExtentClause
+    : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_) RP_)?
+    ;
+
+partitionSpec
+    : PARTITION partitionName? tablePartitionDescription?
+    ;
+
+partitionAttributes
+    : (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)?

Review comment:
       Does `(physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)*` work?




-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] zhujunxxxxx commented on pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
zhujunxxxxx commented on pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#issuecomment-845604016


   @tristaZero Please review this PR.


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] zhujunxxxxx commented on a change in pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
zhujunxxxxx commented on a change in pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#discussion_r641547033



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_

Review comment:
       yes, it was missed.




-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter commented on pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#issuecomment-850833228


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/10410?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#10410](https://codecov.io/gh/apache/shardingsphere/pull/10410?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bdef051) into [master](https://codecov.io/gh/apache/shardingsphere/commit/ea2f7a390a811c9d0f96648d232bd897036a55be?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ea2f7a3) will **increase** coverage by `0.04%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/10410/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/10410?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #10410      +/-   ##
   ============================================
   + Coverage     68.60%   68.65%   +0.04%     
   - Complexity      691      723      +32     
   ============================================
     Files          1727     1776      +49     
     Lines         29438    30396     +958     
     Branches       5293     5444     +151     
   ============================================
   + Hits          20197    20867     +670     
   - Misses         7677     7916     +239     
   - Partials       1564     1613      +49     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/10410?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...re/registry/listener/impl/RuleChangedListener.java](https://codecov.io/gh/apache/shardingsphere/pull/10410/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29yZS9yZWdpc3RyeS9saXN0ZW5lci9pbXBsL1J1bGVDaGFuZ2VkTGlzdGVuZXIuamF2YQ==) | `22.22% <0.00%> (-37.78%)` | :arrow_down: |
   | [.../transaction/TransactionBackendHandlerFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/10410/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L3RyYW5zYWN0aW9uL1RyYW5zYWN0aW9uQmFja2VuZEhhbmRsZXJGYWN0b3J5LmphdmE=) | `64.70% <0.00%> (-35.30%)` | :arrow_down: |
   | [...dialect/handler/ddl/DropIndexStatementHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/10410/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9oYW5kbGVyL2RkbC9Ecm9wSW5kZXhTdGF0ZW1lbnRIYW5kbGVyLmphdmE=) | `30.00% <0.00%> (-30.00%)` | :arrow_down: |
   | [...atement/impl/PostgreSQLTCLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/10410/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1wb3N0Z3Jlc3FsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zcWwvcGFyc2VyL3Bvc3RncmVzcWwvdmlzaXRvci9zdGF0ZW1lbnQvaW1wbC9Qb3N0Z3JlU1FMVENMU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `71.42% <0.00%> (-28.58%)` | :arrow_down: |
   | [...atement/impl/PostgreSQLDALStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/10410/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1wb3N0Z3Jlc3FsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zcWwvcGFyc2VyL3Bvc3RncmVzcWwvdmlzaXRvci9zdGF0ZW1lbnQvaW1wbC9Qb3N0Z3JlU1FMREFMU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `64.91% <0.00%> (-28.20%)` | :arrow_down: |
   | [...nd/text/transaction/TransactionBackendHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/10410/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L3RyYW5zYWN0aW9uL1RyYW5zYWN0aW9uQmFja2VuZEhhbmRsZXIuamF2YQ==) | `45.00% <0.00%> (-19.29%)` | :arrow_down: |
   | [...end/text/distsql/rdl/RDLBackendHandlerFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/10410/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmRsL1JETEJhY2tlbmRIYW5kbGVyRmFjdG9yeS5qYXZh) | `44.44% <0.00%> (-12.70%)` | :arrow_down: |
   | [...ata/schema/builder/loader/IndexMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/10410/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvSW5kZXhNZXRhRGF0YUxvYWRlci5qYXZh) | `66.66% <0.00%> (-11.12%)` | :arrow_down: |
   | [...tion/jdbc/transaction/LocalTransactionManager.java](https://codecov.io/gh/apache/shardingsphere/pull/10410/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9jb21tdW5pY2F0aW9uL2pkYmMvdHJhbnNhY3Rpb24vTG9jYWxUcmFuc2FjdGlvbk1hbmFnZXIuamF2YQ==) | `2.77% <0.00%> (-11.12%)` | :arrow_down: |
   | [...end/text/distsql/rql/RQLBackendHandlerFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/10410/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcnFsL1JRTEJhY2tlbmRIYW5kbGVyRmFjdG9yeS5qYXZh) | `20.00% <0.00%> (-7.28%)` | :arrow_down: |
   | ... and [271 more](https://codecov.io/gh/apache/shardingsphere/pull/10410/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/10410?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/10410?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ea2f7a3...bdef051](https://codecov.io/gh/apache/shardingsphere/pull/10410?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
tristaZero commented on pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#issuecomment-851001916


   Hi @zhujunxxxxx @Liangda-w  it is the right time to merge this one?


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] zhujunxxxxx commented on a change in pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
zhujunxxxxx commented on a change in pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#discussion_r641655784



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_
+    ;
+
+addHashSubpartition
+    : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause?
+    ;
+
+addListSubpartition
+    : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+coalesceTableSubpartition
+    : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering?
+    ;
+
+allowDisallowClustering
+    : (ALLOW | DISALLOW) CLUSTERING
+    ;
+
+alterMappingTableClauses
+    : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause)
+    ;
+
+deallocateUnusedClause
+    : DEALLOCATE UNUSED (KEEP sizeClause)?
+    ;
+
+allocateExtentClause
+    : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_) RP_)?
+    ;
+
+partitionSpec
+    : PARTITION partitionName? tablePartitionDescription?
+    ;
+
+partitionAttributes
+    : (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)?
+      (OVERFLOW (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause)?)?
+      tableCompression? inmemoryClause?

Review comment:
       ok, next PR fix it. 




-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero merged pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410


   


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] Liangda-w commented on pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
Liangda-w commented on pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#issuecomment-851656808


   @zhujunxxxxx ur welcome! Sure, you can contact me via liangda_wang@outlook.de
   


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] Liangda-w commented on a change in pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
Liangda-w commented on a change in pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#discussion_r641919059



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,142 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_

Review comment:
       @zhujunxxxxx Thanks for all the fix, looks good! 
   Only one point here: did you eventually forget to delete the old line?




-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
tristaZero commented on pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#issuecomment-846560005


   @zhujunxxxxx  Looks @Liangda-w gave a detailed review.


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] Liangda-w commented on pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
Liangda-w commented on pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#issuecomment-851069487


   > Hi @zhujunxxxxx @Liangda-w it is the right time to merge this one?
   
   yes, I think so:)


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] zhujunxxxxx commented on pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
zhujunxxxxx commented on pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#issuecomment-851126293


   @Liangda-w thank for u review. 


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] zhujunxxxxx commented on a change in pull request #10410: complete alter table partition grammar

Posted by GitBox <gi...@apache.org>.
zhujunxxxxx commented on a change in pull request #10410:
URL: https://github.com/apache/shardingsphere/pull/10410#discussion_r641571863



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -964,23 +964,136 @@ alterSynonym
     ;
 
 alterTablePartitioning
-    : addTablePartition | dropTablePartition
+    : modifyTablePartition
+    | moveTablePartition
+    | addTablePartition
+    | coalesceTablePartition
+    | dropTablePartition
+    ;
+
+modifyTablePartition
+    : modifyRangePartition
+    | modifyHashPartition
+    | modifyListPartition
+    ;
+
+modifyRangePartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES
+    | readOnlyClause | indexingClause)
+    ;
+
+modifyHashPartition
+    : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition
+    | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+modifyListPartition
+    : MODIFY partitionExtendedName (partitionAttributes
+    | (ADD | DROP) VALUES LP_ listValues RP_
+    | (addRangeSubpartition | addHashSubpartition | addListSubpartition)
+    | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause)
+    ;
+
+partitionExtendedName
+    : PARTITION partitionName
+    | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_
+    ;
+
+addRangeSubpartition
+    : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+dependentTablesClause
+    : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_
+    (tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_
+    ;
+
+addHashSubpartition
+    : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause?
+    ;
+
+addListSubpartition
+    : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses?
+    ;
+
+coalesceTableSubpartition
+    : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering?
+    ;
+
+allowDisallowClustering
+    : (ALLOW | DISALLOW) CLUSTERING
+    ;
+
+alterMappingTableClauses
+    : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause)
+    ;
+
+deallocateUnusedClause
+    : DEALLOCATE UNUSED (KEEP sizeClause)?
+    ;
+
+allocateExtentClause
+    : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_) RP_)?
+    ;
+
+partitionSpec
+    : PARTITION partitionName? tablePartitionDescription?
+    ;
+
+partitionAttributes
+    : (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)?
+      (OVERFLOW (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause)?)?
+      tableCompression? inmemoryClause?
+    ;
+
+shrinkClause
+    : SHRINK SPACE COMPACT? CASCADE?
+    ;
+
+moveTablePartition
+    : MOVE partitionExtendedName (MAPPING TABLE)? tablePartitionDescription? filterCondition? updateAllIndexesClause? parallelClause? allowDisallowClustering? ONLINE?
+    ;
+
+filterCondition
+    : INCLUDING ROWS whereClause
+    ;
+
+whereClause
+    : WHERE expr
+    ;
+
+coalesceTablePartition
+    : COALESCE PARTITION updateIndexClauses? parallelClause? allowDisallowClustering?
     ;
 
 addTablePartition
-    : ADD (addRangePartitionClause | addListPartitionClause)
+    : ADD ((PARTITION partitionName? addRangePartitionClause (COMMA_ PARTITION partitionName? addRangePartitionClause)*)
+        |  (PARTITION partitionName? addListPartitionClause (COMMA_ PARTITION partitionName? addListPartitionClause)*)
+        |  (PARTITION partitionName? addSystemPartitionClause (COMMA_ PARTITION partitionName? addSystemPartitionClause)*)
+        |  (PARTITION partitionName? addHashPartitionClause (COMMA_ PARTITION partitionName? addHashPartitionClause)*)
+        ) dependentTablesClause?
     ;
 
 addRangePartitionClause
-    : PARTITION partitionName? rangeValuesClause tablePartitionDescription
+    : rangeValuesClause tablePartitionDescription? externalPartSubpartDataProps?
     ((LP_? rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* | listSubpartitionDesc (COMMA_ listSubpartitionDesc)* | individualHashSubparts (COMMA_ individualHashSubparts)* RP_?)
-        | hashSubpartitionQuantity)?
+    | hashSubpartitionQuantity)? updateIndexClauses?

Review comment:
       Yes, I will fix it.




-- 
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:
users@infra.apache.org