Skip to content
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

Remove EqualsAndHashCode in SubstitutableColumnNameToken and change related LinkedHashSet to LinkedList #33524

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Optional;

Expand Down Expand Up @@ -81,7 +81,7 @@ public Collection<SQLToken> generateSQLTokens(final SQLStatementContext sqlState

private Collection<SQLToken> generateSQLTokens(final Collection<ColumnSegment> columnSegments, final Map<String, String> columnExpressionTableNames,
final Collection<WhereSegment> whereSegments, final DatabaseType databaseType) {
Collection<SQLToken> result = new LinkedHashSet<>(columnSegments.size(), 1F);
Collection<SQLToken> result = new LinkedList<>();
for (ColumnSegment each : columnSegments) {
String tableName = columnExpressionTableNames.getOrDefault(each.getExpression(), "");
Optional<EncryptTable> encryptTable = encryptRule.findEncryptTable(tableName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
Expand All @@ -68,7 +67,7 @@ public final class EncryptProjectionTokenGenerator {
* @return generated SQL tokens
*/
public Collection<SQLToken> generateSQLTokens(final SelectStatementContext selectStatementContext) {
Collection<SQLToken> result = new LinkedHashSet<>(generateSelectSQLTokens(selectStatementContext));
Collection<SQLToken> result = new LinkedList<>(generateSelectSQLTokens(selectStatementContext));
selectStatementContext.getSubqueryContexts().values().stream().map(this::generateSQLTokens).forEach(result::addAll);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -82,7 +81,7 @@ private boolean containsGroupByItem(final SelectStatementContext sqlStatementCon

@Override
public Collection<SQLToken> generateSQLTokens(final SelectStatementContext sqlStatementContext) {
Collection<SQLToken> result = new LinkedHashSet<>();
Collection<SQLToken> result = new LinkedList<>();
ShardingSphereSchema schema = sqlStatementContext.getTablesContext().getSchemaName().map(schemas::get).orElseGet(() -> defaultSchema);
for (OrderByItem each : getGroupByItems(sqlStatementContext)) {
if (each.getSegment() instanceof ColumnOrderByItemSegment) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.shardingsphere.infra.rewrite.sql.token.common.pojo.generic;

import com.cedarsoftware.util.CaseInsensitiveMap;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.apache.shardingsphere.infra.binder.context.segment.select.projection.Projection;
import org.apache.shardingsphere.infra.binder.context.segment.select.projection.impl.ColumnProjection;
Expand All @@ -39,8 +38,6 @@
/**
* Substitutable column name token.
*/
// TODO remove @EqualsAndHashCode in token rewriter
@EqualsAndHashCode(callSuper = false, exclude = "projections")
public final class SubstitutableColumnNameToken extends SQLToken implements Substitutable, RouteUnitAware {

private static final String COLUMN_NAME_SPLITTER = ", ";
Expand Down
Loading