You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "RaigorJiang (via GitHub)" <gi...@apache.org> on 2023/04/24 16:21:21 UTC

[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #25263: Incorrect HINT_INLINE algorithm expression in RDL tests

RaigorJiang commented on code in PR #25263:
URL: https://github.com/apache/shardingsphere/pull/25263#discussion_r1175522820


##########
test/it/parser/src/main/resources/sql/supported/rdl/create.xml:
##########
@@ -47,10 +47,10 @@
     <sql-case id="create-default-sharding-table-strategy-with-lower-case" value="create default sharding table strategy(type='standard', sharding_column=order_id, SHARDING_ALGORITHM(TYPE(NAME='INLINE',PROPERTIES('algorithm-expression'='t_order_${order_id % 2}'))))" db-types="ShardingSphere" />
     <sql-case id="create-default-sharding-table-strategy-if-not-exists-with-lower-case" value="create default sharding table strategy if not exists(type='standard', sharding_column=order_id, SHARDING_ALGORITHM(TYPE(NAME='INLINE',PROPERTIES('algorithm-expression'='t_order_${order_id % 2}'))))" db-types="ShardingSphere" />
     <sql-case id="create-default-sharding-table-strategy-with-complex-strategy-type" value="CREATE DEFAULT SHARDING TABLE STRATEGY (TYPE='complex', SHARDING_COLUMNS=user_id,order_id, SHARDING_ALGORITHM(TYPE(NAME=COMPLEX_INLINE, PROPERTIES('algorithm-expression'='${user_id % 2}_${order_id % 2}'))));" db-types="ShardingSphere" />
-    <sql-case id="create-default-sharding-table-strategy-with-hint-strategy-type" value="CREATE DEFAULT SHARDING TABLE STRATEGY (TYPE='hint', SHARDING_COLUMN=user_id, SHARDING_ALGORITHM(TYPE(NAME=HINT_INLINE, PROPERTIES('algorithm-expression'='t_order_${user_id % 2}'))));" db-types="ShardingSphere" />
+    <sql-case id="create-default-sharding-table-strategy-with-hint-strategy-type" value="CREATE DEFAULT SHARDING TABLE STRATEGY (TYPE='hint', SHARDING_COLUMN=user_id, SHARDING_ALGORITHM(TYPE(NAME=HINT_INLINE, PROPERTIES('algorithm-expression'='t_order_${value % 2}'))));" db-types="ShardingSphere" />
     <sql-case id="create-default-sharding-table-strategy-with-none-strategy-type" value="CREATE DEFAULT SHARDING TABLE STRATEGY (TYPE='none');" db-types="ShardingSphere" />
     <sql-case id="create-default-sharding-database-strategy-with-complex-strategy-type" value="CREATE DEFAULT SHARDING DATABASE STRATEGY (TYPE='complex', SHARDING_COLUMNS=user_id,order_id, SHARDING_ALGORITHM(TYPE(NAME=COMPLEX_INLINE, PROPERTIES('algorithm-expression'='t_order_${user_id % 2}_${order_id % 2}'))));" db-types="ShardingSphere" />
-    <sql-case id="create-default-sharding-database-strategy-with-hint-strategy-type" value="CREATE DEFAULT SHARDING DATABASE STRATEGY (TYPE='hint', SHARDING_COLUMN=user_id, SHARDING_ALGORITHM(TYPE(NAME=HINT_INLINE, PROPERTIES('algorithm-expression'='t_order_${user_id % 2}'))));" db-types="ShardingSphere" />
+    <sql-case id="create-default-sharding-database-strategy-with-hint-strategy-type" value="CREATE DEFAULT SHARDING DATABASE STRATEGY (TYPE='hint', SHARDING_COLUMN=user_id, SHARDING_ALGORITHM(TYPE(NAME=HINT_INLINE, PROPERTIES('algorithm-expression'='t_order_${value % 2}'))));" db-types="ShardingSphere" />

Review Comment:
   In fact, the `HINT_INLINE` algorithm does not need `SHARDING COLUMN`, we can remove `SHARDING_COLUMN` from SQL.
   
   And there is a [YAML configuration ](https://github.com/apache/shardingsphere/blob/66c42e9d667433b4eed5a03570df82fe0c1ad472/test/e2e/sql/src/test/resources/env/scenario/tbl/rules.yaml#L62)for reference.



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org