From cd71e2dc5d62f3fa682fc37673d6753afb84b75b Mon Sep 17 00:00:00 2001 From: duanzhengqiang Date: Wed, 15 Nov 2023 17:18:12 +0800 Subject: [PATCH] Add sharding table check for ShardingSQLRewriteContextDecorator --- .../ShardingSQLRewriteContextDecorator.java | 15 ++++++++++++++- .../{pojo => }/ShardingTokenGenerateBuilder.java | 2 +- .../ShardingTokenGenerateBuilderTest.java | 2 +- .../AggregationDistinctTokenGeneratorTest.java | 2 +- .../ConstraintTokenGeneratorTest.java | 2 +- .../{ => generator}/CursorTokenGeneratorTest.java | 2 +- ...istinctProjectionPrefixTokenGeneratorTest.java | 2 +- .../{ => generator}/IndexTokenGeneratorTest.java | 2 +- .../{ => generator}/OffsetTokenGeneratorTest.java | 2 +- .../OrderByTokenGeneratorTest.java | 2 +- .../ProjectionsTokenGeneratorTest.java | 2 +- .../RowCountTokenGeneratorTest.java | 2 +- .../ShardingInsertValuesTokenGeneratorTest.java | 2 +- .../ShardingRemoveTokenGeneratorTest.java | 2 +- .../{ => generator}/TableTokenGeneratorTest.java | 2 +- 15 files changed, 28 insertions(+), 15 deletions(-) rename features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/{pojo => }/ShardingTokenGenerateBuilder.java (98%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{pojo => }/ShardingTokenGenerateBuilderTest.java (98%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/AggregationDistinctTokenGeneratorTest.java (98%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/ConstraintTokenGeneratorTest.java (98%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/CursorTokenGeneratorTest.java (98%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/DistinctProjectionPrefixTokenGeneratorTest.java (97%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/IndexTokenGeneratorTest.java (98%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/OffsetTokenGeneratorTest.java (98%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/OrderByTokenGeneratorTest.java (98%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/ProjectionsTokenGeneratorTest.java (99%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/RowCountTokenGeneratorTest.java (98%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/ShardingInsertValuesTokenGeneratorTest.java (98%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/ShardingRemoveTokenGeneratorTest.java (98%) rename features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/{ => generator}/TableTokenGeneratorTest.java (98%) diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/context/ShardingSQLRewriteContextDecorator.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/context/ShardingSQLRewriteContextDecorator.java index ff116672c9383..14ecbe373768c 100644 --- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/context/ShardingSQLRewriteContextDecorator.java +++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/context/ShardingSQLRewriteContextDecorator.java @@ -18,6 +18,7 @@ package org.apache.shardingsphere.sharding.rewrite.context; import lombok.Setter; +import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.rewrite.context.SQLRewriteContext; import org.apache.shardingsphere.infra.rewrite.context.SQLRewriteContextDecorator; @@ -25,7 +26,7 @@ import org.apache.shardingsphere.infra.route.context.RouteContext; import org.apache.shardingsphere.sharding.constant.ShardingOrder; import org.apache.shardingsphere.sharding.rewrite.parameter.ShardingParameterRewriterBuilder; -import org.apache.shardingsphere.sharding.rewrite.token.pojo.ShardingTokenGenerateBuilder; +import org.apache.shardingsphere.sharding.rewrite.token.ShardingTokenGenerateBuilder; import org.apache.shardingsphere.sharding.rule.ShardingRule; import java.util.Collection; @@ -38,6 +39,9 @@ public final class ShardingSQLRewriteContextDecorator implements SQLRewriteConte @Override public void decorate(final ShardingRule shardingRule, final ConfigurationProperties props, final SQLRewriteContext sqlRewriteContext, final RouteContext routeContext) { + if (!containsShardingTable(shardingRule, sqlRewriteContext.getSqlStatementContext())) { + return; + } if (!sqlRewriteContext.getParameters().isEmpty()) { Collection parameterRewriters = new ShardingParameterRewriterBuilder(shardingRule, routeContext, sqlRewriteContext.getDatabase().getSchemas(), sqlRewriteContext.getSqlStatementContext()).getParameterRewriters(); @@ -46,6 +50,15 @@ public void decorate(final ShardingRule shardingRule, final ConfigurationPropert sqlRewriteContext.addSQLTokenGenerators(new ShardingTokenGenerateBuilder(shardingRule, routeContext, sqlRewriteContext.getSqlStatementContext()).getSQLTokenGenerators()); } + private boolean containsShardingTable(final ShardingRule shardingRule, final SQLStatementContext sqlStatementContext) { + for (String each : sqlStatementContext.getTablesContext().getTableNames()) { + if (shardingRule.findTableRule(each).isPresent()) { + return true; + } + } + return false; + } + private void rewriteParameters(final SQLRewriteContext sqlRewriteContext, final Collection parameterRewriters) { for (ParameterRewriter each : parameterRewriters) { each.rewrite(sqlRewriteContext.getParameterBuilder(), sqlRewriteContext.getSqlStatementContext(), sqlRewriteContext.getParameters()); diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/ShardingTokenGenerateBuilder.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingTokenGenerateBuilder.java similarity index 98% rename from features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/ShardingTokenGenerateBuilder.java rename to features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingTokenGenerateBuilder.java index c7313e3207c44..dbf83686c4250 100644 --- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/ShardingTokenGenerateBuilder.java +++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingTokenGenerateBuilder.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token.pojo; +package org.apache.shardingsphere.sharding.rewrite.token; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/ShardingTokenGenerateBuilderTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingTokenGenerateBuilderTest.java similarity index 98% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/ShardingTokenGenerateBuilderTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingTokenGenerateBuilderTest.java index 1158a104cd288..92e8dce06cf3d 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/ShardingTokenGenerateBuilderTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingTokenGenerateBuilderTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token.pojo; +package org.apache.shardingsphere.sharding.rewrite.token; import org.apache.shardingsphere.infra.binder.context.statement.dml.SelectStatementContext; import org.apache.shardingsphere.infra.rewrite.sql.token.generator.SQLTokenGenerator; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/AggregationDistinctTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/AggregationDistinctTokenGeneratorTest.java similarity index 98% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/AggregationDistinctTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/AggregationDistinctTokenGeneratorTest.java index 6b54c6e311743..5bea224a26897 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/AggregationDistinctTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/AggregationDistinctTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.segment.select.projection.impl.AggregationDistinctProjection; import org.apache.shardingsphere.infra.binder.context.statement.dml.InsertStatementContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ConstraintTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ConstraintTokenGeneratorTest.java similarity index 98% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ConstraintTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ConstraintTokenGeneratorTest.java index 77fc4c2f07b78..9fdaf0cd768c0 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ConstraintTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ConstraintTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.statement.ddl.AlterTableStatementContext; import org.apache.shardingsphere.infra.binder.context.statement.ddl.CreateDatabaseStatementContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/CursorTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/CursorTokenGeneratorTest.java similarity index 98% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/CursorTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/CursorTokenGeneratorTest.java index 006cee52cc56f..67f2b12f7c548 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/CursorTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/CursorTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.statement.ddl.CloseStatementContext; import org.apache.shardingsphere.infra.binder.context.statement.ddl.CursorStatementContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/DistinctProjectionPrefixTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/DistinctProjectionPrefixTokenGeneratorTest.java similarity index 97% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/DistinctProjectionPrefixTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/DistinctProjectionPrefixTokenGeneratorTest.java index 27f884b07f18f..0eb51b961e346 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/DistinctProjectionPrefixTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/DistinctProjectionPrefixTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.segment.select.projection.impl.AggregationDistinctProjection; import org.apache.shardingsphere.infra.binder.context.statement.ddl.CreateDatabaseStatementContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/IndexTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/IndexTokenGeneratorTest.java similarity index 98% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/IndexTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/IndexTokenGeneratorTest.java index a5aae6972a947..b2838690d0d4e 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/IndexTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/IndexTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.statement.ddl.AlterIndexStatementContext; import org.apache.shardingsphere.infra.binder.context.statement.ddl.CreateDatabaseStatementContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OffsetTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/OffsetTokenGeneratorTest.java similarity index 98% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OffsetTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/OffsetTokenGeneratorTest.java index 930d7f415ce17..4dc0181cbaf7e 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OffsetTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/OffsetTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.segment.select.pagination.PaginationContext; import org.apache.shardingsphere.infra.binder.context.statement.dml.InsertStatementContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OrderByTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/OrderByTokenGeneratorTest.java similarity index 98% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OrderByTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/OrderByTokenGeneratorTest.java index 3adc32877bfde..a7a719402fb56 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OrderByTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/OrderByTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.segment.select.orderby.OrderByItem; import org.apache.shardingsphere.infra.binder.context.statement.dml.InsertStatementContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ProjectionsTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ProjectionsTokenGeneratorTest.java similarity index 99% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ProjectionsTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ProjectionsTokenGeneratorTest.java index 0517a45577bf7..4520b5ed01f6f 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ProjectionsTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ProjectionsTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.segment.select.projection.Projection; import org.apache.shardingsphere.infra.binder.context.segment.select.projection.impl.AggregationDistinctProjection; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/RowCountTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/RowCountTokenGeneratorTest.java similarity index 98% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/RowCountTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/RowCountTokenGeneratorTest.java index ef367dd01ca48..c70cb0f536b24 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/RowCountTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/RowCountTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.segment.select.pagination.PaginationContext; import org.apache.shardingsphere.infra.binder.context.statement.dml.InsertStatementContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingInsertValuesTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ShardingInsertValuesTokenGeneratorTest.java similarity index 98% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingInsertValuesTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ShardingInsertValuesTokenGeneratorTest.java index 679669e97e083..ef7cb247b093f 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingInsertValuesTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ShardingInsertValuesTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.segment.insert.values.InsertValueContext; import org.apache.shardingsphere.infra.binder.context.statement.dml.InsertStatementContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingRemoveTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ShardingRemoveTokenGeneratorTest.java similarity index 98% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingRemoveTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ShardingRemoveTokenGeneratorTest.java index cf41333736b7d..4ed6b0c70a823 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingRemoveTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/ShardingRemoveTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.statement.dml.InsertStatementContext; import org.apache.shardingsphere.infra.binder.context.statement.dml.SelectStatementContext; diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/TableTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/TableTokenGeneratorTest.java similarity index 98% rename from features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/TableTokenGeneratorTest.java rename to features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/TableTokenGeneratorTest.java index bf4fa5759f1fb..43ab5247a34f5 100644 --- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/TableTokenGeneratorTest.java +++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/TableTokenGeneratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sharding.rewrite.token; +package org.apache.shardingsphere.sharding.rewrite.token.generator; import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext; import org.apache.shardingsphere.infra.binder.context.statement.ddl.CreateDatabaseStatementContext;