apache / shardingsphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
Apache License 2.0
19.78k stars 6.7k forks source link

Multi-table query left join lookup table #32648

Closed wangjianxin323 closed 6 days ago

wangjianxin323 commented 3 weeks ago

this is my config: dataSources: ds0: driverClassName: com.mysql.jdbc.Driver jdbcUrl: jdbc:mysql://127.0.0.1:3306/sdbilling2?useSSL=true&allowPublicKeyRetrieval=true&socketTimeout=60000&connectTimeout=60000&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&autoReconnect=true username: root password: '123123FFFfff' dataSourceClassName: com.zaxxer.hikari.HikariDataSource connectionTimeout: 60000 props: sql-show: show rules:

and this is my sql: SELECT COUNT(*) AS total FROM iotcard_user_rate a JOIN iotcard_package b ON a.package_id = b.id JOIN iotcard_package_group c ON b.pack_group_id = c.id WHERE 1 = 1 AND a.user_id = ? AND c.id = ? AND a.up_user_id = ?

Among them iotcard_user_rate I set the sharding,iotcard_package is a single table.

the error is Cause: org.apache.shardingsphere.infra.exception.kernel.metadata.TableNotFoundException: Table or view 'iotcard_package' does not exist. But this table exists in my database.

Can you help me find out what's causing it? My version is 5.5.0

terrymanu commented 3 weeks ago

Is iotcard_package a single table?

github-actions[bot] commented 1 week ago

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.