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 2021/09/07 10:10:22 UTC

[GitHub] [shardingsphere] stephensuxun opened a new issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

stephensuxun opened a new issue #12270:
URL: https://github.com/apache/shardingsphere/issues/12270


   There are only ainews in the database_ user_ 0 and ainews_ user_ 1 no ainews_user table
   
   Use user_ ID is used as the condition for splitting the table by querying user_ ID, report an error
   
   "nested exception is org.apache.ibatis.exceptions.PersistenceException: \n### Error querying database.  Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]\nPossible solutions: drop(int), any(), find(), find(java.util.regex.Pattern), find(groovy.lang.Closure), find(java.lang.CharSequence)\n### The error may exist in com/ims/cloud/hidden/core/hidden/mapper/AiNewsUserMapper.java (best guess)\n### The error may involve defaultParameterMap\n### The error occurred while setting parameters\n### SQL: SELECT  user_id,user_account,user_name,nick_name,user_password,user_header_portrait,user_email,user_used_amount AS usedAmount,user_total_usage,user_salt,user_secret,user_status,user_type,is_authentication,user_grade,user_point,user_create_amount,user_collect_amount,expiration_date,create_time,update_time,token,version,deleted  FROM ainews_user   WHERE  deleted=0  AND (user_id = ?)\n### Cau
 se: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]\nPossible solutions: drop(int), any(), find(), find(java.util.regex.Pattern), find(groovy.lang.Closure), find(java.lang.CharSequence)"


-- 
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] sandynz commented on issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

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


   > No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   
   > algorithm-expression=ainews_user_$->{user_id % 2}
   
   Hi @stephensuxun , seems `user_id` column is `varchar`, could you provide the `ainews_user` table definition SQL?
   


-- 
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] stephensuxun commented on issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

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


   spring.shardingsphere.datasource.names=ds0
   
   spring.shardingsphere.sharding.default-data-source-name=ds0
   
   spring.shardingsphere.datasource.common.driver-class-name=com.mysql.cj.jdbc.Driver
   
   spring.shardingsphere.datasource.ds0.username=root
   spring.shardingsphere.datasource.ds0.password=root
   spring.shardingsphere.datasource.ds0.url=jdbc:mysql://localhost:3306/ims-hidden?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
   spring.shardingsphere.datasource.ds0.type=com.alibaba.druid.pool.DruidDataSource
   
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.type=INLINE
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.props.algorithm-expression=ainews_user_$->{user_id % 2}
   
   spring.shardingsphere.rules.sharding.tables.ainews_user.actual-data-nodes=ds$->{0}.ainews_user_$->{0..1}
   
   spring.shardingsphere.rules.sharding.tables.ainews_user.database-strategy.standard.sharding-column=user_id
   spring.shardingsphere.rules.sharding.tables.ainews_user.database-strategy.standard.sharding-algorithm-name=database-inline
   
   spring.shardingsphere.rules.sharding.tables.ainews_user.table-strategy.standard.sharding-column=user_id
   spring.shardingsphere.rules.sharding.tables.ainews_user.table-strategy.standard.sharding-algorithm-name=table-inline
   
   spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
   spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
   
   spring.shardingsphere.props.sql.show=true
   
   spring.main.allow-bean-definition-overriding = true


-- 
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] sandynz closed issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

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


   


-- 
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] stephensuxun commented on issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

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


   The database uses mysql8.0 and shardingsphere uses 5.0 beta


-- 
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] stephensuxun commented on issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

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


   My problem hasn't been solved yet


-- 
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] sandynz commented on issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

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


   I'll close it now. Welcome to submit new issue if problem still exists.


-- 
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] RaigorJiang commented on issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

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


   Hi @stephensuxun 
   Welcome to the community.
   
   I read your configuration and there are many questions:
   1. There is only one datasource, why configure `database-strategy`?
   2. Did not see the algorithm configuration called `database-inline`, but you use it.
   3. Please check the type `user_id`, because the log prompts that no mod method can be found.
   
   Please refer to the example: https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-jdbc-example/sharding-example/sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-tables.properties


-- 
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] stephensuxun removed a comment on issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

