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 2022/02/16 08:48:58 UTC

[GitHub] [shardingsphere] wjf870128 opened a new issue #15442: [DistSQL]CREATE SHARDING TABLE RULE report syntax

wjf870128 opened a new issue #15442:
URL: https://github.com/apache/shardingsphere/issues/15442


   shardingsphere-proxy : 5.1.0
   DistSQL step:
   1)CREATE SHARDING KEY GENERATOR snowflake_key_generator (TYPE(NAME=SNOWFLAKE));
   2)CREATE SHARDING ALGORITHM database_inline (
   TYPE(NAME=inline,PROPERTIES("algorithm-expression"="ts_${user_id % 4}"))
   );
   3)CREATE SHARDING ALGORITHM table_inline (
   TYPE(NAME=inline,PROPERTIES("algorithm-expression"="t_order_${order_id % 4}"))
   );
   4)CREATE SHARDING TABLE RULE t_order (
   DATANODES("ts_${0..3}.t_order_${0..3}"),
   DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=user_id,SHARDING_ALGORITHM=database_inline),
   TABLE_STRATEGY(TYPE=standard,SHARDING_COLUMN=order_id,SHARDING_ALGORITHM=table_inline),
   GENERATED_KEY(COLUMN=id,GENERATED_KEY_ALGORITHM=snowflake_key_generator)
   );
   then report the error:ERROR 1235 (42000): This version of ShardingSphere-Proxy doesn't yet support this SQL. 'You have an error in your SQL syntax'。
   If I change the 4 step to the following referenced the document:
   CREATE SHARDING TABLE RULE t_order (
   DATANODES("ts_${0..3}.t_order_${0..3}"),
   DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=user_id,SHARDING_ALGORITHM(TYPE(NAME=inline,PROPERTIES("algorithm-expression"="ts_${user_id % 4}")))),
   TABLE_STRATEGY(TYPE=standard,SHARDING_COLUMN=order_id,SHARDING_ALGORITHM=table_inline),
   GENERATED_KEY(COLUMN=id,GENERATED_KEY_ALGORITHM=snowflake_key_generator)
   );
   The error is also occured.
   


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



[GitHub] [shardingsphere] lanchengx commented on issue #15442: [DistSQL]CREATE SHARDING TABLE RULE report syntax

Posted by GitBox <gi...@apache.org>.
lanchengx commented on issue #15442:
URL: https://github.com/apache/shardingsphere/issues/15442#issuecomment-1042504581


   @wjf870128 Thanks your feedback, 5.1.0 The syntax has been adjusted, `GENERATED_KEY` has been replaced with `KEY_GENERATE_STRATEGY`, please refer to https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/syntax/rdl /rule-definition/sharding/


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



[GitHub] [shardingsphere] lanchengx closed issue #15442: [DistSQL]CREATE SHARDING TABLE RULE report syntax

Posted by GitBox <gi...@apache.org>.
lanchengx closed issue #15442:
URL: https://github.com/apache/shardingsphere/issues/15442


   


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



[GitHub] [shardingsphere] lanchengx edited a comment on issue #15442: [DistSQL]CREATE SHARDING TABLE RULE report syntax

Posted by GitBox <gi...@apache.org>.
lanchengx edited a comment on issue #15442:
URL: https://github.com/apache/shardingsphere/issues/15442#issuecomment-1042504581


   @wjf870128 Thanks your feedback, 5.1.0 The syntax has been adjusted, `GENERATED_KEY` has been replaced with `KEY_GENERATE_STRATEGY`, please refer to https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/sharding/


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



[GitHub] [shardingsphere] wjf870128 commented on issue #15442: [DistSQL]CREATE SHARDING TABLE RULE report syntax

Posted by GitBox <gi...@apache.org>.
wjf870128 commented on issue #15442:
URL: https://github.com/apache/shardingsphere/issues/15442#issuecomment-1042526189


   > @wjf870128 Thanks your feedback, 5.1.0 The syntax has been adjusted, `GENERATED_KEY` has been replaced with `KEY_GENERATE_STRATEGY`, please refer to https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/sharding/
   
   Thanks,that's ok!
   
   CREATE SHARDING TABLE RULE t_order (
   DATANODES("ts_${0..3}.t_order_${0..3}"),
   DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=user_id,SHARDING_ALGORITHM=database_inline),
   TABLE_STRATEGY(TYPE=standard,SHARDING_COLUMN=order_id,SHARDING_ALGORITHM=table_inline),
   KEY_GENERATE_STRATEGY(COLUMN=id,KEY_GENERATOR=snowflake_key_generator)
   );


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