strongduanmu commented on a change in pull request #8512:
URL: https://github.com/apache/shardingsphere/pull/8512#discussion_r538525316
##########
File path:
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/validator/dml/impl/ShardingInsertStatementValidator.java
##########
@@ -90,5 +94,8 @@ private boolean isAllSameTables(final Collection<String>
tableNames) {
@Override
public void postValidate(final InsertStatement sqlStatement, final
RouteContext routeContext) {
+ if (needCheckShardingKey) {
+ Preconditions.checkState(routeContext.getRouteUnits().size() > 0,
"Sharding value must same with subquery.");
Review comment:
Why this check condition is different from the check condition in
`ShardingSelectStatementValidator`? 🤔
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]