insert statement error : Route table does not exist, available actual table
See original GitHub issueQuestion
The table created by the DDL statement was successfully created on shardingsphere-proxy. But an error occurs when using the inset statement to insert, can you help explain what the problem is?
this is my config file
schemaName: sharding_db
dataSources:
master_0:
url: jdbc:mysql://192.168.80.172:23306/demo_0?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: Aa123456.
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
slave_0:
url: jdbc:mysql://192.168.80.172:23307/demo_0?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: Aa123456.
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
master_1:
url: jdbc:mysql://192.168.80.176:23306/demo_1?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: Aa123456.
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
slave_1:
url: jdbc:mysql://192.168.80.176:23307/demo_1?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: Aa123456.
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
rules:
- !SHARDING
defaultTableStrategy:
none:
tables:
biz_ymcz_minclass:
actualDataNodes: master_0.biz_ymcz_minclass_${[36]},master_1.biz_ymcz_minclass_${[41]}
tableStrategy:
standard:
shardingColumn: area_code
shardingAlgorithmName: biz_ymcz_minclass_inline
keyGenerateStrategy:
column: id
keyGeneratorName: snowflake
biz_ymcz:
actualDataNodes: master_0.biz_ymcz_${[36]},master_1.biz_ymcz_${[41]}
tableStrategy:
standard:
shardingColumn: area_code
shardingAlgorithmName: biz_ymcz_inline
keyGenerateStrategy:
column: id
keyGeneratorName: snowflake
shardingAlgorithms:
biz_ymcz_inline:
type: INLINE
props:
algorithm-expression: biz_ymcz_${area_code[0..1]}
biz_ymcz_minclass_inline:
type: INLINE
props:
algorithm-expression: biz_ymcz_minclass_${area_code[0..1]}
keyGenerators:
snowflake:
type: SNOWFLAKE
- !READWRITE_SPLITTING
dataSources:
master_0:
type: Static
props:
write-data-source-name: master_0
read-data-source-names: slave_0
master_1:
type: Static
props:
write-data-source-name: master_1
read-data-source-names: slave_1
The successfully created table is shown in the following figure, on two different master nodes respectively


This is the error message
1997 - Runtime exception: [Route table biz_ymcz_minclass_36 does not exist, available actual table: [biz_ymcz_minclass_41]], Time: 0.049000s
The versions I have tried are 5.0.0
, 5.1.0
Issue Analytics
- State:
- Created a year ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Show error message: Route table null does not exist ... - GitHub
insert data to databases and success. Actual behavior. show message: Route table null does not exist, available actual table. Reason analyze (If ...
Read more >sql - Get table does not exist error, when trying to insert into ...
However, the table does exist and I can run queries on it and it returns the data I inserted when I created the...
Read more >Database Engine events and errors - SQL Server
In this article. The table contains error message numbers and the description, which is the text of the error message from the sys.messages...
Read more >MySQL 8.0 Reference Manual :: 13.2.7 INSERT Statement
In this case, a value for each named column must be provided by the VALUES list, VALUES ROW() list, or SELECT statement. For...
Read more >ELT Insert-Select - SnapLogic Documentation - Confluence
Returns an error if any specified column name is not found in the target table. Some Source and Target Column names are identical,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @zorohu, I found some problems from your configuration. First problem is dataSourceName in actualDataNodes. If you want to use read-write splitting feature, you need to configure read-write splitting aggregation data source with a unique name and use it in actualDataNodes. I made the following modifications to your configuration.
The second problem is that according to the sharding strategy you specified, the actual table cannot be found, and you need to adjust the sharding strategy. The current sharding strategy routes insert statements to the
biz_ymcz_minclass_36
table of theds_1
data source.this is a simplified version of the initialization statement