Posted by GitBox <gi...@apache.org>.
stephensuxun removed a comment on issue #12270:
URL: https://github.com/apache/shardingsphere/issues/12270#issuecomment-914190895


   
   spring.shardingsphere.datasource.names=ds0
   
   spring.shardingsphere.sharding.default-data-source-name=ds0
   
   spring.shardingsphere.datasource.common.driver-class-name=com.mysql.cj.jdbc.Driver
   
   spring.shardingsphere.datasource.ds0.username=root
   spring.shardingsphere.datasource.ds0.password=suxun8629511
   spring.shardingsphere.datasource.ds0.url=jdbc:mysql://123.57.64.150:3306/ims-hidden?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
   spring.shardingsphere.datasource.ds0.type=com.alibaba.druid.pool.DruidDataSource
   
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.type=INLINE
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.props.algorithm-expression=ainews_user_$->{user_id % 2}
   
   spring.shardingsphere.rules.sharding.tables.ainews_user.actual-data-nodes=ds$->{0}.ainews_user_$->{0..1}
   
   spring.shardingsphere.rules.sharding.tables.ainews_user.database-strategy.standard.sharding-column=user_id
   spring.shardingsphere.rules.sharding.tables.ainews_user.database-strategy.standard.sharding-algorithm-name=database-inline
   
   spring.shardingsphere.rules.sharding.tables.ainews_user.table-strategy.standard.sharding-column=user_id
   spring.shardingsphere.rules.sharding.tables.ainews_user.table-strategy.standard.sharding-algorithm-name=table-inline
   
   spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
   spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
   
   
   spring.shardingsphere.props.sql.show=true
   
   spring.main.allow-bean-definition-overriding = true


-- 
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] RaigorJiang commented on issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

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


   @stephensuxun 
   Is your sharding column `user_id` not a number type?


-- 
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] RaigorJiang commented on issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

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


   > Hi @stephensuxun
   > Welcome to the community.
   > 
   > I read your configuration and there are many questions:
   > 
   > 1. There is only one datasource, why configure `database-strategy`?
   > 2. Did not see the algorithm configuration called `database-inline`, but you use it.
   > 3. Please check the type `user_id`, because the log prompts that no mod method can be found.
   > 
   > Please refer to the example: https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-jdbc-example/sharding-example/sharding-spring-boot-mybatis-example/src/main/resources/application-sharding-tables.properties
   
   These questions I mentioned before, please answer the first and third points?


-- 
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] RaigorJiang commented on issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

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


   Hi @stephensuxun 
   Is your problem solved?


-- 
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] stephensuxun commented on issue #12270: Problems in deleting data using shardingsphere 5.0.0-beta

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


   
   spring.shardingsphere.datasource.names=ds0
   
   spring.shardingsphere.sharding.default-data-source-name=ds0
   
   spring.shardingsphere.datasource.common.driver-class-name=com.mysql.cj.jdbc.Driver
   
   spring.shardingsphere.datasource.ds0.username=root
   spring.shardingsphere.datasource.ds0.password=suxun8629511
   spring.shardingsphere.datasource.ds0.url=jdbc:mysql://123.57.64.150:3306/ims-hidden?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
   spring.shardingsphere.datasource.ds0.type=com.alibaba.druid.pool.DruidDataSource
   
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.type=INLINE
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.props.algorithm-expression=ainews_user_$->{user_id % 2}
   
   spring.shardingsphere.rules.sharding.tables.ainews_user.actual-data-nodes=ds$->{0}.ainews_user_$->{0..1}
   
   spring.shardingsphere.rules.sharding.tables.ainews_user.database-strategy.standard.sharding-column=user_id
   spring.shardingsphere.rules.sharding.tables.ainews_user.database-strategy.standard.sharding-algorithm-name=database-inline
   
   spring.shardingsphere.rules.sharding.tables.ainews_user.table-strategy.standard.sharding-column=user_id
   spring.shardingsphere.rules.sharding.tables.ainews_user.table-strategy.standard.sharding-algorithm-name=table-inline
   
   spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
   spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
   
   
   spring.shardingsphere.props.sql.show=true
   
   spring.main.allow-bean-definition-overriding = true


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