jingshanglu commented on a change in pull request #12435:
URL: https://github.com/apache/shardingsphere/pull/12435#discussion_r709087072



##########
File path: 
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DDLStatement.g4
##########
@@ -678,3 +694,97 @@ withCommonTableExpr
 commonTableExpr
     : name (LP_ columnName (COMMA_ columnName)* RP_)? AS LP_ select RP_
     ;
+
+createTriggerClause
+    : (WITH dmlTriggerOption COMMA_ dmlTriggerOption)? (FOR | AFTER | INSTEAD 
OF)
+    INSERT? COMMA_? UPDATE? COMMA_? DELETE? COMMA_? (WITH APPEND)? (NOT FOR 
REPLICATION)?
+    AS (compoundStatement | EXTERNAL NAME methodSpecifier)
+    ;
+
+dmlTriggerOption
+    : ENCRYPTION | executeAsClause | NATIVE_COMPILATION | SCHEMABINDING |
+    ;
+
+methodSpecifier
+    : name DOT_ name DOT_ name
+    ;
+
+triggerTarget
+    : tableName | viewName | ALL SERVER | DATABASE
+    ;
+
+createOrAlterSequenceClause
+    : AS dataType
+    | (START | RESTART) WITH expr
+    | INCREMENT BY expr
+    | MINVALUE expr? | NO MINVALUE
+    | MAXVALUE expr? | NO MAXVALUE
+    | CACHE expr | NO CACHE
+    | NO? CYCLE
+    ;
+
+createIndexClause
+    : (INCLUDE columnNamesWithSort)? (WHERE filterPredicate)? (WITH 
relationalIndexOption (COMMA_ relationalIndexOption)*)?
+    (ON (schemaName LP_ columnName RP_ | name))? (FILESTREAM_ON (name | 
stringLiterals))?
+    ;
+
+filterPredicate
+    : conjunct (AND conjunct)*
+    ;
+
+conjunct
+    : columnName IN LP_ expr (COMMA_ expr)* RP_
+    | columnName comparisonOperator expr
+    ;
+
+alterIndexClause
+    : REBUILD (PARTITION EQ_ (ALL | expr))? (WITH LP_ relationalIndexOption 
(COMMA_ relationalIndexOption)* RP_)?
+    | DISABLE
+    | REORGANIZE (PARTITION EQ_ expr)? (WITH LP_ reorganizeOption RP_)?
+    | SET LP_ setIndexOption (COMMA_ setIndexOption) RP_
+    | RESUME (WITH LP_ resumableIndexOptions (COMMA_ resumableIndexOptions)* 
RP_)?
+    | PAUSE
+    | ABORT
+    ;
+
+relationalIndexOption
+    : PAD_INDEX EQ_ (ON | OFF)
+    | FILLFACTOR EQ_ expr
+    | SORT_IN_TEMPDB EQ_ (ON | OFF)
+    | IGNORE_DUP_KEY EQ_ (ON | OFF)
+    | STATISTICS_NORECOMPUTE EQ_ (ON | OFF)
+    | STATISTICS_INCREMENTAL EQ_ (ON | OFF)
+    | DROP_EXISTING EQ_ (ON | OFF)
+    | ONLINE EQ_ (ON lowPriorityLockWait? | OFF)
+    | RESUMABLE EQ_ (ON | OFF)
+    | MAX_DURATION EQ_ expr MINUTES?
+    | ALLOW_ROW_LOCKS EQ_ (ON | OFF)
+    | ALLOW_PAGE_LOCKS EQ_ (ON | OFF)
+    | OPTIMIZE_FOR_SEQUENTIAL_KEY EQ_ (ON | OFF)
+    | MAXDOP EQ_ expr
+    | DATA_COMPRESSION EQ_ (NONE | ROW | PAGE | COLUMNSTORE | 
COLUMNSTORE_ARCHIVE) (ON PARTITIONS LP_ partitionNumberRange (COMMA_ 
partitionNumberRange)*)?
+    ;
+
+partitionNumberRange
+    : partitionNumber (TO partitionNumber)?
+    ;

Review comment:
       @Icesource Can it be changed like this:
   ```
   partitionNumberRange
       : expr (TO expr)?
       ;
   ```
   and delete rule `partitionNumber`

##########
File path: 
shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/create-sequence.xml
##########
@@ -20,4 +20,12 @@
     <sql-case id="create_sequence" value="CREATE SEQUENCE seq_id" 
db-types="PostgreSQL" />
     <sql-case id="create_sequence_with_option" value="CREATE SEQUENCE 
TEMPORARY seq_option" db-types="PostgreSQL" />
     <sql-case id="create_sequence_complex" value="CREATE SEQUENCE seq_complex 
MINVALUE 0 MAXVALUE 100 START 0" db-types="PostgreSQL" />
+    <sql-case id="create_sequence_with_all_arguments" value="CREATE SEQUENCE 
Test.DecSeq
+        AS decimal(3,0)
+        START WITH 125
+        INCREMENT BY 25
+        MINVALUE 100
+        MAXVALUE 200
+        CYCLE
+        CACHE 3;" db-types="SQLServer" />

Review comment:
       @Icesource Can you add some test about `trigger` and `create index`?




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

To unsubscribe, e-mail: [email protected]

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


Reply via email to