-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting table or view doesnt exists exception #34456
Comments
I have same tables in both databases and want to do only db sharding |
How to reproduce it? |
@terrymanu then try rest endpoint |
@terrymanu Adding schema to entity fixed the issue though |
Welcome volunteer investigate together. |
@terrymanu I can volunteer |
@rsingh0015 Welcome, I just assign this issue to you. |
Question
ShardingSphere-jdbc: 5.5.2
YAML
`dataSources:
ds0:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.postgresql.Driver
jdbcUrl: jdbc:postgresql://postgres:5432/rug?currentSchema=test_schema
username: test
password: password
maxPoolSize: 2
minPoolSize: 2
ds1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.postgresql.Driver
jdbcUrl: jdbc:postgresql://postgres:5432/rug?currentSchema=test_schema
username: test
password: password
maxPoolSize: 2
minPoolSize: 2
rules:
tables:
table_one:
actualDataNodes: ds${0..1}.table_one
table_one:
actualDataNodes: ds${0..1}.table_twp
defaultDatabaseStrategy:
standard:
shardingColumn: cycle_code
shardingAlgorithmName: database_inline
defaultTableStrategy:
none:
shardingAlgorithms:
database_inline:
type: INLINE
props:
algorithm-expression: ds${ if (cycle_code as Integer >= 1 && cycle_code as Integer < 58) {return 1} else {return 0}}
props:
sql-show: true`
Exception
Caused by: org.apache.shardingsphere.infra.exception.kernel.metadata.TableNotFoundException: Table or view 'table_one' does not exist. 2025-01-23 12:21:01 at org.apache.shardingsphere.infra.binder.engine.segment.dml.from.type.SimpleTableSegmentBinder.lambda$checkTableExists$12(SimpleTableSegmentBinder.java:178) 2025-01-23 12:21:01 at org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions.checkState(ShardingSpherePreconditions.java:44) 2025-01-23 12:21:01 at org.apache.shardingsphere.infra.binder.engine.segment.dml.from.type.SimpleTableSegmentBinder.checkTableExists(SimpleTableSegmentBinder.java:178) 2025-01-23 12:21:01 at org.apache.shardingsphere.infra.binder.engine.segment.dml.from.type.SimpleTableSegmentBinder.bind(SimpleTableSegmentBinder.java:90) 2025-01-23 12:21:01 at org.apache.shardingsphere.infra.binder.engine.segment.dml.from.TableSegmentBinder.bind(TableSegmentBinder.java:57) 2025-01-23 12:21:01 at org.apache.shardingsphere.infra.binder.engine.statement.dml.SelectStatementBinder.lambda$bind$1(SelectStatementBinder.java:64) 2025-01-23 12:21:01 at java.base/java.util.Optional.map(Optional.java:260) 2025-01-23 12:21:01 at org.apache.shardingsphere.infra.binder.engine.statement.dml.SelectStatementBinder.bind(SelectStatementBinder.java:64) 2025-01-23 12:21:01 at org.apache.shardingsphere.infra.binder.engine.type.DMLStatementBindEngine.bind(DMLStatementBindEngine.java:61) 2025-01-23 12:21:01 at org.apache.shardingsphere.infra.binder.engine.SQLBindEngine.bindSQLStatement(SQLBindEngine.java:68) 2025-01-23 12:21:01 at org.apache.shardingsphere.infra.binder.engine.SQLBindEngine.bind(SQLBindEngine.java:58) 2025-01-23 12:21:01 at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.<init>(ShardingSpherePreparedStatement.java:143) 2025-01-23 12:21:01 at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.<init>(ShardingSpherePreparedStatement.java:115) 2025-01-23 12:21:01 at org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection.prepareStatement(ShardingSphereConnection.java:108) 2025-01-23 12:21:01 at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:153) 2025-01-23 12:21:01 at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183)
The text was updated successfully, but these errors were encountered: