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 2020/12/22 09:18:56 UTC

[GitHub] [shardingsphere] terrymanu commented on a change in pull request #8713: Support create replica_query rule.

terrymanu commented on a change in pull request #8713:
URL: https://github.com/apache/shardingsphere/pull/8713#discussion_r547159390



##########
File path: shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/RDLStatement.g4
##########
@@ -63,6 +63,14 @@ createShardingRule
     : CREATE SHARDING RULE LP shardingTableRuleDefinition (COMMA shardingTableRuleDefinition)* RP
     ;
 
+createReplicaQueryRule
+    : CREATE REPLICA_QUERY RULE LP replicaQueryRule (COMMA replicaQueryRule)* RP

Review comment:
       replicaQueryRule should rename to replicaQueryRuleDefinition

##########
File path: shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/RDLStatement.g4
##########
@@ -63,6 +63,14 @@ createShardingRule
     : CREATE SHARDING RULE LP shardingTableRuleDefinition (COMMA shardingTableRuleDefinition)* RP
     ;
 
+createReplicaQueryRule
+    : CREATE REPLICA_QUERY RULE LP replicaQueryRule (COMMA replicaQueryRule)* RP
+    ;
+
+replicaQueryRule
+    : rule_name=IDENTIFIER LP PRIMARY EQ primary_ds=schemaName COMMA REPLICA EQ schemaNames RP load_balancer=IDENTIFIER LP  funcProperties RP

Review comment:
       primary_ds should rename to primary

##########
File path: shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/RDLStatement.g4
##########
@@ -63,6 +63,14 @@ createShardingRule
     : CREATE SHARDING RULE LP shardingTableRuleDefinition (COMMA shardingTableRuleDefinition)* RP
     ;
 
+createReplicaQueryRule
+    : CREATE REPLICA_QUERY RULE LP replicaQueryRule (COMMA replicaQueryRule)* RP
+    ;
+
+replicaQueryRule
+    : rule_name=IDENTIFIER LP PRIMARY EQ primary_ds=schemaName COMMA REPLICA EQ schemaNames RP load_balancer=IDENTIFIER LP  funcProperties RP

Review comment:
       Please do not use underline to name variable

##########
File path: shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/RDLStatement.g4
##########
@@ -102,3 +110,23 @@ columName
 dropShardingRule
     : DROP SHARDING RULE LP tableName (COMMA tableName)* RP
     ;
+
+ruleType
+    : SHARDING | REPLICA_QUERY | ENCRYPT | SHADOW
+    ;
+
+schemaNames
+    : schemaName (COMMA schemaName)*
+    ;
+
+schemaName
+    : IDENTIFIER
+    ;
+
+funcProperties

Review comment:
       What's mean of funcProperties, where is the `func`?

##########
File path: shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/imports/RDLStatement.g4
##########
@@ -102,3 +110,23 @@ columName
 dropShardingRule
     : DROP SHARDING RULE LP tableName (COMMA tableName)* RP
     ;
+
+ruleType
+    : SHARDING | REPLICA_QUERY | ENCRYPT | SHADOW
+    ;
+
+schemaNames
+    : schemaName (COMMA schemaName)*
+    ;
+
+schemaName
+    : IDENTIFIER
+    ;
+
+funcProperties
+    : funcPropertie (COMMA funcPropertie)*
+    ;
+
+funcPropertie

Review comment:
       `Propertie` is typo

##########
File path: shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/DistSQLStatement.g4
##########
@@ -25,5 +25,6 @@ execute
     | dropShardingRule
     | showResources
     | showRule
+    | createReplicaQueryRule

Review comment:
       Please move it about showXXX




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