Skip to content

Commit

Permalink
Refactor UpdateStatementBinder (#32059)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Jul 10, 2024
1 parent b4d7ff3 commit a3d60d0
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.shardingsphere.infra.binder.segment.where.WhereSegmentBinder;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementBinder;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementBinderContext;
import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table.TableSegment;
import org.apache.shardingsphere.sql.parser.statement.core.statement.dml.UpdateStatement;

import java.util.Collections;
Expand All @@ -40,8 +39,7 @@ public final class UpdateStatementBinder implements SQLStatementBinder<UpdateSta
public UpdateStatement bind(final UpdateStatement sqlStatement, final SQLStatementBinderContext binderContext) {
UpdateStatement result = copy(sqlStatement);
Map<String, TableSegmentBinderContext> tableBinderContexts = new LinkedHashMap<>();
TableSegment boundedTableSegment = TableSegmentBinder.bind(sqlStatement.getTable(), binderContext, tableBinderContexts, Collections.emptyMap());
result.setTable(boundedTableSegment);
result.setTable(TableSegmentBinder.bind(sqlStatement.getTable(), binderContext, tableBinderContexts, Collections.emptyMap()));
sqlStatement.getAssignmentSegment().ifPresent(optional -> result.setSetAssignment(AssignmentSegmentBinder.bind(optional, binderContext, tableBinderContexts, Collections.emptyMap())));
sqlStatement.getWhere().ifPresent(optional -> result.setWhere(WhereSegmentBinder.bind(optional, binderContext, tableBinderContexts, Collections.emptyMap())));
return result;
Expand Down

0 comments on commit a3d60d0

Please sign in to comment.