You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "qiuweilu (via GitHub)" <gi...@apache.org> on 2023/07/27 03:00:21 UTC
[GitHub] [shardingsphere] qiuweilu opened a new issue, #27494: Error querying database. Cause: java.sql.SQLException: Table 'user_order' doesn't exist
qiuweilu opened a new issue, #27494:
URL: https://github.com/apache/shardingsphere/issues/27494
## Bug Report
**For English only**, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
- Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will **close it**.
Please answer these questions before submitting your issue. Thanks!
### Which version of ShardingSphere did you use?
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
### Expected behavior
### Actual behavior
### Reason analyze (If you can)
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
### Example codes for reproduce this issue (such as a github link).
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] freenet-233 commented on issue #27494: Error querying database. Cause: java.sql.SQLException: Table 'user_order' doesn't exist
Posted by "freenet-233 (via GitHub)" <gi...@apache.org>.
freenet-233 commented on issue #27494:
URL: https://github.com/apache/shardingsphere/issues/27494#issuecomment-1657945460
How to solve it via JAVA API ?
--
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] qiuweilu closed issue #27494: Error querying database. Cause: java.sql.SQLException: Table 'user_order' doesn't exist
Posted by "qiuweilu (via GitHub)" <gi...@apache.org>.
qiuweilu closed issue #27494: Error querying database. Cause: java.sql.SQLException: Table 'user_order' doesn't exist
URL: https://github.com/apache/shardingsphere/issues/27494
--
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] kimmking commented on issue #27494: Error querying database. Cause: java.sql.SQLException: Table 'user_order' doesn't exist
Posted by "kimmking (via GitHub)" <gi...@apache.org>.
kimmking commented on issue #27494:
URL: https://github.com/apache/shardingsphere/issues/27494#issuecomment-1653839072
where is the user_order table config?
--
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] qiuweilu commented on issue #27494: Error querying database. Cause: java.sql.SQLException: Table 'user_order' doesn't exist
Posted by "qiuweilu (via GitHub)" <gi...@apache.org>.
qiuweilu commented on issue #27494:
URL: https://github.com/apache/shardingsphere/issues/27494#issuecomment-1652842604
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>5.4.0</version>
</dependency>
**springboot 2.7
@Scheduled(cron = "0 */2 * * * ?", zone = "Asia/Shanghai")
Error querying database. Cause: java.sql.SQLException: Table 'user_order' doesn't exist
user_ order is a single table without sharding**
mode:
type: Standalone
repository:
type: JDBC
dataSources:
ds_0:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.cj.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/foxwish?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2B8
username: root
password: 123456
rules:
- !SHARDING
tables:
user_media:
actualDataNodes: ds_0.user_media_${0..9}
tableStrategy:
standard:
shardingColumn: part_fkid
shardingAlgorithmName: t_media_inline
part_cmnt:
actualDataNodes: ds_0.part_cmnt_${0..9}
tableStrategy:
standard:
shardingColumn: part_fkid
shardingAlgorithmName: t_cmnt_inline
part_vote:
actualDataNodes: ds_0.part_vote_${0..9}
tableStrategy:
standard:
shardingColumn: part_fkid
shardingAlgorithmName: t_vote_inline
part_apply:
actualDataNodes: ds_0.part_apply_${0..9}
tableStrategy:
standard:
shardingColumn: part_fkid
shardingAlgorithmName: t_apply_inline
act_stats:
actualDataNodes: ds_0.act_stats_${0..9}
tableStrategy:
standard:
shardingColumn: part_fkid
shardingAlgorithmName: t_stats_inline
user_earn:
actualDataNodes: ds_0.user_earn_${0..9}
tableStrategy:
standard:
shardingColumn: part_fkid
shardingAlgorithmName: t_earn_inline
shardingAlgorithms:
t_media_inline:
type: INLINE
props:
algorithm-expression: user_media_${part_fkid % 10}
t_cmnt_inline:
type: INLINE
props:
algorithm-expression: part_cmnt_${part_fkid % 10}
t_vote_inline:
type: INLINE
props:
algorithm-expression: part_vote_${part_fkid % 10}
t_apply_inline:
type: INLINE
props:
algorithm-expression: part_apply_${part_fkid % 10}
t_stats_inline:
type: INLINE
props:
algorithm-expression: act_stats_${part_fkid % 10}
t_earn_inline:
type: INLINE
props:
algorithm-expression: user_earn_${part_fkid % 10}
props:
sql-show: 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] sunlife95 commented on issue #27494: Error querying database. Cause: java.sql.SQLException: Table 'user_order' doesn't exist
Posted by "sunlife95 (via GitHub)" <gi...@apache.org>.
sunlife95 commented on issue #27494:
URL: https://github.com/apache/shardingsphere/issues/27494#issuecomment-1664180334
> How to solve it via JAVA API ?
i solved with this code
/**
* 初始化单表规则
*/
private SingleRuleConfiguration getSingleRuleConfiguration() {
List<String> singleTableList = Lists.newArrayList();
singleTableList.add("*.*");
return new SingleRuleConfiguration(singleTableList, "ds_0");
}
when i init datasource
// 单表配置
SingleRuleConfiguration singleRuleConfiguration = getSingleRuleConfiguration();
ShardingSphereDataSourceFactory.createDataSource("ds_0", new ModeConfiguration("Standalone", null), createDataSourceMap(), Lists.newArrayList(shardingRuleConfiguration, readwriteSplittingRuleConfiguration), props);
it's not standard code ~ but it worked in my project
--
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] qiuweilu commented on issue #27494: Error querying database. Cause: java.sql.SQLException: Table 'user_order' doesn't exist
Posted by "qiuweilu (via GitHub)" <gi...@apache.org>.
qiuweilu commented on issue #27494:
URL: https://github.com/apache/shardingsphere/issues/27494#issuecomment-1654835742
> Hi @qiuweilu , you can add following config if you want to load all single tables.
>
> ```
> - !SINGLE
> tables:
> - "*.*"
> ```
Thank you. After reading the official document, I didn't write it clearly
--
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] qiuweilu commented on issue #27494: Error querying database. Cause: java.sql.SQLException: Table 'user_order' doesn't exist
Posted by "qiuweilu (via GitHub)" <gi...@apache.org>.
qiuweilu commented on issue #27494:
URL: https://github.com/apache/shardingsphere/issues/27494#issuecomment-1654832240
> user_order
user_order is a single table
--
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] strongduanmu commented on issue #27494: Error querying database. Cause: java.sql.SQLException: Table 'user_order' doesn't exist
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #27494:
URL: https://github.com/apache/shardingsphere/issues/27494#issuecomment-1654808115
Hi @qiuweilu , you can add following config if you want to load all single tables.
```
- !SINGLE
tables:
- "*.*"
```
--
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