TeslaCN commented on a change in pull request #15498:
URL: https://github.com/apache/shardingsphere/pull/15498#discussion_r810108699
##########
File path:
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java
##########
@@ -314,7 +314,13 @@ public boolean isAllBindingTables(final
ShardingSphereSchema schema, final SQLSt
}
private Optional<BindingTableRule> findBindingTableRule(final
Collection<String> logicTableNames) {
- return
logicTableNames.stream().map(this::findBindingTableRule).filter(Optional::isPresent).findFirst().orElse(Optional.empty());
+ for (String logicTableName : logicTableNames) {
Review comment:
Fixed.
##########
File path:
shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/DeleteStatementContext.java
##########
@@ -56,8 +55,12 @@ public DeleteStatementContext(final DeleteStatement
sqlStatement) {
}
private Collection<SimpleTableSegment> filterAliasDeleteTable(final
Collection<SimpleTableSegment> tableSegments) {
- Map<String, SimpleTableSegment> aliasTableSegmentMap =
tableSegments.stream().filter(each
- -> each.getAlias().isPresent()).collect(Collectors.toMap(each ->
each.getAlias().get(), Function.identity(), (oldValue, currentValue) ->
oldValue));
+ Map<String, SimpleTableSegment> aliasTableSegmentMap = new
HashMap<>(tableSegments.size(), 1f);
+ for (SimpleTableSegment tableSegment : tableSegments) {
Review comment:
Fixed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]