Icesource commented on a change in pull request #10383:
URL: https://github.com/apache/shardingsphere/pull/10383#discussion_r635899399
##########
File path:
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DDLStatement.g4
##########
@@ -91,6 +91,18 @@ columnConstraint
: (CONSTRAINT ignoredIdentifier)? (primaryKeyConstraint |
columnForeignKeyConstraint | checkConstraint)
;
+computedColumnConstraint
+ : (CONSTRAINT ignoredIdentifier)? (primaryKeyConstraint |
computedColumnForeignKeyConstraint | checkConstraint)
+ ;
+
+computedColumnForeignKeyConstraint
+ : (FOREIGN KEY)? tableName (LP_ columnName RP_)?
computedColumnForeignKeyOnAction*
+ ;
+
+computedColumnForeignKeyOnAction
+ : ON DELETE (NO ACTION | CASCADE) | ON UPDATE NO ACTION | NOT FOR
REPLICATION
+ ;
+
Review comment:
@jingshanglu ```fileTableClause``` is different from
```<computed_column_definition>```. ```As``` in ```fileTableClause``` and
```computedColumnDefinition``` may appear at the same time. So I think their
parsing rules should be separated. Is that right?
```
CREATE TABLE
{ database_name.schema_name.table_name | schema_name.table_name |
table_name }
[ AS FileTable ]
( { <column_definition>
| **<computed_column_definition>**
| <column_set_definition>
| [ <table_constraint> ] [ ,... n ]
| [ <table_index> ] }
[ ,...n ]
[ PERIOD FOR SYSTEM_TIME ( system_start_time_column_name
, system_end_time_column_name ) ]
)
[ ON { partition_scheme_name ( partition_column_name )
| filegroup
| "default" } ]
[ TEXTIMAGE_ON { filegroup | "default" } ]
[ FILESTREAM_ON { partition_scheme_name
| filegroup
| "default" } ]
[ WITH ( <table_option> [ ,...n ] ) ]
[ ; ]
```
--
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]