You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2026/02/01 09:18:44 UTC

(shardingsphere) branch master updated: Call buildAttributes in sql parse engine to reduce too much temp objects (#37920)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 7df49563809 Call buildAttributes in sql parse engine to reduce too much temp objects (#37920)
7df49563809 is described below

commit 7df49563809dc98e725fea66ae22f34de7378320
Author: Zhengqiang Duan <du...@apache.org>
AuthorDate: Sun Feb 1 17:18:37 2026 +0800

    Call buildAttributes in sql parse engine to reduce too much temp objects (#37920)
    
    * Minor refactor for TablesContext
    
    * Call buildAttributes in sql parse engine to reduce too much temp objects
    
    * Fix checkstyle
    
    * Fix unit test
    
    * Fix unit test
    
    * Fix unit test
    
    * Fix unit test
---
 .../core/advice/SQLRouteCountAdviceTest.java       |  1 +
 .../engine/BroadcastRouteEngineFactoryTest.java    |  4 ++-
 .../unicast/BroadcastUnicastRouteEngineTest.java   |  4 ++-
 .../CreateBroadcastTableRuleExecutorTest.java      |  5 +++
 .../update/DropBroadcastTableRuleExecutorTest.java |  2 ++
 .../EncryptShowCreateTableMergedResultTest.java    |  4 +--
 .../token/EncryptTokenGenerateBuilderTest.java     |  4 ++-
 .../ddl/EncryptAlterTableTokenGeneratorTest.java   |  3 ++
 .../ddl/EncryptCreateTableTokenGeneratorTest.java  |  1 +
 .../update/AlterEncryptRuleExecutorTest.java       | 12 ++++++--
 .../update/CreateEncryptRuleExecutorTest.java      | 16 +++++++---
 .../update/DropEncryptRuleExecutorTest.java        |  8 +++--
 .../handler/update/AlterMaskRuleExecutorTest.java  |  5 ++-
 .../handler/update/CreateMaskRuleExecutorTest.java |  8 +++--
 .../handler/update/DropMaskRuleExecutorTest.java   |  4 ++-
 .../AlterReadwriteSplittingRuleExecutorTest.java   | 16 +++++++---
 .../CreateReadwriteSplittingRuleExecutorTest.java  |  7 +++--
 .../DropReadwriteSplittingRuleExecutorTest.java    |  8 +++--
 ...adwriteSplittingStorageUnitStatusStatement.java |  6 ++--
 ...StatusFromReadwriteSplittingRulesStatement.java |  8 +++--
 .../update/AlterShadowRuleExecutorTest.java        | 13 ++++++--
 .../update/CreateShadowRuleExecutorTest.java       | 18 +++++++++--
 .../handler/update/DropShadowRuleExecutorTest.java |  8 +++--
 .../ShardingAlterIndexSupportedCheckerTest.java    |  3 ++
 .../ShardingAlterTableSupportedCheckerTest.java    |  1 +
 .../ShardingCreateIndexSupportedCheckerTest.java   |  6 ++++
 .../ShardingCreateTableSupportedCheckerTest.java   |  2 ++
 .../ddl/ShardingDropIndexSupportedCheckerTest.java |  2 ++
 .../ddl/ShardingDropTableSupportedCheckerTest.java |  1 +
 .../merge/ShardingResultMergerEngineTest.java      |  4 ++-
 .../impl/ShardingIndexTokenGeneratorTest.java      | 14 +++++++--
 .../rewrite/token/pojo/IndexTokenTest.java         |  4 ++-
 .../ShardingAlterTableRouteContextCheckerTest.java |  2 ++
 ...ShardingCreateTableRouteContextCheckerTest.java |  3 ++
 .../ShardingDropIndexRouteContextCheckerTest.java  |  2 ++
 .../ShardingDropTableRouteContextCheckerTest.java  |  4 +++
 .../type/ShardingRouteEngineFactoryTest.java       |  9 ++++--
 .../ShardingTableBroadcastRouteEngineTest.java     |  2 ++
 .../unicast/ShardingUnicastRouteEngineTest.java    |  1 +
 .../query/ShowShardingTableNodesExecutorTest.java  | 15 +++++----
 .../engine/statement/SQLStatementCopyUtils.java    |  1 +
 .../context/SQLStatementContextFactoryTest.java    | 17 ++++++++--
 .../type/dal/ExplainStatementContextTest.java      |  1 +
 .../statement/SQLStatementCopyUtilsTest.java       |  5 +--
 .../connection/kernel/KernelProcessorTest.java     |  4 ++-
 .../parser/sql/SQLStatementParserExecutor.java     |  4 ++-
 .../tableless/TablelessRouteEngineFactoryTest.java |  4 ++-
 .../single/route/SingleSQLRouterTest.java          |  1 +
 .../update/LoadSingleTableExecutorTest.java        |  5 +++
 ...tDefaultSingleTableStorageUnitExecutorTest.java | 12 ++++++--
 .../type/ExplainStatementConverterTest.java        |  8 +++--
 .../FederationMetaDataRefreshEngineTest.java       | 33 +++++++++++---------
 .../PushDownMetaDataRefreshEngineTest.java         |  9 +++---
 .../CreateIndexPushDownMetaDataRefresherTest.java  |  2 ++
 .../refresher/util/SchemaRefreshUtilsTest.java     |  4 +--
 .../parser/core/featured/DistSQLParserEngine.java  |  4 ++-
 .../kernel/KernelDistSQLStatementParserEngine.java |  4 ++-
 .../ExportDatabaseConfigurationStatement.java      |  8 +++--
 .../queryable/show/ShowTableMetaDataStatement.java |  6 ++--
 .../rql/resource/ShowStorageUnitsStatement.java    |  6 ++--
 .../type/rql/resource/ShowTablesStatement.java     |  6 ++--
 .../rule/database/ShowDatabaseRulesStatement.java  |  6 ++--
 .../statement/core/statement/SQLStatement.java     | 14 ++++++++-
 .../statement/type/dal/AnalyzeTableStatement.java  |  6 ++--
 .../core/statement/type/dal/ExplainStatement.java  |  6 ++--
 .../core/statement/type/dal/SetStatement.java      |  6 ++--
 .../core/statement/type/dcl/GrantStatement.java    |  6 ++--
 .../core/statement/type/dcl/RevokeStatement.java   |  6 ++--
 .../core/statement/type/ddl/CloseStatement.java    |  6 ++--
 .../core/statement/type/ddl/CommentStatement.java  |  6 ++--
 .../core/statement/type/ddl/CursorStatement.java   |  6 ++--
 .../core/statement/type/ddl/FetchStatement.java    |  6 ++--
 .../core/statement/type/ddl/MoveStatement.java     |  6 ++--
 .../core/statement/type/ddl/PrepareStatement.java  |  6 ++--
 .../core/statement/type/ddl/TruncateStatement.java |  6 ++--
 .../type/ddl/function/CreateFunctionStatement.java |  6 ++--
 .../type/ddl/index/AlterIndexStatement.java        |  8 +++--
 .../type/ddl/index/BuildIndexStatement.java        |  6 ++--
 .../type/ddl/index/CancelBuildIndexStatement.java  |  6 ++--
 .../type/ddl/index/CreateIndexStatement.java       |  6 ++--
 .../type/ddl/index/DropIndexStatement.java         |  6 ++--
 .../type/ddl/table/AlterTableStatement.java        |  6 ++--
 .../type/ddl/table/CreateTableStatement.java       |  6 ++--
 .../type/ddl/table/DropTableStatement.java         |  6 ++--
 .../type/ddl/table/RenameTableStatement.java       |  6 ++--
 .../statement/type/ddl/view/DropViewStatement.java |  6 ++--
 .../core/statement/type/dml/DeleteStatement.java   |  6 ++--
 .../core/statement/type/dml/InsertStatement.java   |  6 ++--
 .../core/statement/type/dml/MergeStatement.java    |  6 ++--
 .../core/statement/type/dml/SelectStatement.java   |  6 ++--
 .../core/statement/type/dml/UpdateStatement.java   |  6 ++--
 .../statement/core/util/MultiSQLSplitterTest.java  |  2 +-
 .../dal/show/DorisShowQueryStatsStatement.java     |  6 ++--
 .../hive/dal/show/HiveShowConnectorsStatement.java |  8 +++--
 .../hive/dal/show/HiveShowFunctionsStatement.java  |  8 +++--
 .../show/HiveShowMaterializedViewsStatement.java   |  8 +++--
 .../hive/dal/show/HiveShowPartitionsStatement.java |  8 +++--
 .../dal/show/HiveShowTablesExtendedStatement.java  |  8 +++--
 .../dal/show/HiveShowTblpropertiesStatement.java   |  8 +++--
 .../hive/dal/show/HiveShowViewsStatement.java      |  8 +++--
 .../statement/mysql/dal/MySQLFlushStatement.java   |  6 ++--
 .../statement/mysql/dal/MySQLKillStatement.java    |  6 ++--
 .../statement/mysql/dal/MySQLResetStatement.java   |  6 ++--
 .../statement/mysql/dal/MySQLUseStatement.java     |  6 ++--
 .../dal/plugin/MySQLShowPluginsStatement.java      |  8 +++--
 .../binlog/MySQLShowBinaryLogsStatement.java       |  8 +++--
 .../binlog/MySQLShowBinlogEventsStatement.java     |  6 ++--
 .../show/MySQLShowMasterStatusStatement.java       |  8 +++--
 .../show/MySQLShowRelayLogEventsStatement.java     |  6 ++--
 .../show/MySQLShowReplicaStatusStatement.java      |  6 ++--
 .../show/MySQLShowReplicasStatement.java           |  8 +++--
 .../show/MySQLShowSlaveHostsStatement.java         |  8 +++--
 .../show/MySQLShowSlaveStatusStatement.java        |  6 ++--
 .../replication/show/MySQLShowStatusStatement.java |  6 ++--
 .../character/MySQLShowCharacterSetStatement.java  |  6 ++--
 .../character/MySQLShowCollationStatement.java     |  6 ++--
 .../dal/show/column/MySQLDescribeStatement.java    |  6 ++--
 .../dal/show/column/MySQLShowColumnsStatement.java |  6 ++--
 .../database/MySQLShowCreateDatabaseStatement.java |  6 ++--
 .../show/database/MySQLShowDatabasesStatement.java |  8 +++--
 .../dal/show/engine/MySQLShowEngineStatement.java  |  6 ++--
 .../dal/show/error/MySQLShowErrorsStatement.java   |  6 ++--
 .../dal/show/error/MySQLShowWarningsStatement.java |  6 ++--
 .../show/event/MySQLShowCreateEventStatement.java  |  6 ++--
 .../dal/show/event/MySQLShowEventsStatement.java   |  6 ++--
 .../function/MySQLShowFunctionStatusStatement.java |  6 ++--
 .../dal/show/index/MySQLShowIndexStatement.java    |  6 ++--
 .../privilege/MySQLShowCreateUserStatement.java    |  6 ++--
 .../show/privilege/MySQLShowGrantsStatement.java   |  8 +++--
 .../privilege/MySQLShowPrivilegesStatement.java    |  8 +++--
 .../MySQLShowProcedureStatusStatement.java         |  6 ++--
 .../process/MySQLShowProcessListStatement.java     |  6 ++--
 .../show/profile/MySQLShowProfileStatement.java    |  6 ++--
 .../show/profile/MySQLShowProfilesStatement.java   |  8 +++--
 .../show/table/MySQLShowCreateTableStatement.java  |  6 ++--
 .../show/table/MySQLShowOpenTablesStatement.java   |  6 ++--
 .../show/table/MySQLShowTableStatusStatement.java  |  6 ++--
 .../dal/show/table/MySQLShowTablesStatement.java   |  6 ++--
 .../show/trigger/MySQLShowTriggersStatement.java   |  6 ++--
 .../show/variable/MySQLShowVariablesStatement.java |  6 ++--
 .../show/view/MySQLShowCreateViewStatement.java    |  7 +++--
 .../dal/table/MySQLOptimizeTableStatement.java     |  6 ++--
 .../mysql/dml/MySQLLoadDataStatement.java          |  6 ++--
 .../statement/mysql/dml/MySQLLoadXMLStatement.java |  6 ++--
 .../postgresql/dml/PostgreSQLCopyStatement.java    |  6 ++--
 .../dcl/user/SQLServerDenyUserStatement.java       |  6 ++--
 .../backend/connector/ProxySQLExecutorTest.java    |  2 ++
 .../handler/ProxyBackendHandlerFactoryTest.java    |  1 +
 .../handler/ProxySQLComQueryParserTest.java        |  5 +--
 .../DatabaseProxyBackendHandlerFactoryTest.java    |  4 ++-
 .../DistSQLProxyBackendHandlerFactoryTest.java     |  1 +
 .../DistSQLQueryProxyBackendHandlerTest.java       |  4 ++-
 .../DistSQLUpdateProxyBackendHandlerTest.java      | 24 +++++++++------
 .../distsql/rul/ParseDistSQLExecutorTest.java      | 12 ++++++--
 .../admin/FirebirdAdminExecutorCreatorTest.java    |  9 ++++--
 .../admin/MySQLAdminExecutorCreatorTest.java       | 36 ++++++++++++++++------
 .../admin/PostgreSQLAdminExecutorCreatorTest.java  | 14 ++++++---
 .../command/MySQLCommandPacketFactoryTest.java     |  4 ++-
 .../command/query/extended/PortalTest.java         |  2 ++
 .../test/it/sql/binder/SQLBinderIT.java            |  1 +
 160 files changed, 755 insertions(+), 297 deletions(-)

diff --git a/agent/plugins/metrics/core/src/test/java/org/apache/shardingsphere/agent/plugin/metrics/core/advice/SQLRouteCountAdviceTest.java b/agent/plugins/metrics/core/src/test/java/org/apache/shardingsphere/agent/plugin/metrics/core/advice/SQLRouteCountAdviceTest.java
index ded6fe00183..5372ecb4b21 100644
--- a/agent/plugins/metrics/core/src/test/java/org/apache/shardingsphere/agent/plugin/metrics/core/advice/SQLRouteCountAdviceTest.java
+++ b/agent/plugins/metrics/core/src/test/java/org/apache/shardingsphere/agent/plugin/metrics/core/advice/SQLRouteCountAdviceTest.java
@@ -78,6 +78,7 @@ class SQLRouteCountAdviceTest {
     }
     
     private static QueryContext createQueryContext(final SQLStatement sqlStatement) {
+        sqlStatement.buildAttributes();
         return new QueryContext(new CommonSQLStatementContext(sqlStatement), "", Collections.emptyList(), new HintValueContext(), mockConnectionContext(), mock(ShardingSphereMetaData.class));
     }
     
diff --git a/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/route/engine/BroadcastRouteEngineFactoryTest.java b/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/route/engine/BroadcastRouteEngineFactoryTest.java
index 3997ca14759..44dacbb34eb 100644
--- a/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/route/engine/BroadcastRouteEngineFactoryTest.java
+++ b/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/route/engine/BroadcastRouteEngineFactoryTest.java
@@ -87,7 +87,9 @@ class BroadcastRouteEngineFactoryTest {
     @Test
     void assertNewInstanceWithCursorContextAvailableAndIsAllBroadcastTables() {
         CursorHeldSQLStatementContext sqlStatementContext = mock(CursorHeldSQLStatementContext.class, RETURNS_DEEP_STUBS);
-        when(sqlStatementContext.getSqlStatement()).thenReturn(new CloseStatement(databaseType, mock(), false));
+        CloseStatement closeStatement = new CloseStatement(databaseType, mock(), false);
+        closeStatement.buildAttributes();
+        when(sqlStatementContext.getSqlStatement()).thenReturn(closeStatement);
         when(sqlStatementContext.getTablesContext()).thenReturn(createTablesContext());
         when(queryContext.getSqlStatementContext()).thenReturn(sqlStatementContext);
         assertThat(BroadcastRouteEngineFactory.newInstance(queryContext, Collections.emptyList()), isA(BroadcastUnicastRouteEngine.class));
diff --git a/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/route/engine/type/unicast/BroadcastUnicastRouteEngineTest.java b/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/route/engine/type/unicast/BroadcastUnicastRouteEngineTest.java
index a8c465c5076..d365245bcf7 100644
--- a/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/route/engine/type/unicast/BroadcastUnicastRouteEngineTest.java
+++ b/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/route/engine/type/unicast/BroadcastUnicastRouteEngineTest.java
@@ -87,7 +87,9 @@ class BroadcastUnicastRouteEngineTest {
     
     @Test
     void assertRouteToFirstDataSourceWithDropViewStatementContext() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new DropViewStatement(databaseType));
+        DropViewStatement dropViewStatement = new DropViewStatement(databaseType);
+        dropViewStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(dropViewStatement);
         assertRoute(sqlStatementContext, is("ds_0"));
     }
     
diff --git a/features/broadcast/distsql/handler/src/test/java/org/apache/shardingsphere/broadcast/distsql/handler/update/CreateBroadcastTableRuleExecutorTest.java b/features/broadcast/distsql/handler/src/test/java/org/apache/shardingsphere/broadcast/distsql/handler/update/CreateBroadcastTableRuleExecutorTest.java
index b025b5f29ae..a77db9eb409 100644
--- a/features/broadcast/distsql/handler/src/test/java/org/apache/shardingsphere/broadcast/distsql/handler/update/CreateBroadcastTableRuleExecutorTest.java
+++ b/features/broadcast/distsql/handler/src/test/java/org/apache/shardingsphere/broadcast/distsql/handler/update/CreateBroadcastTableRuleExecutorTest.java
@@ -48,6 +48,7 @@ class CreateBroadcastTableRuleExecutorTest {
     @Test
     void assertExecuteUpdateWithEmptyStorageUnits() {
         CreateBroadcastTableRuleStatement sqlStatement = new CreateBroadcastTableRuleStatement(false, Collections.singleton("t_address"));
+        sqlStatement.buildAttributes();
         ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
         when(database.getResourceMetaData().getStorageUnits()).thenReturn(Collections.emptyMap());
         assertThrows(EmptyStorageUnitException.class, () -> new DistSQLUpdateExecuteEngine(sqlStatement, "foo_db", mockContextManager(database, mock(BroadcastRule.class)), null).executeUpdate());
@@ -56,6 +57,7 @@ class CreateBroadcastTableRuleExecutorTest {
     @Test
     void assertExecuteUpdateWithDuplicateBroadcastTables() {
         CreateBroadcastTableRuleStatement sqlStatement = new CreateBroadcastTableRuleStatement(false, Collections.singleton("foo_tbl"));
+        sqlStatement.buildAttributes();
         ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
         BroadcastRule rule = mock(BroadcastRule.class);
         when(rule.getTables()).thenReturn(Collections.singleton("foo_tbl"));
@@ -65,6 +67,7 @@ class CreateBroadcastTableRuleExecutorTest {
     @Test
     void assertExecuteUpdateWithIfNotExists() throws SQLException {
         CreateBroadcastTableRuleStatement sqlStatement = new CreateBroadcastTableRuleStatement(true, new ArrayList<>(Arrays.asList("foo_tbl", "bar_tbl")));
+        sqlStatement.buildAttributes();
         ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
         BroadcastRule rule = mock(BroadcastRule.class);
         when(rule.getTables()).thenReturn(Collections.singleton("foo_tbl"));
@@ -78,6 +81,7 @@ class CreateBroadcastTableRuleExecutorTest {
     @Test
     void assertExecuteUpdateWithoutIfNotExists() throws SQLException {
         CreateBroadcastTableRuleStatement sqlStatement = new CreateBroadcastTableRuleStatement(false, Collections.singleton("bar_tbl"));
+        sqlStatement.buildAttributes();
         ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
         BroadcastRule rule = mock(BroadcastRule.class);
         when(rule.getTables()).thenReturn(Collections.singleton("foo_tbl"));
@@ -91,6 +95,7 @@ class CreateBroadcastTableRuleExecutorTest {
     @Test
     void assertExecuteUpdateWithoutExistedRule() throws SQLException {
         CreateBroadcastTableRuleStatement sqlStatement = new CreateBroadcastTableRuleStatement(false, new ArrayList<>(Arrays.asList("foo_tbl", "bar_tbl")));
+        sqlStatement.buildAttributes();
         ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
         ContextManager contextManager = mockContextManager(database, null);
         new DistSQLUpdateExecuteEngine(sqlStatement, "foo_db", contextManager, null).executeUpdate();
diff --git a/features/broadcast/distsql/handler/src/test/java/org/apache/shardingsphere/broadcast/distsql/handler/update/DropBroadcastTableRuleExecutorTest.java b/features/broadcast/distsql/handler/src/test/java/org/apache/shardingsphere/broadcast/distsql/handler/update/DropBroadcastTableRuleExecutorTest.java
index b1b4471bb7a..8caf0a2ba2d 100644
--- a/features/broadcast/distsql/handler/src/test/java/org/apache/shardingsphere/broadcast/distsql/handler/update/DropBroadcastTableRuleExecutorTest.java
+++ b/features/broadcast/distsql/handler/src/test/java/org/apache/shardingsphere/broadcast/distsql/handler/update/DropBroadcastTableRuleExecutorTest.java
@@ -46,6 +46,7 @@ class DropBroadcastTableRuleExecutorTest {
     @Test
     void assertExecuteUpdateWithoutToBeDroppedTables() {
         DropBroadcastTableRuleStatement sqlStatement = new DropBroadcastTableRuleStatement(false, Collections.singleton("foo_tbl"));
+        sqlStatement.buildAttributes();
         ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
         BroadcastRule rule = mock(BroadcastRule.class, RETURNS_DEEP_STUBS);
         assertThrows(MissingRequiredRuleException.class, () -> new DistSQLUpdateExecuteEngine(sqlStatement, "foo_db", mockContextManager(database, rule), null).executeUpdate());
@@ -54,6 +55,7 @@ class DropBroadcastTableRuleExecutorTest {
     @Test
     void assertExecuteUpdate() throws SQLException {
         DropBroadcastTableRuleStatement sqlStatement = new DropBroadcastTableRuleStatement(true, new ArrayList<>(Arrays.asList("foo_tbl", "bar_tbl")));
+        sqlStatement.buildAttributes();
         ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
         when(database.getName()).thenReturn("foo_db");
         BroadcastRule rule = mock(BroadcastRule.class, RETURNS_DEEP_STUBS);
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/EncryptShowCreateTableMergedResultTest.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/EncryptShowCreateTableMergedResultTest.java
index 67826f7afd6..2d3d347cff3 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/EncryptShowCreateTableMergedResultTest.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/show/EncryptShowCreateTableMergedResultTest.java
@@ -35,7 +35,6 @@ import org.apache.shardingsphere.parser.rule.SQLParserRule;
 import org.apache.shardingsphere.sql.parser.engine.api.CacheOption;
 import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table.SimpleTableSegment;
 import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table.TableNameSegment;
-import org.apache.shardingsphere.sql.parser.statement.core.statement.SQLStatement;
 import org.apache.shardingsphere.sql.parser.statement.core.value.identifier.IdentifierValue;
 import org.apache.shardingsphere.sql.parser.statement.mysql.dal.show.table.MySQLShowCreateTableStatement;
 import org.junit.jupiter.api.Test;
@@ -187,7 +186,8 @@ class EncryptShowCreateTableMergedResultTest {
     }
     
     private EncryptShowCreateTableMergedResult createMergedResult(final MergedResult mergedResult, final String tableName, final EncryptRule rule) {
-        SQLStatement sqlStatement = new MySQLShowCreateTableStatement(databaseType, new SimpleTableSegment(new TableNameSegment(1, 4, new IdentifierValue(tableName))));
+        MySQLShowCreateTableStatement sqlStatement = new MySQLShowCreateTableStatement(databaseType, new SimpleTableSegment(new TableNameSegment(1, 4, new IdentifierValue(tableName))));
+        sqlStatement.buildAttributes();
         CommonSQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         RuleMetaData globalRuleMetaData = mock(RuleMetaData.class);
         when(globalRuleMetaData.getSingleRule(SQLParserRule.class)).thenReturn(new SQLParserRule(new SQLParserRuleConfiguration(new CacheOption(128, 1024L), new CacheOption(2000, 65535L))));
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptTokenGenerateBuilderTest.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptTokenGenerateBuilderTest.java
index 38d6c986a7d..3bd50d9e309 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptTokenGenerateBuilderTest.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptTokenGenerateBuilderTest.java
@@ -62,7 +62,9 @@ class EncryptTokenGenerateBuilderTest {
         when(selectStatementContext.getOrderByContext().getItems()).thenReturn(Collections.singleton(mock(OrderByItem.class)));
         when(selectStatementContext.getGroupByContext().getItems()).thenReturn(Collections.emptyList());
         when(selectStatementContext.getWhereSegments()).thenReturn(Collections.emptyList());
-        when(selectStatementContext.getSqlStatement()).thenReturn(new SelectStatement(databaseType));
+        SelectStatement selectStatement = new SelectStatement(databaseType);
+        selectStatement.buildAttributes();
+        when(selectStatementContext.getSqlStatement()).thenReturn(selectStatement);
         SQLRewriteContext sqlRewriteContext = mock(SQLRewriteContext.class, RETURNS_DEEP_STUBS);
         EncryptCondition encryptCondition = mock(EncryptCondition.class);
         EncryptTokenGenerateBuilder encryptTokenGenerateBuilder = new EncryptTokenGenerateBuilder(selectStatementContext, Collections.singleton(encryptCondition), rule, sqlRewriteContext);
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/ddl/EncryptAlterTableTokenGeneratorTest.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/ddl/EncryptAlterTableTokenGeneratorTest.java
index 0ccdb662a03..f5fe8bc1c28 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/ddl/EncryptAlterTableTokenGeneratorTest.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/ddl/EncryptAlterTableTokenGeneratorTest.java
@@ -124,6 +124,7 @@ class EncryptAlterTableTokenGeneratorTest {
         ColumnDefinitionSegment columnDefinitionSegment = new ColumnDefinitionSegment(
                 33, 67, new ColumnSegment(33, 50, new IdentifierValue("certificate_number")), new DataTypeSegment(), false, false, "");
         result.getAddColumnDefinitions().add(new AddColumnDefinitionSegment(22, 67, Collections.singleton(columnDefinitionSegment)));
+        result.buildAttributes();
         return result;
     }
     
@@ -138,6 +139,7 @@ class EncryptAlterTableTokenGeneratorTest {
         ColumnDefinitionSegment columnDefinitionSegment = new ColumnDefinitionSegment(
                 36, 70, new ColumnSegment(36, 53, new IdentifierValue("certificate_number")), new DataTypeSegment(), false, false, "");
         result.getModifyColumnDefinitions().add(new ModifyColumnDefinitionSegment(22, 70, columnDefinitionSegment));
+        result.buildAttributes();
         return result;
     }
     
@@ -154,6 +156,7 @@ class EncryptAlterTableTokenGeneratorTest {
         ChangeColumnDefinitionSegment changeColumnDefinitionSegment = new ChangeColumnDefinitionSegment(22, 93, columnDefinitionSegment);
         changeColumnDefinitionSegment.setPreviousColumn(new ColumnSegment(36, 53, new IdentifierValue("certificate_number")));
         result.getChangeColumnDefinitions().add(changeColumnDefinitionSegment);
+        result.buildAttributes();
         return result;
     }
 }
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/ddl/EncryptCreateTableTokenGeneratorTest.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/ddl/EncryptCreateTableTokenGeneratorTest.java
index f7e9dc443a7..1d5b37f15a3 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/ddl/EncryptCreateTableTokenGeneratorTest.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/ddl/EncryptCreateTableTokenGeneratorTest.java
@@ -111,6 +111,7 @@ class EncryptCreateTableTokenGeneratorTest {
         CreateTableStatement result = new CreateTableStatement(databaseType);
         result.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_encrypt"))));
         result.getColumnDefinitions().add(new ColumnDefinitionSegment(25, 78, new ColumnSegment(25, 42, new IdentifierValue("certificate_number")), new DataTypeSegment(), false, false, ""));
+        result.buildAttributes();
         return result;
     }
 }
diff --git a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/AlterEncryptRuleExecutorTest.java b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/AlterEncryptRuleExecutorTest.java
index 09fd90a8557..1526a5a37c2 100644
--- a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/AlterEncryptRuleExecutorTest.java
+++ b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/AlterEncryptRuleExecutorTest.java
@@ -80,7 +80,9 @@ class AlterEncryptRuleExecutorTest {
                 new EncryptColumnItemSegment("user_cipher", new AlgorithmSegment("MD5", new Properties())),
                 new EncryptColumnItemSegment(assistQueryColumnName, new AlgorithmSegment("MD5", new Properties())),
                 new EncryptColumnItemSegment(likeColumnName, new AlgorithmSegment("MD5", new Properties())));
-        return new AlterEncryptRuleStatement(Collections.singleton(new EncryptRuleSegment("t_encrypt", Collections.singleton(columnSegment))));
+        AlterEncryptRuleStatement result = new AlterEncryptRuleStatement(Collections.singleton(new EncryptRuleSegment("t_encrypt", Collections.singleton(columnSegment))));
+        result.buildAttributes();
+        return result;
     }
     
     @Test
@@ -119,13 +121,17 @@ class AlterEncryptRuleExecutorTest {
                 new EncryptColumnItemSegment("assisted_column", new AlgorithmSegment("MD5", new Properties())),
                 new EncryptColumnItemSegment("like_column", new AlgorithmSegment("MD5", new Properties())));
         EncryptRuleSegment ruleSegment = new EncryptRuleSegment("t_encrypt", Collections.singleton(columnSegment));
-        return new AlterEncryptRuleStatement(Collections.singleton(ruleSegment));
+        AlterEncryptRuleStatement result = new AlterEncryptRuleStatement(Collections.singleton(ruleSegment));
+        result.buildAttributes();
+        return result;
     }
     
     private AlterEncryptRuleStatement createSQLStatementWithoutAssistQueryAndLikeColumns() {
         EncryptColumnSegment columnSegment = new EncryptColumnSegment("user_id", new EncryptColumnItemSegment("user_cipher", new AlgorithmSegment("MD5", new Properties())), null, null);
         EncryptRuleSegment ruleSegment = new EncryptRuleSegment("t_encrypt", Collections.singleton(columnSegment));
-        return new AlterEncryptRuleStatement(Collections.singleton(ruleSegment));
+        AlterEncryptRuleStatement result = new AlterEncryptRuleStatement(Collections.singleton(ruleSegment));
+        result.buildAttributes();
+        return result;
     }
     
     private EncryptRuleConfiguration createCurrentRuleConfiguration() {
diff --git a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleExecutorTest.java b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleExecutorTest.java
index 2d65dd09135..3bc76d2454a 100644
--- a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleExecutorTest.java
+++ b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleExecutorTest.java
@@ -97,7 +97,9 @@ class CreateEncryptRuleExecutorTest {
                 new EncryptColumnItemSegment("like_column", new AlgorithmSegment("CHAR_DIGEST_LIKE", new Properties())));
         EncryptRuleSegment userRuleSegment = new EncryptRuleSegment("t_user", Collections.singleton(tUserColumnSegment));
         EncryptRuleSegment orderRuleSegment = new EncryptRuleSegment("t_order", Collections.singleton(tOrderColumnSegment));
-        return new CreateEncryptRuleStatement(true, Arrays.asList(userRuleSegment, orderRuleSegment));
+        CreateEncryptRuleStatement result = new CreateEncryptRuleStatement(true, Arrays.asList(userRuleSegment, orderRuleSegment));
+        result.buildAttributes();
+        return result;
     }
     
     @Test
@@ -117,7 +119,9 @@ class CreateEncryptRuleExecutorTest {
                 new EncryptColumnItemSegment("like_column", null));
         Collection<EncryptRuleSegment> rules = new LinkedList<>();
         rules.add(new EncryptRuleSegment("t_user", Collections.singleton(encryptColumnSegment)));
-        return new CreateEncryptRuleStatement(ifNotExists, rules);
+        CreateEncryptRuleStatement result = new CreateEncryptRuleStatement(ifNotExists, rules);
+        result.buildAttributes();
+        return result;
     }
     
     private CreateEncryptRuleStatement createSQLStatement(final boolean ifNotExists, final String encryptorName) {
@@ -134,7 +138,9 @@ class CreateEncryptRuleExecutorTest {
         Collection<EncryptRuleSegment> rules = new LinkedList<>();
         rules.add(tUserRuleSegment);
         rules.add(tOrderRuleSegment);
-        return new CreateEncryptRuleStatement(ifNotExists, rules);
+        CreateEncryptRuleStatement result = new CreateEncryptRuleStatement(ifNotExists, rules);
+        result.buildAttributes();
+        return result;
     }
     
     private CreateEncryptRuleStatement createConflictColumnNameSQLStatement() {
@@ -143,7 +149,9 @@ class CreateEncryptRuleExecutorTest {
                 new EncryptColumnItemSegment("user_id", new AlgorithmSegment("test", new Properties())),
                 new EncryptColumnItemSegment("like_column", new AlgorithmSegment("test", new Properties())));
         EncryptRuleSegment ruleSegment = new EncryptRuleSegment("t_encrypt", Collections.singleton(columnSegment));
-        return new CreateEncryptRuleStatement(false, Collections.singleton(ruleSegment));
+        CreateEncryptRuleStatement result = new CreateEncryptRuleStatement(false, Collections.singleton(ruleSegment));
+        result.buildAttributes();
+        return result;
     }
     
     private EncryptRuleConfiguration getCurrentRuleConfiguration() {
diff --git a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/DropEncryptRuleExecutorTest.java b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/DropEncryptRuleExecutorTest.java
index e8a23766d59..f8279288628 100644
--- a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/DropEncryptRuleExecutorTest.java
+++ b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/DropEncryptRuleExecutorTest.java
@@ -109,11 +109,15 @@ class DropEncryptRuleExecutorTest {
     }
     
     private DropEncryptRuleStatement createSQLStatement(final String tableName) {
-        return new DropEncryptRuleStatement(false, Collections.singleton(tableName));
+        DropEncryptRuleStatement result = new DropEncryptRuleStatement(false, Collections.singleton(tableName));
+        result.buildAttributes();
+        return result;
     }
     
     private DropEncryptRuleStatement createSQLStatement(final boolean ifExists, final String tableName) {
-        return new DropEncryptRuleStatement(ifExists, Collections.singleton(tableName));
+        DropEncryptRuleStatement result = new DropEncryptRuleStatement(ifExists, Collections.singleton(tableName));
+        result.buildAttributes();
+        return result;
     }
     
     private EncryptRuleConfiguration createCurrentRuleConfiguration() {
diff --git a/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/AlterMaskRuleExecutorTest.java b/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/AlterMaskRuleExecutorTest.java
index 52bc7e0412e..eab870b6afd 100644
--- a/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/AlterMaskRuleExecutorTest.java
+++ b/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/AlterMaskRuleExecutorTest.java
@@ -63,6 +63,7 @@ class AlterMaskRuleExecutorTest {
         MaskColumnSegment columnSegment = new MaskColumnSegment("order_id", new AlgorithmSegment("MD5", new Properties()));
         MaskRuleSegment ruleSegment = new MaskRuleSegment("t_order", Collections.singleton(columnSegment));
         AlterMaskRuleStatement sqlStatement = new AlterMaskRuleStatement(Collections.singleton(ruleSegment));
+        sqlStatement.buildAttributes();
         MaskRule rule = mock(MaskRule.class);
         when(rule.getConfiguration()).thenReturn(currentRuleConfig);
         ContextManager contextManager = mockContextManager(rule);
@@ -90,7 +91,9 @@ class AlterMaskRuleExecutorTest {
     private AlterMaskRuleStatement createSQLStatement() {
         MaskColumnSegment columnSegment = new MaskColumnSegment("user_id", new AlgorithmSegment("MD5", new Properties()));
         MaskRuleSegment ruleSegment = new MaskRuleSegment("t_mask", Collections.singleton(columnSegment));
-        return new AlterMaskRuleStatement(Collections.singleton(ruleSegment));
+        AlterMaskRuleStatement result = new AlterMaskRuleStatement(Collections.singleton(ruleSegment));
+        result.buildAttributes();
+        return result;
     }
     
     private MaskRuleConfiguration createCurrentRuleConfiguration() {
diff --git a/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/CreateMaskRuleExecutorTest.java b/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/CreateMaskRuleExecutorTest.java
index 8de9a067259..efecf47c8b9 100644
--- a/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/CreateMaskRuleExecutorTest.java
+++ b/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/CreateMaskRuleExecutorTest.java
@@ -89,7 +89,9 @@ class CreateMaskRuleExecutorTest {
         Collection<MaskRuleSegment> rules = new LinkedList<>();
         rules.add(tMaskRuleSegment);
         rules.add(tOrderRuleSegment);
-        return new CreateMaskRuleStatement(ifNotExists, rules);
+        CreateMaskRuleStatement result = new CreateMaskRuleStatement(ifNotExists, rules);
+        result.buildAttributes();
+        return result;
     }
     
     private CreateMaskRuleStatement createDuplicatedSQLStatement(final boolean ifNotExists, final String algorithmType) {
@@ -100,7 +102,9 @@ class CreateMaskRuleExecutorTest {
         Collection<MaskRuleSegment> rules = new LinkedList<>();
         rules.add(tMaskRuleSegment);
         rules.add(tOrderRuleSegment);
-        return new CreateMaskRuleStatement(ifNotExists, rules);
+        CreateMaskRuleStatement result = new CreateMaskRuleStatement(ifNotExists, rules);
+        result.buildAttributes();
+        return result;
     }
     
     private MaskRuleConfiguration getCurrentRuleConfiguration() {
diff --git a/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/DropMaskRuleExecutorTest.java b/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/DropMaskRuleExecutorTest.java
index b9f1eee3bad..d08ee9a17a5 100644
--- a/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/DropMaskRuleExecutorTest.java
+++ b/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/update/DropMaskRuleExecutorTest.java
@@ -84,7 +84,9 @@ class DropMaskRuleExecutorTest {
     }
     
     private DropMaskRuleStatement createSQLStatement(final boolean ifExists, final String tableName) {
-        return new DropMaskRuleStatement(ifExists, Collections.singleton(tableName));
+        DropMaskRuleStatement result = new DropMaskRuleStatement(ifExists, Collections.singleton(tableName));
+        result.buildAttributes();
+        return result;
     }
     
     private MaskRuleConfiguration createCurrentRuleConfiguration() {
diff --git a/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/AlterReadwriteSplittingRuleExecutorTest.java b/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/AlterReadwriteSplittingRuleExecutorTest.java
index b609b3072b5..ba63b5659a9 100644
--- a/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/AlterReadwriteSplittingRuleExecutorTest.java
+++ b/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/AlterReadwriteSplittingRuleExecutorTest.java
@@ -153,13 +153,17 @@ class AlterReadwriteSplittingRuleExecutorTest {
     private AlterReadwriteSplittingRuleStatement createSQLStatement(final String loadBalancerTypeName) {
         ReadwriteSplittingRuleSegment ruleSegment = new ReadwriteSplittingRuleSegment("readwrite_ds", "write_ds", Arrays.asList("read_ds_0", "ds_read_ds_1"),
                 new AlgorithmSegment(loadBalancerTypeName, new Properties()));
-        return new AlterReadwriteSplittingRuleStatement(Collections.singleton(ruleSegment));
+        AlterReadwriteSplittingRuleStatement result = new AlterReadwriteSplittingRuleStatement(Collections.singleton(ruleSegment));
+        result.buildAttributes();
+        return result;
     }
     
     private AlterReadwriteSplittingRuleStatement createSQLStatement(final String ruleName, final String writeDataSource, final Collection<String> readDataSources,
                                                                     final String loadBalancerName, final Properties props) {
         ReadwriteSplittingRuleSegment ruleSegment = new ReadwriteSplittingRuleSegment(ruleName, writeDataSource, readDataSources, new AlgorithmSegment(loadBalancerName, props));
-        return new AlterReadwriteSplittingRuleStatement(Collections.singleton(ruleSegment));
+        AlterReadwriteSplittingRuleStatement result = new AlterReadwriteSplittingRuleStatement(Collections.singleton(ruleSegment));
+        result.buildAttributes();
+        return result;
     }
     
     private AlterReadwriteSplittingRuleStatement createSQLStatementWithDuplicateWriteDataSources(final String ruleName0, final String ruleName1, final String loadBalancerName) {
@@ -167,7 +171,9 @@ class AlterReadwriteSplittingRuleExecutorTest {
                 new AlgorithmSegment(loadBalancerName, new Properties()));
         ReadwriteSplittingRuleSegment ruleSegment1 = new ReadwriteSplittingRuleSegment(ruleName1, "write_ds", Arrays.asList("read_ds_2", "read_ds_3"),
                 new AlgorithmSegment(loadBalancerName, new Properties()));
-        return new AlterReadwriteSplittingRuleStatement(Arrays.asList(ruleSegment0, ruleSegment1));
+        AlterReadwriteSplittingRuleStatement result = new AlterReadwriteSplittingRuleStatement(Arrays.asList(ruleSegment0, ruleSegment1));
+        result.buildAttributes();
+        return result;
     }
     
     private AlterReadwriteSplittingRuleStatement createSQLStatementWithDuplicateReadDataSources(final String ruleName0, final String ruleName1, final String loadBalancerName) {
@@ -175,7 +181,9 @@ class AlterReadwriteSplittingRuleExecutorTest {
                 new AlgorithmSegment(loadBalancerName, new Properties()));
         ReadwriteSplittingRuleSegment ruleSegment1 = new ReadwriteSplittingRuleSegment(ruleName1, "write_ds_1", Arrays.asList("read_ds_0", "read_ds_1"),
                 new AlgorithmSegment(loadBalancerName, new Properties()));
-        return new AlterReadwriteSplittingRuleStatement(Arrays.asList(ruleSegment0, ruleSegment1));
+        AlterReadwriteSplittingRuleStatement result = new AlterReadwriteSplittingRuleStatement(Arrays.asList(ruleSegment0, ruleSegment1));
+        result.buildAttributes();
+        return result;
     }
     
     private ReadwriteSplittingRuleConfiguration createCurrentRuleConfiguration() {
diff --git a/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/CreateReadwriteSplittingRuleExecutorTest.java b/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/CreateReadwriteSplittingRuleExecutorTest.java
index 71c620299cf..71a9f6754b4 100644
--- a/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/CreateReadwriteSplittingRuleExecutorTest.java
+++ b/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/CreateReadwriteSplittingRuleExecutorTest.java
@@ -163,7 +163,8 @@ class CreateReadwriteSplittingRuleExecutorTest {
         when(database.getRuleMetaData().getAttributes(DataSourceMapperRuleAttribute.class)).thenReturn(Collections.singleton(ruleAttribute));
         ReadwriteSplittingRuleSegment staticSegment = new ReadwriteSplittingRuleSegment(
                 "static_rule", "write_ds_0", Arrays.asList("read_ds_0", "read_ds_1"), new AlgorithmSegment("TEST", new Properties()));
-        CreateReadwriteSplittingRuleStatement sqlStatement = createSQLStatement(false, staticSegment);
+        CreateReadwriteSplittingRuleStatement sqlStatement = new CreateReadwriteSplittingRuleStatement(false, Collections.singleton(staticSegment));
+        sqlStatement.buildAttributes();
         executor.setDatabase(database);
         executor.checkBeforeUpdate(sqlStatement);
         executor.setRule(mock(ReadwriteSplittingRule.class));
@@ -188,7 +189,9 @@ class CreateReadwriteSplittingRuleExecutorTest {
     }
     
     private CreateReadwriteSplittingRuleStatement createSQLStatement(final boolean ifNotExists, final ReadwriteSplittingRuleSegment... ruleSegments) {
-        return new CreateReadwriteSplittingRuleStatement(ifNotExists, Arrays.asList(ruleSegments));
+        CreateReadwriteSplittingRuleStatement result = new CreateReadwriteSplittingRuleStatement(ifNotExists, Arrays.asList(ruleSegments));
+        result.buildAttributes();
+        return result;
     }
     
     private CreateReadwriteSplittingRuleStatement createSQLStatementWithDuplicateWriteDataSources(final String ruleName0, final String ruleName1, final String loadBalancerName) {
diff --git a/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/DropReadwriteSplittingRuleExecutorTest.java b/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/DropReadwriteSplittingRuleExecutorTest.java
index 3910fbd4b0d..ca8393494bd 100644
--- a/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/DropReadwriteSplittingRuleExecutorTest.java
+++ b/features/readwrite-splitting/distsql/handler/src/test/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/update/DropReadwriteSplittingRuleExecutorTest.java
@@ -73,7 +73,9 @@ class DropReadwriteSplittingRuleExecutorTest {
     
     @Test
     void assertCheckSQLStatementWithIfExists() throws RuleDefinitionException {
-        executor.checkBeforeUpdate(new DropReadwriteSplittingRuleStatement(true, Collections.singleton("readwrite_ds")));
+        DropReadwriteSplittingRuleStatement sqlStatement = new DropReadwriteSplittingRuleStatement(true, Collections.singleton("readwrite_ds"));
+        sqlStatement.buildAttributes();
+        executor.checkBeforeUpdate(sqlStatement);
     }
     
     @Test
@@ -125,7 +127,9 @@ class DropReadwriteSplittingRuleExecutorTest {
     }
     
     private DropReadwriteSplittingRuleStatement createSQLStatement() {
-        return new DropReadwriteSplittingRuleStatement(false, Collections.singleton("readwrite_ds"));
+        DropReadwriteSplittingRuleStatement result = new DropReadwriteSplittingRuleStatement(false, Collections.singleton("readwrite_ds"));
+        result.buildAttributes();
+        return result;
     }
     
     private ReadwriteSplittingRuleConfiguration createCurrentRuleConfiguration() {
diff --git a/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/AlterReadwriteSplittingStorageUnitStatusStatement.java b/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/AlterReadwriteSplittingStorageUnitStatusStatement.java
index e760cd31fca..216990cf348 100644
--- a/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/AlterReadwriteSplittingStorageUnitStatusStatement.java
+++ b/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/AlterReadwriteSplittingStorageUnitStatusStatement.java
@@ -39,8 +39,10 @@ public final class AlterReadwriteSplittingStorageUnitStatusStatement extends Upd
     
     private final boolean enable;
     
+    private SQLStatementAttributes attributes;
+    
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
     }
 }
diff --git a/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/ShowStatusFromReadwriteSplittingRulesStatement.java b/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/ShowStatusFromReadwriteSplittingRulesStatement.java
index db57407f762..99baf5042d5 100644
--- a/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/ShowStatusFromReadwriteSplittingRulesStatement.java
+++ b/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/ShowStatusFromReadwriteSplittingRulesStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.readwritesplitting.distsql.statement;
 
+import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.distsql.statement.type.rql.resource.ResourceQueryStatement;
 import org.apache.shardingsphere.sql.parser.statement.core.segment.dal.FromDatabaseSegment;
@@ -35,6 +36,9 @@ public final class ShowStatusFromReadwriteSplittingRulesStatement extends Resour
     
     private final String ruleName;
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     /**
      * Get rule name.
      *
@@ -45,7 +49,7 @@ public final class ShowStatusFromReadwriteSplittingRulesStatement extends Resour
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
     }
 }
diff --git a/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/AlterShadowRuleExecutorTest.java b/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/AlterShadowRuleExecutorTest.java
index a0f7eee23c7..c8f081f164b 100644
--- a/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/AlterShadowRuleExecutorTest.java
+++ b/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/AlterShadowRuleExecutorTest.java
@@ -82,7 +82,9 @@ class AlterShadowRuleExecutorTest {
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
-        assertThrows(DuplicateRuleException.class, () -> executor.checkBeforeUpdate(new AlterShadowRuleStatement(Arrays.asList(ruleSegment, ruleSegment))));
+        AlterShadowRuleStatement sqlStatement = new AlterShadowRuleStatement(Arrays.asList(ruleSegment, ruleSegment));
+        sqlStatement.buildAttributes();
+        assertThrows(DuplicateRuleException.class, () -> executor.checkBeforeUpdate(sqlStatement));
     }
     
     @Test
@@ -91,7 +93,9 @@ class AlterShadowRuleExecutorTest {
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
-        assertThrows(MissingRequiredRuleException.class, () -> executor.checkBeforeUpdate(new AlterShadowRuleStatement(Collections.singleton(ruleSegment))));
+        AlterShadowRuleStatement sqlStatement = new AlterShadowRuleStatement(Collections.singleton(ruleSegment));
+        sqlStatement.buildAttributes();
+        assertThrows(MissingRequiredRuleException.class, () -> executor.checkBeforeUpdate(sqlStatement));
     }
     
     @Test
@@ -99,6 +103,7 @@ class AlterShadowRuleExecutorTest {
         List<String> dataSources = Arrays.asList("ds", "ds0");
         when(resourceMetaData.getNotExistedDataSources(any())).thenReturn(dataSources);
         AlterShadowRuleStatement sqlStatement = new AlterShadowRuleStatement(Collections.singleton(new ShadowRuleSegment("initRuleName1", "ds3", null, null)));
+        sqlStatement.buildAttributes();
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
@@ -111,6 +116,7 @@ class AlterShadowRuleExecutorTest {
         AlterShadowRuleStatement sqlStatement = new AlterShadowRuleStatement(Arrays.asList(
                 new ShadowRuleSegment("initRuleName1", "ds", null, Collections.singletonMap("t_order", Collections.singleton(segment))),
                 new ShadowRuleSegment("initRuleName2", "ds1", null, Collections.singletonMap("t_order_1", Collections.singleton(segment)))));
+        sqlStatement.buildAttributes();
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
@@ -123,6 +129,7 @@ class AlterShadowRuleExecutorTest {
         AlterShadowRuleStatement sqlStatement = new AlterShadowRuleStatement(Arrays.asList(
                 new ShadowRuleSegment("initRuleName1", "ds", null, Collections.singletonMap("t_order", Collections.singleton(segment))),
                 new ShadowRuleSegment("initRuleName2", "ds1", null, Collections.singletonMap("t_order_1", Collections.singleton(segment)))));
+        sqlStatement.buildAttributes();
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
@@ -137,6 +144,7 @@ class AlterShadowRuleExecutorTest {
         AlterShadowRuleStatement sqlStatement = new AlterShadowRuleStatement(Arrays.asList(
                 new ShadowRuleSegment("initRuleName1", "ds", null, Collections.singletonMap("t_order", Collections.singleton(segment1))),
                 new ShadowRuleSegment("initRuleName2", "ds1", null, Collections.singletonMap("t_order_1", Collections.singleton(segment2)))));
+        sqlStatement.buildAttributes();
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
@@ -150,6 +158,7 @@ class AlterShadowRuleExecutorTest {
         AlterShadowRuleStatement sqlStatement = new AlterShadowRuleStatement(Arrays.asList(
                 new ShadowRuleSegment("initRuleName1", "ds", null, Collections.singletonMap("t_order", Collections.singleton(segment1))),
                 new ShadowRuleSegment("initRuleName2", "ds1", null, Collections.singletonMap("t_order_1", Collections.singleton(segment2)))));
+        sqlStatement.buildAttributes();
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
diff --git a/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/CreateShadowRuleExecutorTest.java b/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/CreateShadowRuleExecutorTest.java
index 3e954821bec..073d36f03db 100644
--- a/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/CreateShadowRuleExecutorTest.java
+++ b/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/CreateShadowRuleExecutorTest.java
@@ -77,7 +77,9 @@ class CreateShadowRuleExecutorTest {
     @Test
     void assertExecuteWithDuplicateRuleName() {
         ShadowRuleSegment ruleSegment = new ShadowRuleSegment("ruleName", null, null, null);
-        assertThrows(DuplicateRuleException.class, () -> executor.checkBeforeUpdate(new CreateShadowRuleStatement(false, Arrays.asList(ruleSegment, ruleSegment))));
+        CreateShadowRuleStatement sqlStatement = new CreateShadowRuleStatement(false, Arrays.asList(ruleSegment, ruleSegment));
+        sqlStatement.buildAttributes();
+        assertThrows(DuplicateRuleException.class, () -> executor.checkBeforeUpdate(sqlStatement));
     }
     
     @Test
@@ -87,7 +89,9 @@ class CreateShadowRuleExecutorTest {
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
-        assertThrows(DuplicateRuleException.class, () -> executor.checkBeforeUpdate(new CreateShadowRuleStatement(false, Collections.singleton(ruleSegment))));
+        CreateShadowRuleStatement sqlStatement = new CreateShadowRuleStatement(false, Collections.singleton(ruleSegment));
+        sqlStatement.buildAttributes();
+        assertThrows(DuplicateRuleException.class, () -> executor.checkBeforeUpdate(sqlStatement));
     }
     
     @Test
@@ -97,13 +101,16 @@ class CreateShadowRuleExecutorTest {
         when(database.getRuleMetaData().getAttributes(DataSourceMapperRuleAttribute.class)).thenReturn(Collections.singleton(ruleAttribute));
         executor.setDatabase(database);
         ShadowRuleSegment ruleSegment = new ShadowRuleSegment("duplicate_ds", null, null, null);
-        assertThrows(InvalidRuleConfigurationException.class, () -> executor.checkBeforeUpdate(new CreateShadowRuleStatement(false, Collections.singleton(ruleSegment))));
+        CreateShadowRuleStatement sqlStatement = new CreateShadowRuleStatement(false, Collections.singleton(ruleSegment));
+        sqlStatement.buildAttributes();
+        assertThrows(InvalidRuleConfigurationException.class, () -> executor.checkBeforeUpdate(sqlStatement));
     }
     
     @Test
     void assertExecuteWithNotExistResource() {
         when(resourceMetaData.getNotExistedDataSources(any())).thenReturn(Arrays.asList("ds0", "ds1"));
         CreateShadowRuleStatement sqlStatement = new CreateShadowRuleStatement(false, Collections.singleton(new ShadowRuleSegment("ruleName", "ds1", null, null)));
+        sqlStatement.buildAttributes();
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
@@ -116,6 +123,7 @@ class CreateShadowRuleExecutorTest {
         CreateShadowRuleStatement sqlStatement = new CreateShadowRuleStatement(false, Arrays.asList(
                 new ShadowRuleSegment("ruleName", "ds", null, Collections.singletonMap("t_order", Collections.singleton(segment))),
                 new ShadowRuleSegment("ruleName", "ds1", null, Collections.singletonMap("t_order_1", Collections.singleton(segment)))));
+        sqlStatement.buildAttributes();
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
@@ -128,6 +136,7 @@ class CreateShadowRuleExecutorTest {
         CreateShadowRuleStatement sqlStatement = new CreateShadowRuleStatement(false, Arrays.asList(
                 new ShadowRuleSegment("ruleName", "ds", null, Collections.singletonMap("t_order", Collections.singleton(segment))),
                 new ShadowRuleSegment("ruleName1", "ds1", null, Collections.singletonMap("t_order_1", Collections.singleton(segment)))));
+        sqlStatement.buildAttributes();
         assertThrows(DuplicateRuleException.class, () -> executor.checkBeforeUpdate(sqlStatement));
     }
     
@@ -136,6 +145,7 @@ class CreateShadowRuleExecutorTest {
         ShadowAlgorithmSegment segment = new ShadowAlgorithmSegment("algorithmName", new AlgorithmSegment("type", PropertiesBuilder.build(new Property("type", "value"))));
         CreateShadowRuleStatement sqlStatement = new CreateShadowRuleStatement(false,
                 Collections.singleton(new ShadowRuleSegment("ruleName", "ds", null, Collections.singletonMap("t_order", Collections.singleton(segment)))));
+        sqlStatement.buildAttributes();
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
@@ -147,6 +157,7 @@ class CreateShadowRuleExecutorTest {
         ShadowAlgorithmSegment segment = new ShadowAlgorithmSegment("algorithmName", new AlgorithmSegment("SQL_HINT", null));
         CreateShadowRuleStatement sqlStatement = new CreateShadowRuleStatement(false,
                 Collections.singleton(new ShadowRuleSegment("initRuleNameWithoutProps", "ds", null, Collections.singletonMap("t_order", Collections.singleton(segment)))));
+        sqlStatement.buildAttributes();
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
@@ -158,6 +169,7 @@ class CreateShadowRuleExecutorTest {
         ShadowAlgorithmSegment segment = new ShadowAlgorithmSegment("algorithmName", new AlgorithmSegment("SQL_HINT", PropertiesBuilder.build(new Property("type", "value"))));
         CreateShadowRuleStatement sqlStatement = new CreateShadowRuleStatement(true,
                 Collections.singleton(new ShadowRuleSegment("initRuleName", "ds", null, Collections.singletonMap("t_order", Collections.singleton(segment)))));
+        sqlStatement.buildAttributes();
         ShadowRule rule = mock(ShadowRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         executor.setRule(rule);
diff --git a/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/DropShadowRuleExecutorTest.java b/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/DropShadowRuleExecutorTest.java
index 8e3c5e11ffd..a26aaf4fb8c 100644
--- a/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/DropShadowRuleExecutorTest.java
+++ b/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/update/DropShadowRuleExecutorTest.java
@@ -95,11 +95,15 @@ class DropShadowRuleExecutorTest {
     }
     
     private DropShadowRuleStatement createSQLStatement(final String... ruleName) {
-        return new DropShadowRuleStatement(false, Arrays.asList(ruleName));
+        DropShadowRuleStatement result = new DropShadowRuleStatement(false, Arrays.asList(ruleName));
+        result.buildAttributes();
+        return result;
     }
     
     private DropShadowRuleStatement createSQLStatement(final boolean ifExists, final String... ruleName) {
-        return new DropShadowRuleStatement(ifExists, Arrays.asList(ruleName));
+        DropShadowRuleStatement result = new DropShadowRuleStatement(ifExists, Arrays.asList(ruleName));
+        result.buildAttributes();
+        return result;
     }
     
     private ShadowRuleConfiguration createCurrentRuleConfiguration() {
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingAlterIndexSupportedCheckerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingAlterIndexSupportedCheckerTest.java
index 52e1222c622..16f28653ac9 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingAlterIndexSupportedCheckerTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingAlterIndexSupportedCheckerTest.java
@@ -59,6 +59,7 @@ class ShardingAlterIndexSupportedCheckerTest {
         AlterIndexStatement sqlStatement = new AlterIndexStatement(databaseType);
         sqlStatement.setIndex(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index"))));
         sqlStatement.setRenameIndex(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index_new"))));
+        sqlStatement.buildAttributes();
         ShardingSphereTable table = mock(ShardingSphereTable.class);
         ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
         when(schema.getAllTables()).thenReturn(Collections.singleton(table));
@@ -72,6 +73,7 @@ class ShardingAlterIndexSupportedCheckerTest {
         AlterIndexStatement sqlStatement = new AlterIndexStatement(databaseType);
         sqlStatement.setIndex(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index"))));
         sqlStatement.setRenameIndex(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index_new"))));
+        sqlStatement.buildAttributes();
         ShardingSphereTable table = mock(ShardingSphereTable.class);
         when(database.getSchema("public").getTable("t_order")).thenReturn(table);
         assertThrows(IndexNotFoundException.class, () -> new ShardingAlterIndexSupportedChecker().check(rule, database, mock(), new CommonSQLStatementContext(sqlStatement)));
@@ -82,6 +84,7 @@ class ShardingAlterIndexSupportedCheckerTest {
         AlterIndexStatement sqlStatement = new AlterIndexStatement(databaseType);
         sqlStatement.setIndex(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index"))));
         sqlStatement.setRenameIndex(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index_new"))));
+        sqlStatement.buildAttributes();
         ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
         ShardingSphereTable table = mock(ShardingSphereTable.class);
         when(schema.getAllTables()).thenReturn(Collections.singleton(table));
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingAlterTableSupportedCheckerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingAlterTableSupportedCheckerTest.java
index 413e7aa61e7..99ea141c739 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingAlterTableSupportedCheckerTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingAlterTableSupportedCheckerTest.java
@@ -58,6 +58,7 @@ class ShardingAlterTableSupportedCheckerTest {
         AlterTableStatement sqlStatement = new AlterTableStatement(databaseType);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
         sqlStatement.setRenameTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order_new"))));
+        sqlStatement.buildAttributes();
         CommonSQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         when(rule.containsShardingTable(Arrays.asList("t_order", "t_order_new"))).thenReturn(true);
         assertThrows(UnsupportedShardingOperationException.class, () -> new ShardingAlterTableSupportedChecker().check(rule, database, mock(), sqlStatementContext));
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingCreateIndexSupportedCheckerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingCreateIndexSupportedCheckerTest.java
index d4287fd9df8..639f8eb9e77 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingCreateIndexSupportedCheckerTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingCreateIndexSupportedCheckerTest.java
@@ -59,6 +59,7 @@ class ShardingCreateIndexSupportedCheckerTest {
         CreateIndexStatement sqlStatement = new CreateIndexStatement(databaseType);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
         sqlStatement.setIndex(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index"))));
+        sqlStatement.buildAttributes();
         ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
         when(schema.containsTable("t_order")).thenReturn(true);
         assertDoesNotThrow(() -> new ShardingCreateIndexSupportedChecker().check(rule, database, schema, new CommonSQLStatementContext(sqlStatement)));
@@ -69,6 +70,7 @@ class ShardingCreateIndexSupportedCheckerTest {
         CreateIndexStatement sqlStatement = new CreateIndexStatement(databaseType);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
         sqlStatement.setIndex(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index"))));
+        sqlStatement.buildAttributes();
         ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
         when(schema.containsTable("t_order")).thenReturn(false);
         assertThrows(NoSuchTableException.class, () -> new ShardingCreateIndexSupportedChecker().check(rule, database, schema, new CommonSQLStatementContext(sqlStatement)));
@@ -79,6 +81,7 @@ class ShardingCreateIndexSupportedCheckerTest {
         CreateIndexStatement sqlStatement = new CreateIndexStatement(databaseType);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
         sqlStatement.setIndex(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index"))));
+        sqlStatement.buildAttributes();
         ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
         when(schema.containsTable("t_order")).thenReturn(true);
         when(schema.containsIndex("t_order", "t_order_index")).thenReturn(true);
@@ -91,6 +94,7 @@ class ShardingCreateIndexSupportedCheckerTest {
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
         sqlStatement.getColumns().add(new ColumnSegment(0, 0, new IdentifierValue("content")));
         sqlStatement.setAnonymousIndexStartIndex(10);
+        sqlStatement.buildAttributes();
         ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
         when(schema.containsTable("t_order")).thenReturn(true);
         assertDoesNotThrow(() -> new ShardingCreateIndexSupportedChecker().check(rule, database, schema, new CommonSQLStatementContext(sqlStatement)));
@@ -102,6 +106,7 @@ class ShardingCreateIndexSupportedCheckerTest {
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
         sqlStatement.getColumns().add(new ColumnSegment(0, 0, new IdentifierValue("content")));
         sqlStatement.setAnonymousIndexStartIndex(10);
+        sqlStatement.buildAttributes();
         ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
         when(schema.containsTable("t_order")).thenReturn(false);
         assertThrows(NoSuchTableException.class, () -> new ShardingCreateIndexSupportedChecker().check(rule, database, schema, new CommonSQLStatementContext(sqlStatement)));
@@ -113,6 +118,7 @@ class ShardingCreateIndexSupportedCheckerTest {
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
         sqlStatement.getColumns().add(new ColumnSegment(0, 0, new IdentifierValue("content")));
         sqlStatement.setAnonymousIndexStartIndex(10);
+        sqlStatement.buildAttributes();
         ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
         when(schema.containsTable("t_order")).thenReturn(true);
         when(schema.containsIndex("t_order", "content_idx")).thenReturn(true);
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingCreateTableSupportedCheckerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingCreateTableSupportedCheckerTest.java
index 74bf9d9a324..59228b7d045 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingCreateTableSupportedCheckerTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingCreateTableSupportedCheckerTest.java
@@ -50,6 +50,7 @@ class ShardingCreateTableSupportedCheckerTest {
     void assertCheck() {
         CreateTableStatement sqlStatement = new CreateTableStatement(databaseType);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(1, 2, new IdentifierValue("foo_tbl"))));
+        sqlStatement.buildAttributes();
         assertThrows(TableExistsException.class, () -> assertCheck(sqlStatement));
     }
     
@@ -66,6 +67,7 @@ class ShardingCreateTableSupportedCheckerTest {
         CreateTableStatement sqlStatement = new CreateTableStatement(databaseType);
         sqlStatement.setIfNotExists(true);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(1, 2, new IdentifierValue("foo_tbl"))));
+        sqlStatement.buildAttributes();
         assertCheckIfNotExists(sqlStatement);
     }
     
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingDropIndexSupportedCheckerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingDropIndexSupportedCheckerTest.java
index d5c5da5cd7b..119a026632c 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingDropIndexSupportedCheckerTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingDropIndexSupportedCheckerTest.java
@@ -58,6 +58,7 @@ class ShardingDropIndexSupportedCheckerTest {
         DropIndexStatement sqlStatement = new DropIndexStatement(databaseType);
         sqlStatement.getIndexes().add(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index"))));
         sqlStatement.getIndexes().add(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index_new"))));
+        sqlStatement.buildAttributes();
         ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
         ShardingSphereTable table = mock(ShardingSphereTable.class);
         when(schema.getAllTables()).thenReturn(Collections.singleton(table));
@@ -71,6 +72,7 @@ class ShardingDropIndexSupportedCheckerTest {
         DropIndexStatement sqlStatement = new DropIndexStatement(databaseType);
         sqlStatement.getIndexes().add(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index"))));
         sqlStatement.getIndexes().add(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index_new"))));
+        sqlStatement.buildAttributes();
         ShardingSphereTable table = mock(ShardingSphereTable.class);
         when(database.getSchema("public").getAllTables()).thenReturn(Collections.singleton(table));
         when(database.getSchema("public").getTable("t_order")).thenReturn(table);
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingDropTableSupportedCheckerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingDropTableSupportedCheckerTest.java
index fc9a3bf47c4..272067a466a 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingDropTableSupportedCheckerTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/checker/sql/ddl/ShardingDropTableSupportedCheckerTest.java
@@ -70,6 +70,7 @@ class ShardingDropTableSupportedCheckerTest {
         DropTableStatement sqlStatement = new DropTableStatement(databaseType);
         SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order_item")));
         sqlStatement.getTables().add(table);
+        sqlStatement.buildAttributes();
         SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
         ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java
index 4c6841c83bd..c5ec5cd02be 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java
@@ -97,8 +97,10 @@ class ShardingResultMergerEngineTest {
     
     @Test
     void assertNewInstanceWithDDLStatement() {
+        FetchStatement fetchStatement = new FetchStatement(databaseType, null, null);
+        fetchStatement.buildAttributes();
         ConfigurationProperties props = new ConfigurationProperties(new Properties());
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new FetchStatement(databaseType, null, null));
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(fetchStatement);
         assertThat(new ShardingResultMergerEngine().newInstance("foo_db", databaseType, null, props, sqlStatementContext), isA(ShardingDDLResultMerger.class));
     }
 }
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ShardingIndexTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ShardingIndexTokenGeneratorTest.java
index ecc2c7e56b2..ec86f7d1513 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ShardingIndexTokenGeneratorTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ShardingIndexTokenGeneratorTest.java
@@ -54,14 +54,18 @@ class ShardingIndexTokenGeneratorTest {
     
     @Test
     void assertIsNotGenerateSQLTokenWithNotIndexContextAvailable() {
+        AlterIndexStatement sqlStatement = new AlterIndexStatement(databaseType);
+        sqlStatement.buildAttributes();
         SQLStatementContext sqlStatementContext = mock(SQLStatementContext.class);
-        when(sqlStatementContext.getSqlStatement()).thenReturn(new AlterIndexStatement(databaseType));
+        when(sqlStatementContext.getSqlStatement()).thenReturn(sqlStatement);
         assertFalse(generator.isGenerateSQLToken(sqlStatementContext));
     }
     
     @Test
     void assertIsNotGenerateSQLTokenWithEmptyIndex() {
-        CommonSQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new AlterIndexStatement(postgresqlDatabaseType));
+        AlterIndexStatement sqlStatement = new AlterIndexStatement(postgresqlDatabaseType);
+        sqlStatement.buildAttributes();
+        CommonSQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         assertFalse(generator.isGenerateSQLToken(sqlStatementContext));
     }
     
@@ -69,13 +73,16 @@ class ShardingIndexTokenGeneratorTest {
     void assertIsGenerateSQLToken() {
         AlterIndexStatement sqlStatement = new AlterIndexStatement(postgresqlDatabaseType);
         sqlStatement.setIndex(mock(IndexSegment.class));
+        sqlStatement.buildAttributes();
         CommonSQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         assertTrue(generator.isGenerateSQLToken(sqlStatementContext));
     }
     
     @Test
     void assertGenerateSQLTokensWithNotIndexContextAvailable() {
-        CommonSQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new AlterIndexStatement(databaseType));
+        AlterIndexStatement sqlStatement = new AlterIndexStatement(databaseType);
+        sqlStatement.buildAttributes();
+        CommonSQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Collection<SQLToken> actual = generator.generateSQLTokens(sqlStatementContext);
         assertTrue(actual.isEmpty());
     }
@@ -104,6 +111,7 @@ class ShardingIndexTokenGeneratorTest {
     private CommonSQLStatementContext mockAlterIndexStatementContext(final IndexSegment indexSegment) {
         AlterIndexStatement sqlStatement = new AlterIndexStatement(databaseType);
         sqlStatement.setIndex(indexSegment);
+        sqlStatement.buildAttributes();
         return new CommonSQLStatementContext(sqlStatement);
     }
     
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/IndexTokenTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/IndexTokenTest.java
index dc16d4c405c..1be35255f06 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/IndexTokenTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/IndexTokenTest.java
@@ -63,7 +63,9 @@ class IndexTokenTest {
     
     @Test
     void assertToStringWithShardingTableAndGeneratedIndex() {
-        CommonSQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new CreateIndexStatement(databaseType));
+        CreateIndexStatement sqlStatement = new CreateIndexStatement(databaseType);
+        sqlStatement.buildAttributes();
+        CommonSQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         IndexToken indexToken = new IndexToken(0, 0, new IdentifierValue("bar_idx"), sqlStatementContext, mock(ShardingRule.class), mockSchema());
         assertThat(indexToken.toString(mockRouteUnit()), is(" bar_idx_foo_tbl_0 "));
     }
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingAlterTableRouteContextCheckerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingAlterTableRouteContextCheckerTest.java
index 765990f1805..1da74666625 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingAlterTableRouteContextCheckerTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingAlterTableRouteContextCheckerTest.java
@@ -70,6 +70,7 @@ class ShardingAlterTableRouteContextCheckerTest {
     void assertCheckWithSameRouteResultShardingTableForPostgreSQL() {
         AlterTableStatement sqlStatement = new AlterTableStatement(databaseType);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
+        sqlStatement.buildAttributes();
         when(shardingRule.isShardingTable("t_order")).thenReturn(true);
         when(shardingRule.getShardingTable("t_order")).thenReturn(new ShardingTable(Arrays.asList("ds_0", "ds_1"), "t_order"));
         Collection<RouteUnit> routeUnits = new LinkedList<>();
@@ -84,6 +85,7 @@ class ShardingAlterTableRouteContextCheckerTest {
     void assertCheckWithDifferentRouteResultShardingTableForPostgreSQL() {
         AlterTableStatement sqlStatement = new AlterTableStatement(databaseType);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
+        sqlStatement.buildAttributes();
         when(shardingRule.isShardingTable("t_order")).thenReturn(true);
         when(shardingRule.getShardingTable("t_order")).thenReturn(new ShardingTable(Arrays.asList("ds_0", "ds_1"), "t_order"));
         Collection<RouteUnit> routeUnits = new LinkedList<>();
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingCreateTableRouteContextCheckerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingCreateTableRouteContextCheckerTest.java
index 7864d882979..cc795dc6494 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingCreateTableRouteContextCheckerTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingCreateTableRouteContextCheckerTest.java
@@ -71,6 +71,7 @@ class ShardingCreateTableRouteContextCheckerTest {
         CreateTableStatement sqlStatement = new CreateTableStatement(databaseType);
         sqlStatement.setIfNotExists(false);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
+        sqlStatement.buildAttributes();
         when(shardingRule.isShardingTable("t_order")).thenReturn(true);
         when(shardingRule.getShardingTable("t_order")).thenReturn(new ShardingTable(Arrays.asList("ds_0", "ds_1"), "t_order"));
         Collection<RouteUnit> routeUnits = new LinkedList<>();
@@ -86,6 +87,7 @@ class ShardingCreateTableRouteContextCheckerTest {
         CreateTableStatement sqlStatement = new CreateTableStatement(databaseType);
         sqlStatement.setIfNotExists(false);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
+        sqlStatement.buildAttributes();
         when(shardingRule.isShardingTable("t_order")).thenReturn(true);
         when(shardingRule.getShardingTable("t_order")).thenReturn(new ShardingTable(Arrays.asList("ds_0", "ds_1"), "t_order"));
         Collection<RouteUnit> routeUnits = new LinkedList<>();
@@ -101,6 +103,7 @@ class ShardingCreateTableRouteContextCheckerTest {
         CreateTableStatement sqlStatement = new CreateTableStatement(databaseType);
         sqlStatement.setIfNotExists(false);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_config"))));
+        sqlStatement.buildAttributes();
         when(queryContext.getSqlStatementContext()).thenReturn(new CommonSQLStatementContext(sqlStatement));
         assertDoesNotThrow(() -> new ShardingCreateTableRouteContextChecker().check(shardingRule, queryContext, database, mock(ConfigurationProperties.class), routeContext));
     }
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingDropIndexRouteContextCheckerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingDropIndexRouteContextCheckerTest.java
index 23949ebcf62..90e1d6cfe43 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingDropIndexRouteContextCheckerTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingDropIndexRouteContextCheckerTest.java
@@ -72,6 +72,7 @@ class ShardingDropIndexRouteContextCheckerTest {
         DropIndexStatement sqlStatement = new DropIndexStatement(databaseType);
         sqlStatement.getIndexes().add(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index"))));
         sqlStatement.getIndexes().add(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index_new"))));
+        sqlStatement.buildAttributes();
         ShardingSphereTable table = mock(ShardingSphereTable.class);
         when(table.getName()).thenReturn("t_order");
         when(database.getSchema("public").getAllTables()).thenReturn(Collections.singleton(table));
@@ -92,6 +93,7 @@ class ShardingDropIndexRouteContextCheckerTest {
         DropIndexStatement sqlStatement = new DropIndexStatement(databaseType);
         sqlStatement.getIndexes().add(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index"))));
         sqlStatement.getIndexes().add(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("t_order_index_new"))));
+        sqlStatement.buildAttributes();
         ShardingSphereTable table = mock(ShardingSphereTable.class);
         when(table.getName()).thenReturn("t_order");
         when(database.getSchema("public").getAllTables()).thenReturn(Collections.singleton(table));
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingDropTableRouteContextCheckerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingDropTableRouteContextCheckerTest.java
index 940555735f2..04aecbdd31b 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingDropTableRouteContextCheckerTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/checker/ddl/ShardingDropTableRouteContextCheckerTest.java
@@ -86,6 +86,7 @@ class ShardingDropTableRouteContextCheckerTest {
         DropTableStatement sqlStatement = new DropTableStatement(databaseType);
         SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order_item")));
         sqlStatement.getTables().add(table);
+        sqlStatement.buildAttributes();
         ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
         when(database.getName()).thenReturn("db_schema");
         when(database.getSchema("db_schema").containsTable("t_order_item")).thenReturn(true);
@@ -126,6 +127,7 @@ class ShardingDropTableRouteContextCheckerTest {
         DropTableStatement sqlStatement = new DropTableStatement(databaseType);
         SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order")));
         sqlStatement.getTables().add(table);
+        sqlStatement.buildAttributes();
         when(shardingRule.isShardingTable("t_order")).thenReturn(true);
         when(shardingRule.getShardingTable("t_order")).thenReturn(new ShardingTable(Arrays.asList("ds_0", "ds_1"), "t_order"));
         Collection<RouteUnit> routeUnits = new LinkedList<>();
@@ -142,6 +144,7 @@ class ShardingDropTableRouteContextCheckerTest {
         DropTableStatement sqlStatement = new DropTableStatement(databaseType);
         SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order")));
         sqlStatement.getTables().add(table);
+        sqlStatement.buildAttributes();
         when(shardingRule.isShardingTable("t_order")).thenReturn(true);
         when(shardingRule.getShardingTable("t_order")).thenReturn(new ShardingTable(Arrays.asList("ds_0", "ds_1"), "t_order"));
         Collection<RouteUnit> routeUnits = new LinkedList<>();
@@ -157,6 +160,7 @@ class ShardingDropTableRouteContextCheckerTest {
         DropTableStatement sqlStatement = new DropTableStatement(databaseType);
         SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_config")));
         sqlStatement.getTables().add(table);
+        sqlStatement.buildAttributes();
         when(shardingRule.getShardingTable("t_config")).thenReturn(new ShardingTable(Arrays.asList("ds_0", "ds_1"), "t_config"));
         Collection<RouteUnit> routeUnits = new LinkedList<>();
         routeUnits.add(new RouteUnit(new RouteMapper("ds_0", "ds_0"), Collections.singleton(new RouteMapper("t_config", "t_config"))));
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/ShardingRouteEngineFactoryTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/ShardingRouteEngineFactoryTest.java
index ff62dbb4d54..1d36fe5ec24 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/ShardingRouteEngineFactoryTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/ShardingRouteEngineFactoryTest.java
@@ -134,6 +134,7 @@ class ShardingRouteEngineFactoryTest {
     void assertNewInstanceForDCLForSingleTable() {
         GrantStatement sqlStatement = new GrantStatement(databaseType);
         sqlStatement.getTables().add(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl"))));
+        sqlStatement.buildAttributes();
         SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         QueryContext queryContext = new QueryContext(sqlStatementContext, "", Collections.emptyList(), new HintValueContext(), mockConnectionContext(), mock(ShardingSphereMetaData.class));
         ShardingRouteEngine actual = ShardingRouteEngineFactory.newInstance(shardingRule, database, queryContext, shardingConditions, Collections.singletonList("tbl"), props);
@@ -225,7 +226,9 @@ class ShardingRouteEngineFactoryTest {
     @Test
     void assertNewInstanceForCursorStatementWithShardingTable() {
         CursorStatementContext cursorStatementContext = mock(CursorStatementContext.class, RETURNS_DEEP_STUBS);
-        when(cursorStatementContext.getSqlStatement()).thenReturn(new CursorStatement(databaseType, null, null));
+        CursorStatement cursorStatement = new CursorStatement(databaseType, null, null);
+        cursorStatement.buildAttributes();
+        when(cursorStatementContext.getSqlStatement()).thenReturn(cursorStatement);
         Collection<SimpleTableSegment> tableSegments = createSimpleTableSegments();
         Collection<String> tableNames = tableSegments.stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toSet());
         when(cursorStatementContext.getTablesContext().getSimpleTables()).thenReturn(tableSegments);
@@ -241,7 +244,9 @@ class ShardingRouteEngineFactoryTest {
     @Test
     void assertNewInstanceForCursorStatementWithSingleTable() {
         CursorStatementContext cursorStatementContext = mock(CursorStatementContext.class, RETURNS_DEEP_STUBS);
-        when(cursorStatementContext.getSqlStatement()).thenReturn(new CursorStatement(databaseType, null, null));
+        CursorStatement cursorStatement = new CursorStatement(databaseType, null, null);
+        cursorStatement.buildAttributes();
+        when(cursorStatementContext.getSqlStatement()).thenReturn(cursorStatement);
         Collection<SimpleTableSegment> tableSegments = createSimpleTableSegments();
         when(cursorStatementContext.getTablesContext().getSimpleTables()).thenReturn(tableSegments);
         when(cursorStatementContext.getTablesContext().getDatabaseName()).thenReturn(Optional.empty());
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/broadcast/ShardingTableBroadcastRouteEngineTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/broadcast/ShardingTableBroadcastRouteEngineTest.java
index 19ce3c50a44..19c3b60602b 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/broadcast/ShardingTableBroadcastRouteEngineTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/broadcast/ShardingTableBroadcastRouteEngineTest.java
@@ -91,6 +91,7 @@ class ShardingTableBroadcastRouteEngineTest {
         when(segment.getOwner()).thenReturn(Optional.empty());
         DropIndexStatement sqlStatement = new DropIndexStatement(databaseType);
         sqlStatement.getIndexes().add(segment);
+        sqlStatement.buildAttributes();
         ShardingSphereDatabase database = new ShardingSphereDatabase("foo_db", databaseType, mock(ResourceMetaData.class), mock(RuleMetaData.class), Collections.singleton(schema));
         ShardingTableBroadcastRouteEngine shardingTableBroadcastRouteEngine = new ShardingTableBroadcastRouteEngine(database, sqlStatement, Collections.emptyList());
         RouteContext routeContext = shardingTableBroadcastRouteEngine.route(createShardingRule());
@@ -108,6 +109,7 @@ class ShardingTableBroadcastRouteEngineTest {
         when(schema.getName()).thenReturn("foo_db");
         when(schema.getTable(anyString()).containsIndex(anyString())).thenReturn(false);
         DropIndexStatement sqlStatement = new DropIndexStatement(databaseType);
+        sqlStatement.buildAttributes();
         ShardingSphereDatabase database = new ShardingSphereDatabase("foo_db", databaseType, mock(ResourceMetaData.class), mock(RuleMetaData.class), Collections.singleton(schema));
         ShardingTableBroadcastRouteEngine shardingTableBroadcastRouteEngine = new ShardingTableBroadcastRouteEngine(database, sqlStatement, Collections.emptyList());
         RouteContext routeContext = shardingTableBroadcastRouteEngine.route(createShardingRule());
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/unicast/ShardingUnicastRouteEngineTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/unicast/ShardingUnicastRouteEngineTest.java
index edac061d0ac..360a7da4c8a 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/unicast/ShardingUnicastRouteEngineTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/unicast/ShardingUnicastRouteEngineTest.java
@@ -93,6 +93,7 @@ class ShardingUnicastRouteEngineTest {
     @Test
     void assertRoutingForBroadcastTableWithCursorStatement() {
         CursorStatement sqlStatement = new CursorStatement(databaseType, null, null);
+        sqlStatement.buildAttributes();
         RouteContext actual = new ShardingUnicastRouteEngine(sqlStatement, Collections.singleton("t_config"), new ConnectionContext(Collections::emptySet)).route(rule);
         assertThat(actual.getRouteUnits().size(), is(1));
         assertThat(actual.getRouteUnits().iterator().next().getDataSourceMapper().getActualName(), is("ds_0"));
diff --git a/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutorTest.java b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutorTest.java
index 036ddc8f96a..e40d3d94431 100644
--- a/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutorTest.java
+++ b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutorTest.java
@@ -76,8 +76,9 @@ class ShowShardingTableNodesExecutorTest {
     }
     
     private void assertOrder(final ShardingRule rule) throws SQLException {
-        DistSQLQueryExecuteEngine engine = new DistSQLQueryExecuteEngine(new ShowShardingTableNodesStatement("t_order", null),
-                "foo_db", mockContextManager(rule), mock(DistSQLConnectionContext.class));
+        ShowShardingTableNodesStatement sqlStatement = new ShowShardingTableNodesStatement("t_order", null);
+        sqlStatement.buildAttributes();
+        DistSQLQueryExecuteEngine engine = new DistSQLQueryExecuteEngine(sqlStatement, "foo_db", mockContextManager(rule), mock(DistSQLConnectionContext.class));
         engine.executeQuery();
         Collection<LocalDataQueryResultRow> actual = engine.getRows();
         assertThat(actual.size(), is(1));
@@ -95,8 +96,9 @@ class ShowShardingTableNodesExecutorTest {
     }
     
     private void assertOrderItem(final ShardingRule rule) throws SQLException {
-        DistSQLQueryExecuteEngine engine = new DistSQLQueryExecuteEngine(new ShowShardingTableNodesStatement("t_order_item", null),
-                "foo_db", mockContextManager(rule), mock(DistSQLConnectionContext.class));
+        ShowShardingTableNodesStatement sqlStatement = new ShowShardingTableNodesStatement("t_order_item", null);
+        sqlStatement.buildAttributes();
+        DistSQLQueryExecuteEngine engine = new DistSQLQueryExecuteEngine(sqlStatement, "foo_db", mockContextManager(rule), mock(DistSQLConnectionContext.class));
         engine.executeQuery();
         Collection<LocalDataQueryResultRow> actual = engine.getRows();
         assertThat(actual.size(), is(1));
@@ -106,8 +108,9 @@ class ShowShardingTableNodesExecutorTest {
     }
     
     private void assertAll(final ShardingRule rule) throws SQLException {
-        DistSQLQueryExecuteEngine engine = new DistSQLQueryExecuteEngine(new ShowShardingTableNodesStatement(null, null),
-                "foo_db", mockContextManager(rule), mock(DistSQLConnectionContext.class));
+        ShowShardingTableNodesStatement sqlStatement = new ShowShardingTableNodesStatement(null, null);
+        sqlStatement.buildAttributes();
+        DistSQLQueryExecuteEngine engine = new DistSQLQueryExecuteEngine(sqlStatement, "foo_db", mockContextManager(rule), mock(DistSQLConnectionContext.class));
         engine.executeQuery();
         List<LocalDataQueryResultRow> actual = new ArrayList<>(engine.getRows());
         assertThat(actual.size(), is(2));
diff --git a/infra/binder/core/src/main/java/org/apache/shardingsphere/infra/binder/engine/statement/SQLStatementCopyUtils.java b/infra/binder/core/src/main/java/org/apache/shardingsphere/infra/binder/engine/statement/SQLStatementCopyUtils.java
index 63e4d27d22e..ec07d56ac83 100644
--- a/infra/binder/core/src/main/java/org/apache/shardingsphere/infra/binder/engine/statement/SQLStatementCopyUtils.java
+++ b/infra/binder/core/src/main/java/org/apache/shardingsphere/infra/binder/engine/statement/SQLStatementCopyUtils.java
@@ -37,5 +37,6 @@ public final class SQLStatementCopyUtils {
         boundSQLStatement.addParameterMarkers(originalSQLStatement.getParameterMarkers());
         boundSQLStatement.getVariableNames().addAll(originalSQLStatement.getVariableNames());
         boundSQLStatement.getComments().addAll(originalSQLStatement.getComments());
+        boundSQLStatement.buildAttributes();
     }
 }
diff --git a/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/context/SQLStatementContextFactoryTest.java b/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/context/SQLStatementContextFactoryTest.java
index 0ae0ae23a92..eae36cd0bf1 100644
--- a/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/context/SQLStatementContextFactoryTest.java
+++ b/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/context/SQLStatementContextFactoryTest.java
@@ -64,6 +64,7 @@ class SQLStatementContextFactoryTest {
         SelectStatement selectStatement = new SelectStatement(databaseType);
         selectStatement.setLimit(new LimitSegment(0, 10, null, null));
         selectStatement.setProjections(projectionsSegment);
+        selectStatement.buildAttributes();
         SQLStatementContext sqlStatementContext = new SQLBindEngine(mockMetaData(), "foo_db", new HintValueContext()).bind(selectStatement);
         assertThat(sqlStatementContext, isA(SelectStatementContext.class));
     }
@@ -72,6 +73,7 @@ class SQLStatementContextFactoryTest {
     void assertSQLStatementContextCreatedWhenSQLStatementInstance() {
         InsertStatement insertStatement = new InsertStatement(databaseType);
         insertStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl"))));
+        insertStatement.buildAttributes();
         SQLStatementContext sqlStatementContext = new SQLBindEngine(mockMetaData(), "foo_db", new HintValueContext()).bind(insertStatement);
         assertThat(sqlStatementContext, isA(InsertStatementContext.class));
     }
@@ -79,6 +81,7 @@ class SQLStatementContextFactoryTest {
     @Test
     void assertSQLStatementContextCreatedWhenSQLStatementNotInstanceOfSelectStatementAndInsertStatement() {
         AlterDatabaseStatement alterDatabaseStatement = new AlterDatabaseStatement(databaseType);
+        alterDatabaseStatement.buildAttributes();
         SQLStatementContext sqlStatementContext = new SQLBindEngine(mockMetaData(), "foo_db", new HintValueContext()).bind(alterDatabaseStatement);
         assertThat(sqlStatementContext, isA(CommonSQLStatementContext.class));
     }
@@ -87,26 +90,34 @@ class SQLStatementContextFactoryTest {
     void assertNewInstanceForCursorStatement() {
         SelectStatement selectStatement = new SelectStatement(databaseType);
         selectStatement.setProjections(new ProjectionsSegment(0, 0));
+        selectStatement.buildAttributes();
         CursorStatement cursorStatement = new CursorStatement(databaseType, null, selectStatement);
+        cursorStatement.buildAttributes();
         SQLStatementContext actual = new SQLBindEngine(mockMetaData(), "foo_db", new HintValueContext()).bind(cursorStatement);
         assertThat(actual, isA(CursorStatementContext.class));
     }
     
     @Test
     void assertNewInstanceForCloseStatement() {
-        SQLStatementContext actual = new SQLBindEngine(mockMetaData(), "foo_db", new HintValueContext()).bind(new CloseStatement(databaseType, null, false));
+        CloseStatement closeStatement = new CloseStatement(databaseType, null, false);
+        closeStatement.buildAttributes();
+        SQLStatementContext actual = new SQLBindEngine(mockMetaData(), "foo_db", new HintValueContext()).bind(closeStatement);
         assertThat(actual, isA(CursorHeldSQLStatementContext.class));
     }
     
     @Test
     void assertNewInstanceForMoveStatement() {
-        SQLStatementContext actual = new SQLBindEngine(mockMetaData(), "foo_db", new HintValueContext()).bind(new MoveStatement(databaseType, null, null));
+        MoveStatement moveStatement = new MoveStatement(databaseType, null, null);
+        moveStatement.buildAttributes();
+        SQLStatementContext actual = new SQLBindEngine(mockMetaData(), "foo_db", new HintValueContext()).bind(moveStatement);
         assertThat(actual, isA(CursorHeldSQLStatementContext.class));
     }
     
     @Test
     void assertNewInstanceForFetchStatement() {
-        SQLStatementContext actual = new SQLBindEngine(mockMetaData(), "foo_db", new HintValueContext()).bind(new FetchStatement(databaseType, null, null));
+        FetchStatement fetchStatement = new FetchStatement(databaseType, null, null);
+        fetchStatement.buildAttributes();
+        SQLStatementContext actual = new SQLBindEngine(mockMetaData(), "foo_db", new HintValueContext()).bind(fetchStatement);
         assertThat(actual, isA(CursorHeldSQLStatementContext.class));
     }
     
diff --git a/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/context/statement/type/dal/ExplainStatementContextTest.java b/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/context/statement/type/dal/ExplainStatementContextTest.java
index d06680d4b04..2daa33941ff 100644
--- a/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/context/statement/type/dal/ExplainStatementContextTest.java
+++ b/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/context/statement/type/dal/ExplainStatementContextTest.java
@@ -60,6 +60,7 @@ class ExplainStatementContextTest {
     @Test
     void assertNewInstance() {
         ExplainStatement explainStatement = new ExplainStatement(databaseType, explainableSQLStatement);
+        explainStatement.buildAttributes();
         ExplainStatementContext actual = new ExplainStatementContext(metaData, explainStatement, "foo_db");
         assertThat(actual.getSqlStatement(), is(explainStatement));
         assertThat(actual.getTablesContext().getSimpleTables(), is(Collections.emptyList()));
diff --git a/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/engine/statement/SQLStatementCopyUtilsTest.java b/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/engine/statement/SQLStatementCopyUtilsTest.java
index 7ab69ce9560..a0e0fc2802d 100644
--- a/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/engine/statement/SQLStatementCopyUtilsTest.java
+++ b/infra/binder/core/src/test/java/org/apache/shardingsphere/infra/binder/engine/statement/SQLStatementCopyUtilsTest.java
@@ -22,6 +22,7 @@ import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
 import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.simple.ParameterMarkerExpressionSegment;
 import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.CommentSegment;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.SQLStatement;
+import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.UpdateStatement;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
@@ -44,8 +45,8 @@ class SQLStatementCopyUtilsTest {
     
     @BeforeEach
     void setUp() {
-        originalStatement = new SQLStatement(databaseType);
-        targetStatement = new SQLStatement(databaseType);
+        originalStatement = new UpdateStatement(databaseType);
+        targetStatement = new UpdateStatement(databaseType);
     }
     
     @Test
diff --git a/infra/context/src/test/java/org/apache/shardingsphere/infra/connection/kernel/KernelProcessorTest.java b/infra/context/src/test/java/org/apache/shardingsphere/infra/connection/kernel/KernelProcessorTest.java
index 18537b2210c..d9badfee88d 100644
--- a/infra/context/src/test/java/org/apache/shardingsphere/infra/connection/kernel/KernelProcessorTest.java
+++ b/infra/context/src/test/java/org/apache/shardingsphere/infra/connection/kernel/KernelProcessorTest.java
@@ -62,7 +62,9 @@ class KernelProcessorTest {
     
     @Test
     void assertGenerateExecutionContext() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new SelectStatement(databaseType));
+        SelectStatement selectStatement = new SelectStatement(databaseType);
+        selectStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(selectStatement);
         ConnectionContext connectionContext = mock(ConnectionContext.class);
         when(connectionContext.getCurrentDatabaseName()).thenReturn(Optional.of("foo_db"));
         ShardingSphereMetaData metaData = mock(ShardingSphereMetaData.class);
diff --git a/infra/parser/src/main/java/org/apache/shardingsphere/infra/parser/sql/SQLStatementParserExecutor.java b/infra/parser/src/main/java/org/apache/shardingsphere/infra/parser/sql/SQLStatementParserExecutor.java
index 830936fea52..dcc22d0fd03 100644
--- a/infra/parser/src/main/java/org/apache/shardingsphere/infra/parser/sql/SQLStatementParserExecutor.java
+++ b/infra/parser/src/main/java/org/apache/shardingsphere/infra/parser/sql/SQLStatementParserExecutor.java
@@ -53,6 +53,8 @@ public final class SQLStatementParserExecutor {
      * @return SQL statement
      */
     public SQLStatement parse(final String sql) {
-        return visitorEngine.visit(parserEngine.parse(sql, false));
+        SQLStatement result = visitorEngine.visit(parserEngine.parse(sql, false));
+        result.buildAttributes();
+        return result;
     }
 }
diff --git a/infra/route/core/src/test/java/org/apache/shardingsphere/infra/route/engine/tableless/TablelessRouteEngineFactoryTest.java b/infra/route/core/src/test/java/org/apache/shardingsphere/infra/route/engine/tableless/TablelessRouteEngineFactoryTest.java
index d406cac572d..e48052b768f 100644
--- a/infra/route/core/src/test/java/org/apache/shardingsphere/infra/route/engine/tableless/TablelessRouteEngineFactoryTest.java
+++ b/infra/route/core/src/test/java/org/apache/shardingsphere/infra/route/engine/tableless/TablelessRouteEngineFactoryTest.java
@@ -151,7 +151,9 @@ class TablelessRouteEngineFactoryTest {
     void assertNewInstanceForCloseAllStatement() {
         CursorHeldSQLStatementContext closeStatementContext = mock(CursorHeldSQLStatementContext.class, RETURNS_DEEP_STUBS);
         when(closeStatementContext.getTablesContext().getDatabaseName()).thenReturn(Optional.empty());
-        when(closeStatementContext.getSqlStatement()).thenReturn(new CloseStatement(databaseType, null, true));
+        CloseStatement closeStatement = new CloseStatement(databaseType, null, true);
+        closeStatement.buildAttributes();
+        when(closeStatementContext.getSqlStatement()).thenReturn(closeStatement);
         QueryContext queryContext = new QueryContext(closeStatementContext, "", Collections.emptyList(), new HintValueContext(), mockConnectionContext(), mock(ShardingSphereMetaData.class));
         TablelessRouteEngine actual = TablelessRouteEngineFactory.newInstance(queryContext, database);
         assertThat(actual, isA(TablelessDataSourceBroadcastRouteEngine.class));
diff --git a/kernel/single/core/src/test/java/org/apache/shardingsphere/single/route/SingleSQLRouterTest.java b/kernel/single/core/src/test/java/org/apache/shardingsphere/single/route/SingleSQLRouterTest.java
index 03e1763ca9a..5b846cc4e9e 100644
--- a/kernel/single/core/src/test/java/org/apache/shardingsphere/single/route/SingleSQLRouterTest.java
+++ b/kernel/single/core/src/test/java/org/apache/shardingsphere/single/route/SingleSQLRouterTest.java
@@ -213,6 +213,7 @@ class SingleSQLRouterTest {
         TableNameSegment tableNameSegment = new TableNameSegment(1, 2, new IdentifierValue("t_order"));
         tableNameSegment.setTableBoundInfo(new TableSegmentBoundInfo(new IdentifierValue("foo_db"), new IdentifierValue("foo_schema")));
         createTableStatement.setTable(new SimpleTableSegment(tableNameSegment));
+        createTableStatement.buildAttributes();
         ConnectionContext connectionContext = mock(ConnectionContext.class);
         when(connectionContext.getCurrentDatabaseName()).thenReturn(Optional.of("foo_db"));
         ShardingSphereMetaData metaData = mock(ShardingSphereMetaData.class);
diff --git a/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/LoadSingleTableExecutorTest.java b/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/LoadSingleTableExecutorTest.java
index 5e05b94f59d..96081eee489 100644
--- a/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/LoadSingleTableExecutorTest.java
+++ b/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/LoadSingleTableExecutorTest.java
@@ -100,6 +100,7 @@ class LoadSingleTableExecutorTest {
         when(schema.containsTable("foo_tbl")).thenReturn(true);
         when(database.getResourceMetaData().getNotExistedDataSources(any())).thenReturn(Collections.emptyList());
         LoadSingleTableStatement sqlStatement = new LoadSingleTableStatement(Collections.singleton(new SingleTableSegment("foo_ds", "foo_schema", "foo_tbl")));
+        sqlStatement.buildAttributes();
         assertThrows(InvalidDataNodeFormatException.class, () -> new DistSQLUpdateExecuteEngine(sqlStatement, "foo_db", mockContextManager(mock(SingleRule.class)), null).executeUpdate());
     }
     
@@ -109,6 +110,7 @@ class LoadSingleTableExecutorTest {
         when(database.getResourceMetaData().getNotExistedDataSources(any())).thenReturn(Collections.emptyList());
         LoadSingleTableStatement sqlStatement = new LoadSingleTableStatement(Arrays.asList(
                 new SingleTableSegment("*", "*"), new SingleTableSegment("*", "*", "*"), new SingleTableSegment("foo_ds", "*"), new SingleTableSegment("foo_ds", "foo_tbl")));
+        sqlStatement.buildAttributes();
         assertThrows(TableExistsException.class, () -> new DistSQLUpdateExecuteEngine(sqlStatement, "foo_db", mockContextManager(mock(SingleRule.class)), null).executeUpdate());
     }
     
@@ -120,6 +122,7 @@ class LoadSingleTableExecutorTest {
         when(database.getResourceMetaData().getStorageUnits()).thenReturn(Collections.singletonMap("foo_ds", storageUnit));
         when(PhysicalDataSourceAggregator.getAggregatedDataSources(any(), any())).thenReturn(Collections.singletonMap("foo_ds", new MockedDataSource()));
         LoadSingleTableStatement sqlStatement = new LoadSingleTableStatement(Collections.singleton(new SingleTableSegment("foo_ds", "foo_tbl")));
+        sqlStatement.buildAttributes();
         assertThrows(TableNotFoundException.class, () -> new DistSQLUpdateExecuteEngine(sqlStatement, "foo_db", mockContextManager(mock(SingleRule.class)), null).executeUpdate());
     }
     
@@ -134,6 +137,7 @@ class LoadSingleTableExecutorTest {
         when(SingleTableLoadUtils.convertToDataNodes(eq("foo_db"), any(), any())).thenReturn(Collections.singleton(new DataNode("foo_ds.foo_tbl")));
         SingleRuleConfiguration currentConfig = new SingleRuleConfiguration(currentTables, null);
         LoadSingleTableStatement sqlStatement = new LoadSingleTableStatement(Collections.singleton(new SingleTableSegment("*", "bar_tbl")));
+        sqlStatement.buildAttributes();
         SingleRule rule = mock(SingleRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         ContextManager contextManager = mockContextManager(rule);
@@ -153,6 +157,7 @@ class LoadSingleTableExecutorTest {
         when(SingleTableLoadUtils.convertToDataNodes(eq("foo_db"), any(), any())).thenReturn(Collections.singleton(new DataNode("foo_ds.foo_tbl")));
         SingleRuleConfiguration currentConfig = new SingleRuleConfiguration(currentTables, null);
         LoadSingleTableStatement sqlStatement = new LoadSingleTableStatement(Collections.singleton(new SingleTableSegment("*", "bar_tbl")));
+        sqlStatement.buildAttributes();
         SingleRule rule = mock(SingleRule.class);
         when(rule.getConfiguration()).thenReturn(currentConfig);
         ContextManager contextManager = mockContextManager(null);
diff --git a/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/SetDefaultSingleTableStorageUnitExecutorTest.java b/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/SetDefaultSingleTableStorageUnitExecutorTest.java
index ed6d011c1c2..a6a38fb03a0 100644
--- a/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/SetDefaultSingleTableStorageUnitExecutorTest.java
+++ b/kernel/single/distsql/handler/src/test/java/org/apache/shardingsphere/single/distsql/handler/update/SetDefaultSingleTableStorageUnitExecutorTest.java
@@ -52,7 +52,9 @@ class SetDefaultSingleTableStorageUnitExecutorTest {
         when(database.getRuleMetaData().getAttributes(DataSourceMapperRuleAttribute.class)).thenReturn(Collections.emptyList());
         SingleRule rule = mock(SingleRule.class, RETURNS_DEEP_STUBS);
         when(rule.getAttributes().findAttribute(DataSourceMapperRuleAttribute.class)).thenReturn(Optional.empty());
-        DistSQLUpdateExecuteEngine engine = new DistSQLUpdateExecuteEngine(new SetDefaultSingleTableStorageUnitStatement("foo_ds"), "foo_db", mockContextManager(database, rule, "foo_ds"), null);
+        SetDefaultSingleTableStorageUnitStatement sqlStatement = new SetDefaultSingleTableStorageUnitStatement("foo_ds");
+        sqlStatement.buildAttributes();
+        DistSQLUpdateExecuteEngine engine = new DistSQLUpdateExecuteEngine(sqlStatement, "foo_db", mockContextManager(database, rule, "foo_ds"), null);
         assertThrows(MissingRequiredStorageUnitsException.class, engine::executeUpdate);
     }
     
@@ -62,7 +64,9 @@ class SetDefaultSingleTableStorageUnitExecutorTest {
         SingleRule rule = mock(SingleRule.class);
         when(rule.getConfiguration()).thenReturn(new SingleRuleConfiguration(Collections.emptyList(), "foo_ds"));
         ContextManager contextManager = mockContextManager(database, rule, null);
-        new DistSQLUpdateExecuteEngine(new SetDefaultSingleTableStorageUnitStatement(null), "foo_db", contextManager, null).executeUpdate();
+        SetDefaultSingleTableStorageUnitStatement sqlStatement = new SetDefaultSingleTableStorageUnitStatement(null);
+        sqlStatement.buildAttributes();
+        new DistSQLUpdateExecuteEngine(sqlStatement, "foo_db", contextManager, null).executeUpdate();
         MetaDataManagerPersistService metaDataManagerPersistService = contextManager.getPersistServiceFacade().getModeFacade().getMetaDataManagerService();
         verify(metaDataManagerPersistService).removeRuleConfigurationItem(any(), ArgumentMatchers.<SingleRuleConfiguration>argThat(x -> x.getDefaultDataSource().equals(Optional.of("foo_ds"))));
         verify(metaDataManagerPersistService).alterRuleConfiguration(any(), ArgumentMatchers.<SingleRuleConfiguration>argThat(x -> !x.getDefaultDataSource().isPresent()));
@@ -78,7 +82,9 @@ class SetDefaultSingleTableStorageUnitExecutorTest {
         when(rule.getConfiguration()).thenReturn(new SingleRuleConfiguration(Collections.emptyList(), "foo_ds"));
         when(rule.getAttributes().findAttribute(DataSourceMapperRuleAttribute.class)).thenReturn(Optional.empty());
         ContextManager contextManager = mockContextManager(database, rule, "bar_ds");
-        new DistSQLUpdateExecuteEngine(new SetDefaultSingleTableStorageUnitStatement("bar_ds"), "foo_db", contextManager, null).executeUpdate();
+        SetDefaultSingleTableStorageUnitStatement sqlStatement = new SetDefaultSingleTableStorageUnitStatement("bar_ds");
+        sqlStatement.buildAttributes();
+        new DistSQLUpdateExecuteEngine(sqlStatement, "foo_db", contextManager, null).executeUpdate();
         MetaDataManagerPersistService metaDataManagerPersistService = contextManager.getPersistServiceFacade().getModeFacade().getMetaDataManagerService();
         verify(metaDataManagerPersistService).alterRuleConfiguration(any(), ArgumentMatchers.<SingleRuleConfiguration>argThat(x -> x.getDefaultDataSource().equals(Optional.of("bar_ds"))));
     }
diff --git a/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/sql/ast/converter/statement/type/ExplainStatementConverterTest.java b/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/sql/ast/converter/statement/type/ExplainStatementConverterTest.java
index 931e09fda10..63613fdbecf 100644
--- a/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/sql/ast/converter/statement/type/ExplainStatementConverterTest.java
+++ b/kernel/sql-federation/compiler/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/sql/ast/converter/statement/type/ExplainStatementConverterTest.java
@@ -31,13 +31,14 @@ import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.simp
 import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table.SimpleTableSegment;
 import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table.TableNameSegment;
 import org.apache.shardingsphere.sql.parser.statement.core.value.identifier.IdentifierValue;
-import org.apache.shardingsphere.sql.parser.statement.core.statement.SQLStatement;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.ExplainStatement;
+import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dcl.DCLStatement;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.DeleteStatement;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.InsertStatement;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.SelectStatement;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.UpdateStatement;
 import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
 
 import java.util.Collections;
 
@@ -79,8 +80,9 @@ class ExplainStatementConverterTest {
     
     @Test
     void assertConvertUnsupportedSQLStatementThrowsException() {
-        ExplainStatement explainStatement = new ExplainStatement(databaseType, new SQLStatement(databaseType) {
-        });
+        DCLStatement mockStatement = Mockito.mock(DCLStatement.class, Mockito.withSettings().defaultAnswer(Mockito.CALLS_REAL_METHODS));
+        Mockito.when(mockStatement.getDatabaseType()).thenReturn(databaseType);
+        ExplainStatement explainStatement = new ExplainStatement(databaseType, mockStatement);
         assertThrows(IllegalStateException.class, () -> new ExplainStatementConverter().convert(explainStatement));
     }
     
diff --git a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/federation/FederationMetaDataRefreshEngineTest.java b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/federation/FederationMetaDataRefreshEngineTest.java
index 136d6e7f892..1c8907a0c27 100644
--- a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/federation/FederationMetaDataRefreshEngineTest.java
+++ b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/federation/FederationMetaDataRefreshEngineTest.java
@@ -24,8 +24,10 @@ import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
 import org.apache.shardingsphere.mode.metadata.refresher.util.SchemaRefreshUtils;
 import org.apache.shardingsphere.mode.persist.service.MetaDataManagerPersistService;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.SQLStatement;
+import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.DMLStatement;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.DeleteStatement;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.InsertStatement;
+import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.UpdateStatement;
 import org.apache.shardingsphere.test.infra.framework.extension.mock.AutoMockExtension;
 import org.apache.shardingsphere.test.infra.framework.extension.mock.StaticMockSettings;
 import org.junit.jupiter.api.Test;
@@ -57,9 +59,9 @@ class FederationMetaDataRefreshEngineTest {
     
     @Test
     void assertIsNeedRefreshWhenRefresherAbsent() {
-        when(sqlStatementContext.getSqlStatement()).thenReturn(new SQLStatement(databaseType));
-        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, SQLStatement.class)).thenReturn(Optional.empty());
-        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, Object.class)).thenReturn(Optional.empty());
+        when(sqlStatementContext.getSqlStatement()).thenReturn(new UpdateStatement(databaseType));
+        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, UpdateStatement.class)).thenReturn(Optional.empty());
+        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, DMLStatement.class)).thenReturn(Optional.empty());
         assertFalse(new FederationMetaDataRefreshEngine(sqlStatementContext).isNeedRefresh());
     }
     
@@ -77,10 +79,10 @@ class FederationMetaDataRefreshEngineTest {
     @SuppressWarnings("unchecked")
     @Test
     void assertIsNeedRefreshWhenRefresherFoundFromExactClass() {
-        SQLStatement sqlStatement = new SQLStatement(databaseType);
+        SQLStatement sqlStatement = mock(SQLStatement.class);
         when(sqlStatementContext.getSqlStatement()).thenReturn(sqlStatement);
         FederationMetaDataRefresher<SQLStatement> refresher = mock(FederationMetaDataRefresher.class);
-        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, SQLStatement.class)).thenReturn(Optional.of(refresher));
+        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, sqlStatement.getClass())).thenReturn(Optional.of(refresher));
         assertTrue(new FederationMetaDataRefreshEngine(sqlStatementContext).isNeedRefresh());
     }
     
@@ -96,10 +98,11 @@ class FederationMetaDataRefreshEngineTest {
     @SuppressWarnings("unchecked")
     @Test
     void assertRefresh() {
-        SQLStatement sqlStatement = new SQLStatement(databaseType);
+        SQLStatement sqlStatement = mock(SQLStatement.class);
+        when(sqlStatement.getDatabaseType()).thenReturn(databaseType);
         when(sqlStatementContext.getSqlStatement()).thenReturn(sqlStatement);
         FederationMetaDataRefresher<SQLStatement> refresher = mock(FederationMetaDataRefresher.class);
-        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, SQLStatement.class)).thenReturn(Optional.of(refresher));
+        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, sqlStatement.getClass())).thenReturn(Optional.of(refresher));
         when(SchemaRefreshUtils.getSchemaName(database, sqlStatementContext)).thenReturn("foo_schema");
         new FederationMetaDataRefreshEngine(sqlStatementContext).refresh(metaDataManagerPersistService, database);
         verify(refresher).refresh(metaDataManagerPersistService, databaseType, database, "foo_schema", sqlStatement);
@@ -119,10 +122,9 @@ class FederationMetaDataRefreshEngineTest {
     
     @Test
     void assertRefreshThrowsNullPointerExceptionWhenRefresherIsNull() {
-        SQLStatement sqlStatement = new SQLStatement(databaseType);
-        when(sqlStatementContext.getSqlStatement()).thenReturn(sqlStatement);
-        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, SQLStatement.class)).thenReturn(Optional.empty());
-        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, Object.class)).thenReturn(Optional.empty());
+        when(sqlStatementContext.getSqlStatement()).thenReturn(new UpdateStatement(databaseType));
+        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, UpdateStatement.class)).thenReturn(Optional.empty());
+        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, DMLStatement.class)).thenReturn(Optional.empty());
         FederationMetaDataRefreshEngine engine = new FederationMetaDataRefreshEngine(sqlStatementContext);
         assertThrows(NullPointerException.class, () -> engine.refresh(metaDataManagerPersistService, database));
     }
@@ -130,10 +132,11 @@ class FederationMetaDataRefreshEngineTest {
     @SuppressWarnings("unchecked")
     @Test
     void assertRefreshMultipleTimesWithSameStatement() {
-        SQLStatement sqlStatement = new SQLStatement(databaseType);
+        SQLStatement sqlStatement = mock(SQLStatement.class);
+        when(sqlStatement.getDatabaseType()).thenReturn(databaseType);
         when(sqlStatementContext.getSqlStatement()).thenReturn(sqlStatement);
         FederationMetaDataRefresher<SQLStatement> refresher = mock(FederationMetaDataRefresher.class);
-        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, SQLStatement.class)).thenReturn(Optional.of(refresher));
+        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, sqlStatement.getClass())).thenReturn(Optional.of(refresher));
         when(SchemaRefreshUtils.getSchemaName(database, sqlStatementContext)).thenReturn("foo_schema");
         FederationMetaDataRefreshEngine engine = new FederationMetaDataRefreshEngine(sqlStatementContext);
         engine.refresh(metaDataManagerPersistService, database);
@@ -144,10 +147,10 @@ class FederationMetaDataRefreshEngineTest {
     @SuppressWarnings("unchecked")
     @Test
     void assertIsNeedRefreshWhenRefresherFoundForBothClassAndSuperClass() {
-        SQLStatement sqlStatement = new SQLStatement(databaseType);
+        SQLStatement sqlStatement = mock(SQLStatement.class);
         when(sqlStatementContext.getSqlStatement()).thenReturn(sqlStatement);
         FederationMetaDataRefresher<SQLStatement> classRefresher = mock(FederationMetaDataRefresher.class);
-        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, SQLStatement.class)).thenReturn(Optional.of(classRefresher));
+        when(TypedSPILoader.findService(FederationMetaDataRefresher.class, sqlStatement.getClass())).thenReturn(Optional.of(classRefresher));
         FederationMetaDataRefreshEngine engine = new FederationMetaDataRefreshEngine(sqlStatementContext);
         assertTrue(engine.isNeedRefresh());
     }
diff --git a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/pushdown/PushDownMetaDataRefreshEngineTest.java b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/pushdown/PushDownMetaDataRefreshEngineTest.java
index 84c8c50d54a..1cf09943de9 100644
--- a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/pushdown/PushDownMetaDataRefreshEngineTest.java
+++ b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/pushdown/PushDownMetaDataRefreshEngineTest.java
@@ -29,6 +29,7 @@ import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
 import org.apache.shardingsphere.mode.metadata.refresher.util.SchemaRefreshUtils;
 import org.apache.shardingsphere.mode.persist.service.MetaDataManagerPersistService;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.SQLStatement;
+import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.UpdateStatement;
 import org.apache.shardingsphere.test.infra.framework.extension.mock.AutoMockExtension;
 import org.apache.shardingsphere.test.infra.framework.extension.mock.StaticMockSettings;
 import org.junit.jupiter.api.Test;
@@ -63,7 +64,7 @@ class PushDownMetaDataRefreshEngineTest {
     
     @Test
     void assertIsNeedRefreshWhenRefresherAbsent() {
-        SQLStatement sqlStatement = new SQLStatement(databaseType);
+        SQLStatement sqlStatement = new UpdateStatement(databaseType);
         when(sqlStatementContext.getSqlStatement()).thenReturn(sqlStatement);
         when(TypedSPILoader.findService(PushDownMetaDataRefresher.class, sqlStatement.getClass())).thenReturn(Optional.empty());
         when(TypedSPILoader.findService(PushDownMetaDataRefresher.class, sqlStatement.getClass().getSuperclass())).thenReturn(Optional.empty());
@@ -73,7 +74,7 @@ class PushDownMetaDataRefreshEngineTest {
     @SuppressWarnings("unchecked")
     @Test
     void assertIsNeedRefreshWhenRefresherFound() {
-        SQLStatement sqlStatement = new SQLStatement(databaseType);
+        SQLStatement sqlStatement = new UpdateStatement(databaseType);
         when(sqlStatementContext.getSqlStatement()).thenReturn(sqlStatement);
         PushDownMetaDataRefresher<SQLStatement> refresher = mock(PushDownMetaDataRefresher.class);
         when(TypedSPILoader.findService(PushDownMetaDataRefresher.class, sqlStatement.getClass())).thenReturn(Optional.of(refresher));
@@ -84,7 +85,7 @@ class PushDownMetaDataRefreshEngineTest {
     @Test
     void assertRefreshUsesStorageUnitTypeAndLogicDataSource() throws SQLException {
         when(SchemaRefreshUtils.getSchemaName(database, sqlStatementContext)).thenReturn("foo_schema");
-        SQLStatement sqlStatement = new SQLStatement(databaseType);
+        SQLStatement sqlStatement = new UpdateStatement(databaseType);
         when(sqlStatementContext.getSqlStatement()).thenReturn(sqlStatement);
         StorageUnit storageUnit = mock(StorageUnit.class);
         DatabaseType storageType = mock(DatabaseType.class);
@@ -103,7 +104,7 @@ class PushDownMetaDataRefreshEngineTest {
     @Test
     void assertRefreshUsesStatementDatabaseTypeWhenRouteUnitsAbsent() throws SQLException {
         when(SchemaRefreshUtils.getSchemaName(database, sqlStatementContext)).thenReturn("foo_schema");
-        SQLStatement sqlStatement = new SQLStatement(databaseType);
+        SQLStatement sqlStatement = new UpdateStatement(databaseType);
         when(sqlStatementContext.getSqlStatement()).thenReturn(sqlStatement);
         ConfigurationProperties props = new ConfigurationProperties(new Properties());
         PushDownMetaDataRefresher<SQLStatement> refresher = mock(PushDownMetaDataRefresher.class);
diff --git a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/pushdown/type/index/CreateIndexPushDownMetaDataRefresherTest.java b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/pushdown/type/index/CreateIndexPushDownMetaDataRefresherTest.java
index ba01e475f1b..5daac44f5d8 100644
--- a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/pushdown/type/index/CreateIndexPushDownMetaDataRefresherTest.java
+++ b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/pushdown/type/index/CreateIndexPushDownMetaDataRefresherTest.java
@@ -83,12 +83,14 @@ class CreateIndexPushDownMetaDataRefresherTest {
         result.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("foo_tbl"))));
         result.setIndex(new IndexSegment(0, 0, new IndexNameSegment(0, 0, new IdentifierValue("idx_foo"))));
         result.getColumns().add(new ColumnSegment(0, 0, new IdentifierValue("order_id")));
+        result.buildAttributes();
         return result;
     }
     
     @Test
     void assertRefreshThrowsWhenIndexCountInvalid() {
         CreateIndexStatement sqlStatement = new CreateIndexStatement(databaseType);
+        sqlStatement.buildAttributes();
         assertThrows(IllegalArgumentException.class, () -> refresher.refresh(metaDataManagerPersistService,
                 createDatabase(Collections.emptyList()), "logic_ds", "foo_schema", databaseType, sqlStatement, new ConfigurationProperties(new Properties())));
         verifyNoInteractions(metaDataManagerPersistService);
diff --git a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/util/SchemaRefreshUtilsTest.java b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/util/SchemaRefreshUtilsTest.java
index d9cfba25c8d..698e7a49bd8 100644
--- a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/util/SchemaRefreshUtilsTest.java
+++ b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/refresher/util/SchemaRefreshUtilsTest.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.infra.binder.context.segment.table.TablesContex
 import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext;
 import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
-import org.apache.shardingsphere.sql.parser.statement.core.statement.SQLStatement;
+import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.DeleteStatement;
 import org.junit.jupiter.api.Test;
 
 import java.util.Optional;
@@ -49,7 +49,7 @@ class SchemaRefreshUtilsTest {
         when(tablesContext.getSchemaName()).thenReturn(Optional.empty());
         SQLStatementContext sqlStatementContext = mock(SQLStatementContext.class);
         when(sqlStatementContext.getTablesContext()).thenReturn(tablesContext);
-        when(sqlStatementContext.getSqlStatement()).thenReturn(new SQLStatement(TypedSPILoader.getService(DatabaseType.class, "FIXTURE")));
+        when(sqlStatementContext.getSqlStatement()).thenReturn(new DeleteStatement(TypedSPILoader.getService(DatabaseType.class, "FIXTURE")));
         ShardingSphereDatabase database = mock(ShardingSphereDatabase.class);
         when(database.getName()).thenReturn("FOO_DB");
         assertThat(SchemaRefreshUtils.getSchemaName(database, sqlStatementContext), is("foo_db"));
diff --git a/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/featured/DistSQLParserEngine.java b/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/featured/DistSQLParserEngine.java
index 41928224193..3d90a9e1d6f 100644
--- a/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/featured/DistSQLParserEngine.java
+++ b/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/featured/DistSQLParserEngine.java
@@ -58,6 +58,8 @@ public final class DistSQLParserEngine {
             throw new SQLParsingException(sql);
         }
         SQLVisitor visitor = facade.getVisitorClass().getDeclaredConstructor().newInstance();
-        return (SQLStatement) visitor.visit(parseASTNode.getRootNode());
+        SQLStatement result = (SQLStatement) visitor.visit(parseASTNode.getRootNode());
+        result.buildAttributes();
+        return result;
     }
 }
diff --git a/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementParserEngine.java b/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementParserEngine.java
index db18278cbfc..7f12a9d9348 100644
--- a/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementParserEngine.java
+++ b/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementParserEngine.java
@@ -37,7 +37,9 @@ public final class KernelDistSQLStatementParserEngine {
      */
     public SQLStatement parse(final String sql) {
         ASTNode astNode = SQLParserFactory.newInstance(sql, KernelDistSQLLexer.class, KernelDistSQLParser.class).parse();
-        return getSQLStatement(sql, (ParseASTNode) astNode);
+        SQLStatement result = getSQLStatement(sql, (ParseASTNode) astNode);
+        result.buildAttributes();
+        return result;
     }
     
     private SQLStatement getSQLStatement(final String sql, final ParseASTNode parseASTNode) {
diff --git a/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/ral/queryable/export/ExportDatabaseConfigurationStatement.java b/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/ral/queryable/export/ExportDatabaseConfigurationStatement.java
index b0c443ffca6..373d99347a8 100644
--- a/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/ral/queryable/export/ExportDatabaseConfigurationStatement.java
+++ b/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/ral/queryable/export/ExportDatabaseConfigurationStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.distsql.statement.type.ral.queryable.export;
 
+import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.distsql.statement.type.ral.queryable.QueryableRALStatement;
 import org.apache.shardingsphere.sql.parser.statement.core.segment.dal.FromDatabaseSegment;
@@ -35,6 +36,9 @@ public final class ExportDatabaseConfigurationStatement extends QueryableRALStat
     
     private final FromDatabaseSegment fromDatabase;
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     /**
      * Get file path.
      *
@@ -45,7 +49,7 @@ public final class ExportDatabaseConfigurationStatement extends QueryableRALStat
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
     }
 }
diff --git a/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/ral/queryable/show/ShowTableMetaDataStatement.java b/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/ral/queryable/show/ShowTableMetaDataStatement.java
index 91134b2da01..5e7b9f75be9 100644
--- a/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/ral/queryable/show/ShowTableMetaDataStatement.java
+++ b/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/ral/queryable/show/ShowTableMetaDataStatement.java
@@ -37,8 +37,10 @@ public final class ShowTableMetaDataStatement extends QueryableRALStatement {
     
     private final FromDatabaseSegment fromDatabase;
     
+    private SQLStatementAttributes attributes;
+    
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
     }
 }
diff --git a/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/resource/ShowStorageUnitsStatement.java b/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/resource/ShowStorageUnitsStatement.java
index de73aa47534..c78d2ecf125 100644
--- a/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/resource/ShowStorageUnitsStatement.java
+++ b/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/resource/ShowStorageUnitsStatement.java
@@ -36,6 +36,8 @@ public final class ShowStorageUnitsStatement extends ResourceQueryStatement {
     
     private final String likePattern;
     
+    private SQLStatementAttributes attributes;
+    
     /**
      * Get like pattern.
      *
@@ -46,7 +48,7 @@ public final class ShowStorageUnitsStatement extends ResourceQueryStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
     }
 }
diff --git a/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/resource/ShowTablesStatement.java b/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/resource/ShowTablesStatement.java
index abf7e995101..1e528ca452d 100644
--- a/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/resource/ShowTablesStatement.java
+++ b/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/resource/ShowTablesStatement.java
@@ -36,6 +36,8 @@ public abstract class ShowTablesStatement extends ResourceQueryStatement {
     
     private final String likePattern;
     
+    private SQLStatementAttributes attributes;
+    
     /**
      * Get like pattern.
      *
@@ -46,7 +48,7 @@ public abstract class ShowTablesStatement extends ResourceQueryStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
     }
 }
diff --git a/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/rule/database/ShowDatabaseRulesStatement.java b/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/rule/database/ShowDatabaseRulesStatement.java
index 4ffc988ad88..3098fab0fab 100644
--- a/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/rule/database/ShowDatabaseRulesStatement.java
+++ b/parser/distsql/statement/src/main/java/org/apache/shardingsphere/distsql/statement/type/rql/rule/database/ShowDatabaseRulesStatement.java
@@ -33,8 +33,10 @@ public abstract class ShowDatabaseRulesStatement extends RuleQueryStatement {
     
     private final FromDatabaseSegment fromDatabase;
     
+    private SQLStatementAttributes attributes;
+    
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/SQLStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/SQLStatement.java
index 81d80803998..e777220a598 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/SQLStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/SQLStatement.java
@@ -47,6 +47,8 @@ public class SQLStatement implements ASTNode {
     
     private final DatabaseType databaseType;
     
+    private SQLStatementAttributes attributes;
+    
     /**
      * Get count of parameters.
      *
@@ -68,12 +70,22 @@ public class SQLStatement implements ASTNode {
         }
     }
     
+    /**
+     * Build SQL statement attributes.
+     */
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes();
+    }
+    
     /**
      * Get SQL statement attributes.
      *
      * @return SQL statement attributes
      */
     public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes();
+        if (null == attributes) {
+            buildAttributes();
+        }
+        return attributes;
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/AnalyzeTableStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/AnalyzeTableStatement.java
index 2b05ae97fd2..45d9d24ec16 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/AnalyzeTableStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/AnalyzeTableStatement.java
@@ -34,13 +34,15 @@ public final class AnalyzeTableStatement extends DALStatement {
     
     private final Collection<SimpleTableSegment> tables;
     
+    private SQLStatementAttributes attributes;
+    
     public AnalyzeTableStatement(final DatabaseType databaseType, final Collection<SimpleTableSegment> tables) {
         super(databaseType);
         this.tables = tables;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(tables), new TableBroadcastRouteSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(tables), new TableBroadcastRouteSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/ExplainStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/ExplainStatement.java
index 61ed8042431..cba1ea2f4ff 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/ExplainStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/ExplainStatement.java
@@ -32,16 +32,18 @@ public final class ExplainStatement extends DALStatement {
     
     private final SQLStatement explainableSQLStatement;
     
+    private SQLStatementAttributes attributes;
+    
     public ExplainStatement(final DatabaseType databaseType, final SQLStatement explainableSQLStatement) {
         super(databaseType);
         this.explainableSQLStatement = explainableSQLStatement;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
+    public void buildAttributes() {
         TableExtractor extractor = new TableExtractor();
         // TODO extract table from declare, execute, createMaterializedView, refreshMaterializedView
         extractor.extractTablesFromSQLStatement(explainableSQLStatement);
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(extractor.getRewriteTables()));
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(extractor.getRewriteTables()));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/SetStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/SetStatement.java
index a04275afce3..29eb9ece478 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/SetStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dal/SetStatement.java
@@ -33,13 +33,15 @@ public final class SetStatement extends DALStatement {
     
     private final List<VariableAssignSegment> variableAssigns;
     
+    private SQLStatementAttributes attributes;
+    
     public SetStatement(final DatabaseType databaseType, final List<VariableAssignSegment> variableAssigns) {
         super(databaseType);
         this.variableAssigns = variableAssigns;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dcl/GrantStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dcl/GrantStatement.java
index d0772403c06..618e899cabd 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dcl/GrantStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dcl/GrantStatement.java
@@ -34,12 +34,14 @@ public class GrantStatement extends DCLStatement {
     
     private final Collection<SimpleTableSegment> tables = new LinkedList<>();
     
+    private SQLStatementAttributes attributes;
+    
     public GrantStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dcl/RevokeStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dcl/RevokeStatement.java
index 5223a720b7c..a9da26205b4 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dcl/RevokeStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dcl/RevokeStatement.java
@@ -34,12 +34,14 @@ public class RevokeStatement extends DCLStatement {
     
     private final Collection<SimpleTableSegment> tables = new LinkedList<>();
     
+    private SQLStatementAttributes attributes;
+    
     public RevokeStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CloseStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CloseStatement.java
index 6b9a59ee18f..ef8d4ad0b44 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CloseStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CloseStatement.java
@@ -33,6 +33,8 @@ public final class CloseStatement extends DDLStatement {
     
     private final boolean closeAll;
     
+    private SQLStatementAttributes attributes;
+    
     public CloseStatement(final DatabaseType databaseType, final CursorNameSegment cursorName, final boolean closeAll) {
         super(databaseType);
         this.cursorName = cursorName;
@@ -40,7 +42,7 @@ public final class CloseStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new CursorSQLStatementAttribute(cursorName));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new CursorSQLStatementAttribute(cursorName));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CommentStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CommentStatement.java
index 587cc486ade..3f8be4c987d 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CommentStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CommentStatement.java
@@ -45,6 +45,8 @@ public final class CommentStatement extends DDLStatement {
     
     private IndexTypeSegment indexType;
     
+    private SQLStatementAttributes attributes;
+    
     public CommentStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -59,7 +61,7 @@ public final class CommentStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(null == table ? Collections.emptyList() : Collections.singletonList(table)));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(null == table ? Collections.emptyList() : Collections.singletonList(table)));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CursorStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CursorStatement.java
index 701c87ee2af..057e0fad0e7 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CursorStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/CursorStatement.java
@@ -34,6 +34,8 @@ public final class CursorStatement extends DDLStatement {
     
     private final SelectStatement select;
     
+    private SQLStatementAttributes attributes;
+    
     public CursorStatement(final DatabaseType databaseType, final CursorNameSegment cursorName, final SelectStatement select) {
         super(databaseType);
         this.cursorName = cursorName;
@@ -41,7 +43,7 @@ public final class CursorStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new CursorSQLStatementAttribute(cursorName));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new CursorSQLStatementAttribute(cursorName));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/FetchStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/FetchStatement.java
index a38c4095fa8..d12dddacc37 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/FetchStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/FetchStatement.java
@@ -36,6 +36,8 @@ public final class FetchStatement extends DDLStatement {
     
     private final DirectionSegment direction;
     
+    private SQLStatementAttributes attributes;
+    
     public FetchStatement(final DatabaseType databaseType, final CursorNameSegment cursorName, final DirectionSegment direction) {
         super(databaseType);
         this.cursorName = cursorName;
@@ -52,7 +54,7 @@ public final class FetchStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new CursorSQLStatementAttribute(cursorName));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new CursorSQLStatementAttribute(cursorName));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/MoveStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/MoveStatement.java
index 724fb36d474..a68ace42f93 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/MoveStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/MoveStatement.java
@@ -36,6 +36,8 @@ public final class MoveStatement extends DDLStatement {
     
     private final DirectionSegment direction;
     
+    private SQLStatementAttributes attributes;
+    
     public MoveStatement(final DatabaseType databaseType, final CursorNameSegment cursorName, final DirectionSegment direction) {
         super(databaseType);
         this.cursorName = cursorName;
@@ -52,7 +54,7 @@ public final class MoveStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new CursorSQLStatementAttribute(cursorName));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new CursorSQLStatementAttribute(cursorName));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/PrepareStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/PrepareStatement.java
index db33fc778d5..71a51c1d06c 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/PrepareStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/PrepareStatement.java
@@ -45,6 +45,8 @@ public final class PrepareStatement extends DDLStatement {
     
     private DeleteStatement delete;
     
+    private SQLStatementAttributes attributes;
+    
     public PrepareStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -86,12 +88,12 @@ public final class PrepareStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
+    public void buildAttributes() {
         TableExtractor tableExtractor = new TableExtractor();
         Optional.ofNullable(select).ifPresent(tableExtractor::extractTablesFromSelect);
         Optional.ofNullable(insert).ifPresent(tableExtractor::extractTablesFromInsert);
         Optional.ofNullable(update).ifPresent(tableExtractor::extractTablesFromUpdate);
         Optional.ofNullable(delete).ifPresent(tableExtractor::extractTablesFromDelete);
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(tableExtractor.getRewriteTables()));
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(tableExtractor.getRewriteTables()));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/TruncateStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/TruncateStatement.java
index 5f788fbbc3f..bf7449caca2 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/TruncateStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/TruncateStatement.java
@@ -33,13 +33,15 @@ public final class TruncateStatement extends DDLStatement {
     
     private final Collection<SimpleTableSegment> tables;
     
+    private SQLStatementAttributes attributes;
+    
     public TruncateStatement(final DatabaseType databaseType, final Collection<SimpleTableSegment> tables) {
         super(databaseType);
         this.tables = tables;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/function/CreateFunctionStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/function/CreateFunctionStatement.java
index 8dd3995debb..db648b1c164 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/function/CreateFunctionStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/function/CreateFunctionStatement.java
@@ -46,6 +46,8 @@ public class CreateFunctionStatement extends DDLStatement {
     
     private final List<ExpressionSegment> dynamicSqlStatementExpressions = new ArrayList<>();
     
+    private SQLStatementAttributes attributes;
+    
     public CreateFunctionStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -69,8 +71,8 @@ public class CreateFunctionStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(
                 new TableSQLStatementAttribute(getRoutineBody().map(optional -> new TableExtractor().extractExistTableFromRoutineBody(optional)).orElseGet(Collections::emptyList)));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/AlterIndexStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/AlterIndexStatement.java
index 004d533ed76..70fac4775f8 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/AlterIndexStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/AlterIndexStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.index;
 
+import lombok.Getter;
 import lombok.Setter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.index.IndexSegment;
@@ -44,6 +45,9 @@ public final class AlterIndexStatement extends DDLStatement {
     
     private SimpleTableSegment simpleTable;
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public AlterIndexStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -76,8 +80,8 @@ public final class AlterIndexStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(simpleTable), new AlterIndexIndexSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(simpleTable), new AlterIndexIndexSQLStatementAttribute());
     }
     
     private class AlterIndexIndexSQLStatementAttribute implements IndexSQLStatementAttribute {
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/BuildIndexStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/BuildIndexStatement.java
index f0183cc5bf9..0955fb7b731 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/BuildIndexStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/BuildIndexStatement.java
@@ -46,13 +46,15 @@ public final class BuildIndexStatement extends DDLStatement {
     
     private final Collection<PartitionSegment> partitions = new LinkedList<>();
     
+    private SQLStatementAttributes attributes;
+    
     public BuildIndexStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(table), new BuildIndexIndexSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(table), new BuildIndexIndexSQLStatementAttribute());
     }
     
     private class BuildIndexIndexSQLStatementAttribute implements IndexSQLStatementAttribute {
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/CancelBuildIndexStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/CancelBuildIndexStatement.java
index f69a4e5012a..305725237bd 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/CancelBuildIndexStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/CancelBuildIndexStatement.java
@@ -39,12 +39,14 @@ public final class CancelBuildIndexStatement extends DDLStatement {
     
     private final List<String> jobIds = new LinkedList<>();
     
+    private SQLStatementAttributes attributes;
+    
     public CancelBuildIndexStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(table));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(table));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/CreateIndexStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/CreateIndexStatement.java
index 22e8379d9f9..621959c10ce 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/CreateIndexStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/CreateIndexStatement.java
@@ -66,6 +66,8 @@ public final class CreateIndexStatement extends DDLStatement {
     
     private String comment;
     
+    private SQLStatementAttributes attributes;
+    
     public CreateIndexStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -98,8 +100,8 @@ public final class CreateIndexStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(table), new CreateIndexIndexSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(table), new CreateIndexIndexSQLStatementAttribute());
     }
     
     private class CreateIndexIndexSQLStatementAttribute implements IndexSQLStatementAttribute {
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/DropIndexStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/DropIndexStatement.java
index 4a1a761b299..9ce52d34ed7 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/DropIndexStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/index/DropIndexStatement.java
@@ -52,6 +52,8 @@ public final class DropIndexStatement extends DDLStatement {
     
     private LockTableSegment lockTable;
     
+    private SQLStatementAttributes attributes;
+    
     public DropIndexStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -84,8 +86,8 @@ public final class DropIndexStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(simpleTable), new DropIndexIndexSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(simpleTable), new DropIndexIndexSQLStatementAttribute());
     }
     
     private class DropIndexIndexSQLStatementAttribute implements IndexSQLStatementAttribute {
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/AlterTableStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/AlterTableStatement.java
index 7b2b4d80e61..adcf04cfaad 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/AlterTableStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/AlterTableStatement.java
@@ -104,6 +104,8 @@ public final class AlterTableStatement extends DDLStatement {
     
     private final Collection<RenamePartitionDefinitionSegment> renamePartitionDefinitions = new LinkedList<>();
     
+    private SQLStatementAttributes attributes;
+    
     public AlterTableStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -163,8 +165,8 @@ public final class AlterTableStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(getTables()), new AlterTableConstraintSQLStatementAttribute(), new AlterTableIndexSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(getTables()), new AlterTableConstraintSQLStatementAttribute(), new AlterTableIndexSQLStatementAttribute());
     }
     
     private Collection<SimpleTableSegment> getTables() {
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/CreateTableStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/CreateTableStatement.java
index 8131312eb55..32f227e2145 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/CreateTableStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/CreateTableStatement.java
@@ -63,6 +63,8 @@ public final class CreateTableStatement extends DDLStatement {
     
     private final List<ColumnSegment> columns = new LinkedList<>();
     
+    private SQLStatementAttributes attributes;
+    
     public CreateTableStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -95,8 +97,8 @@ public final class CreateTableStatement extends DDLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(getTables()), new CreateTableConstraintSQLStatementAttribute(), new CreateTableIndexSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(getTables()), new CreateTableConstraintSQLStatementAttribute(), new CreateTableIndexSQLStatementAttribute());
     }
     
     private Collection<SimpleTableSegment> getTables() {
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/DropTableStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/DropTableStatement.java
index 8195c3a125f..b07d790f050 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/DropTableStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/DropTableStatement.java
@@ -41,12 +41,14 @@ public final class DropTableStatement extends DDLStatement {
     
     private boolean containsCascade;
     
+    private SQLStatementAttributes attributes;
+    
     public DropTableStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/RenameTableStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/RenameTableStatement.java
index 784101645e7..463d8c8ab24 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/RenameTableStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/table/RenameTableStatement.java
@@ -36,18 +36,20 @@ public final class RenameTableStatement extends DDLStatement {
     
     private final Collection<RenameTableDefinitionSegment> renameTables;
     
+    private SQLStatementAttributes attributes;
+    
     public RenameTableStatement(final DatabaseType databaseType, final Collection<RenameTableDefinitionSegment> renameTables) {
         super(databaseType);
         this.renameTables = renameTables;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
+    public void buildAttributes() {
         Collection<SimpleTableSegment> tables = new LinkedList<>();
         for (RenameTableDefinitionSegment each : renameTables) {
             tables.add(each.getTable());
             tables.add(each.getRenameTable());
         }
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/view/DropViewStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/view/DropViewStatement.java
index 5cc2c9a6fb1..1c8acd55127 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/view/DropViewStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/ddl/view/DropViewStatement.java
@@ -39,12 +39,14 @@ public final class DropViewStatement extends DDLStatement {
     
     private boolean ifExists;
     
+    private SQLStatementAttributes attributes;
+    
     public DropViewStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(views));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(views));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/DeleteStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/DeleteStatement.java
index 8b0dfe02579..4ffd33e90a0 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/DeleteStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/DeleteStatement.java
@@ -53,6 +53,8 @@ public final class DeleteStatement extends DMLStatement {
     
     private OutputSegment output;
     
+    private SQLStatementAttributes attributes;
+    
     public DeleteStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -112,7 +114,7 @@ public final class DeleteStatement extends DMLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new WithSQLStatementAttribute(with));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new WithSQLStatementAttribute(with));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/InsertStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/InsertStatement.java
index cbc91315831..9644e2b89a6 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/InsertStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/InsertStatement.java
@@ -93,6 +93,8 @@ public final class InsertStatement extends DMLStatement {
     
     private final Collection<ColumnSegment> derivedInsertColumns = new LinkedList<>();
     
+    private SQLStatementAttributes attributes;
+    
     public InsertStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -251,7 +253,7 @@ public final class InsertStatement extends DMLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new WithSQLStatementAttribute(with));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new WithSQLStatementAttribute(with));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/MergeStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/MergeStatement.java
index 47752857dcb..f5f3cf8cd8a 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/MergeStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/MergeStatement.java
@@ -64,6 +64,8 @@ public final class MergeStatement extends DMLStatement {
     
     private Collection<MergeWhenAndThenSegment> whenAndThens = new LinkedList<>();
     
+    private SQLStatementAttributes attributes;
+    
     public MergeStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -123,7 +125,7 @@ public final class MergeStatement extends DMLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new WithSQLStatementAttribute(with));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new WithSQLStatementAttribute(with));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/SelectStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/SelectStatement.java
index 77ba22aa3c0..fa82ab269f7 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/SelectStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/SelectStatement.java
@@ -80,6 +80,8 @@ public final class SelectStatement extends DMLStatement {
     
     private WithTableHintSegment withTableHint;
     
+    private SQLStatementAttributes attributes;
+    
     public SelectStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -220,7 +222,7 @@ public final class SelectStatement extends DMLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new WithSQLStatementAttribute(with), new AllowNotUseDatabaseSQLStatementAttribute(null == from));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new WithSQLStatementAttribute(with), new AllowNotUseDatabaseSQLStatementAttribute(null == from));
     }
 }
diff --git a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/UpdateStatement.java b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/UpdateStatement.java
index ee807926d7e..b34d417e1aa 100644
--- a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/UpdateStatement.java
+++ b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/statement/type/dml/UpdateStatement.java
@@ -66,6 +66,8 @@ public final class UpdateStatement extends DMLStatement {
     
     private OutputSegment output;
     
+    private SQLStatementAttributes attributes;
+    
     public UpdateStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
@@ -170,7 +172,7 @@ public final class UpdateStatement extends DMLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new WithSQLStatementAttribute(with));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new WithSQLStatementAttribute(with));
     }
 }
diff --git a/parser/sql/statement/core/src/test/java/org/apache/shardingsphere/sql/parser/statement/core/util/MultiSQLSplitterTest.java b/parser/sql/statement/core/src/test/java/org/apache/shardingsphere/sql/parser/statement/core/util/MultiSQLSplitterTest.java
index a8d6af2061a..ce1c665f883 100644
--- a/parser/sql/statement/core/src/test/java/org/apache/shardingsphere/sql/parser/statement/core/util/MultiSQLSplitterTest.java
+++ b/parser/sql/statement/core/src/test/java/org/apache/shardingsphere/sql/parser/statement/core/util/MultiSQLSplitterTest.java
@@ -47,7 +47,7 @@ class MultiSQLSplitterTest {
     
     private static Stream<Arguments> provideHasSameTypeArguments() {
         return Stream.of(
-                Arguments.of("nonDmlSample", new SQLStatement(DATABASE_TYPE), Arrays.asList("select * from t_order;", "select * from t_order_item;"), false),
+                Arguments.of("nonDmlSample", new UpdateStatement(DATABASE_TYPE), Arrays.asList("select * from t_order;", "select * from t_order_item;"), false),
                 Arguments.of("singleStatementFalse", new UpdateStatement(DATABASE_TYPE), Collections.singletonList("update t_order set status='OK' where id=1"), false),
                 Arguments.of("insertWithBlockComment", new InsertStatement(DATABASE_TYPE),
                         Arrays.asList("   /*comment*/ INSERT INTO t_order VALUES (1);", "/*remark*/ insert into t_order values (2)"), true),
diff --git a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/show/DorisShowQueryStatsStatement.java b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/show/DorisShowQueryStatsStatement.java
index 63eb3711b16..a3e3286251b 100644
--- a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/show/DorisShowQueryStatsStatement.java
+++ b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/show/DorisShowQueryStatsStatement.java
@@ -45,6 +45,8 @@ public final class DorisShowQueryStatsStatement extends DALStatement {
     
     private final boolean verbose;
     
+    private SQLStatementAttributes attributes;
+    
     public DorisShowQueryStatsStatement(final DatabaseType databaseType, final DatabaseSegment database, final FromTableSegment fromTable, final boolean all, final boolean verbose) {
         super(databaseType);
         this.database = database;
@@ -81,10 +83,10 @@ public final class DorisShowQueryStatsStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
+    public void buildAttributes() {
         String databaseName = null == database ? null : database.getIdentifier().getValue();
         SimpleTableSegment table = null == fromTable ? null : fromTable.getTable();
-        return new SQLStatementAttributes(new DatabaseSelectRequiredSQLStatementAttribute(), new TableSQLStatementAttribute(table),
+        attributes = new SQLStatementAttributes(new DatabaseSelectRequiredSQLStatementAttribute(), new TableSQLStatementAttribute(table),
                 new TablelessDataSourceBroadcastRouteSQLStatementAttribute(), new AllowNotUseDatabaseSQLStatementAttribute(true, databaseName));
     }
 }
diff --git a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowConnectorsStatement.java b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowConnectorsStatement.java
index fc3cfc189b1..2ff445027ed 100644
--- a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowConnectorsStatement.java
+++ b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowConnectorsStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.hive.dal.show;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.TablelessDataSourceBroadcastRouteSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class HiveShowConnectorsStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public HiveShowConnectorsStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowFunctionsStatement.java b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowFunctionsStatement.java
index 8c18d75514e..18310ce6ea7 100644
--- a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowFunctionsStatement.java
+++ b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowFunctionsStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.hive.dal.show;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.TablelessDataSourceBroadcastRouteSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class HiveShowFunctionsStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public HiveShowFunctionsStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowMaterializedViewsStatement.java b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowMaterializedViewsStatement.java
index a1ad9060aaa..af2b32b1008 100644
--- a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowMaterializedViewsStatement.java
+++ b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowMaterializedViewsStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.hive.dal.show;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.TablelessDataSourceBroadcastRouteSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class HiveShowMaterializedViewsStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public HiveShowMaterializedViewsStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowPartitionsStatement.java b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowPartitionsStatement.java
index 20ba4559054..afba9fb262e 100644
--- a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowPartitionsStatement.java
+++ b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowPartitionsStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.hive.dal.show;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.TablelessDataSourceBroadcastRouteSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class HiveShowPartitionsStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public HiveShowPartitionsStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowTablesExtendedStatement.java b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowTablesExtendedStatement.java
index b4c0d94f5b2..80a013a67d6 100644
--- a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowTablesExtendedStatement.java
+++ b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowTablesExtendedStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.hive.dal.show;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.TablelessDataSourceBroadcastRouteSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class HiveShowTablesExtendedStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public HiveShowTablesExtendedStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowTblpropertiesStatement.java b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowTblpropertiesStatement.java
index 96fdbfadb0d..f64b81f1fe8 100644
--- a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowTblpropertiesStatement.java
+++ b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowTblpropertiesStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.hive.dal.show;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.TablelessDataSourceBroadcastRouteSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class HiveShowTblpropertiesStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public HiveShowTblpropertiesStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowViewsStatement.java b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowViewsStatement.java
index ad9026b2c5d..c37943f187d 100644
--- a/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowViewsStatement.java
+++ b/parser/sql/statement/dialect/hive/src/main/java/org/apache/shardingsphere/sql/parser/statement/hive/dal/show/HiveShowViewsStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.hive.dal.show;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.TablelessDataSourceBroadcastRouteSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class HiveShowViewsStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public HiveShowViewsStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLFlushStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLFlushStatement.java
index 0d42290f238..6e575987d6d 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLFlushStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLFlushStatement.java
@@ -36,6 +36,8 @@ public final class MySQLFlushStatement extends FlushStatement {
     
     private final boolean flushTable;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLFlushStatement(final DatabaseType databaseType, final Collection<SimpleTableSegment> tables, final boolean flushTable) {
         super(databaseType);
         this.tables = tables;
@@ -43,7 +45,7 @@ public final class MySQLFlushStatement extends FlushStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(tables));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLKillStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLKillStatement.java
index 69840f9cc76..18601c65e16 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLKillStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLKillStatement.java
@@ -33,6 +33,8 @@ public final class MySQLKillStatement extends DALStatement {
     
     private final String scope;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLKillStatement(final DatabaseType databaseType, final String processId, final String scope) {
         super(databaseType);
         this.processId = processId;
@@ -40,7 +42,7 @@ public final class MySQLKillStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLResetStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLResetStatement.java
index 9c73674e8a0..272f94a8ba1 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLResetStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLResetStatement.java
@@ -34,13 +34,15 @@ public final class MySQLResetStatement extends DALStatement {
     
     private final List<ResetOptionSegment> options;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLResetStatement(final DatabaseType databaseType, final List<ResetOptionSegment> options) {
         super(databaseType);
         this.options = options;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLUseStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLUseStatement.java
index d039d4330ca..235ed4f7aea 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLUseStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/MySQLUseStatement.java
@@ -31,13 +31,15 @@ public final class MySQLUseStatement extends DALStatement {
     
     private final String database;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLUseStatement(final DatabaseType databaseType, final String database) {
         super(databaseType);
         this.database = database;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/plugin/MySQLShowPluginsStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/plugin/MySQLShowPluginsStatement.java
index fb83f64b863..13e6a235ede 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/plugin/MySQLShowPluginsStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/plugin/MySQLShowPluginsStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.mysql.dal.plugin;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.AllowNotUseDatabaseSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class MySQLShowPluginsStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowPluginsStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/binlog/MySQLShowBinaryLogsStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/binlog/MySQLShowBinaryLogsStatement.java
index 0716189ece5..fa32c96876f 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/binlog/MySQLShowBinaryLogsStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/binlog/MySQLShowBinaryLogsStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.mysql.dal.replication.binlog;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.AllowNotUseDatabaseSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class MySQLShowBinaryLogsStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowBinaryLogsStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/binlog/MySQLShowBinlogEventsStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/binlog/MySQLShowBinlogEventsStatement.java
index ba72ad54e37..308d23a1ad3 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/binlog/MySQLShowBinlogEventsStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/binlog/MySQLShowBinlogEventsStatement.java
@@ -34,6 +34,8 @@ public final class MySQLShowBinlogEventsStatement extends DALStatement {
     
     private final LimitSegment limit;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowBinlogEventsStatement(final DatabaseType databaseType, final String logName, final LimitSegment limit) {
         super(databaseType);
         this.logName = logName;
@@ -41,7 +43,7 @@ public final class MySQLShowBinlogEventsStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowMasterStatusStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowMasterStatusStatement.java
index f48b5b4fef4..2069e017bff 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowMasterStatusStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowMasterStatusStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.mysql.dal.replication.show;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.AllowNotUseDatabaseSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class MySQLShowMasterStatusStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowMasterStatusStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowRelayLogEventsStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowRelayLogEventsStatement.java
index 5bbd01452fa..1b742563a09 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowRelayLogEventsStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowRelayLogEventsStatement.java
@@ -36,6 +36,8 @@ public final class MySQLShowRelayLogEventsStatement extends DALStatement {
     
     private final String channel;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowRelayLogEventsStatement(final DatabaseType databaseType, final String logName, final LimitSegment limit, final String channel) {
         super(databaseType);
         this.logName = logName;
@@ -44,7 +46,7 @@ public final class MySQLShowRelayLogEventsStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowReplicaStatusStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowReplicaStatusStatement.java
index abaa7c31d8a..6fa93f9c7da 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowReplicaStatusStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowReplicaStatusStatement.java
@@ -31,13 +31,15 @@ public final class MySQLShowReplicaStatusStatement extends DALStatement {
     
     private final String channel;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowReplicaStatusStatement(final DatabaseType databaseType, final String channel) {
         super(databaseType);
         this.channel = channel;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowReplicasStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowReplicasStatement.java
index 6cc19d653dd..534d1ac3255 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowReplicasStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowReplicasStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.mysql.dal.replication.show;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.AllowNotUseDatabaseSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class MySQLShowReplicasStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowReplicasStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowSlaveHostsStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowSlaveHostsStatement.java
index 0025c28f034..95bcb3892f1 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowSlaveHostsStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowSlaveHostsStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.mysql.dal.replication.show;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.AllowNotUseDatabaseSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class MySQLShowSlaveHostsStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowSlaveHostsStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowSlaveStatusStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowSlaveStatusStatement.java
index 1d9ee453094..ce9fb454b6f 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowSlaveStatusStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowSlaveStatusStatement.java
@@ -31,13 +31,15 @@ public final class MySQLShowSlaveStatusStatement extends DALStatement {
     
     private final String channel;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowSlaveStatusStatement(final DatabaseType databaseType, final String channel) {
         super(databaseType);
         this.channel = channel;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowStatusStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowStatusStatement.java
index ed2fb50a2cb..01faa7799e7 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowStatusStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/replication/show/MySQLShowStatusStatement.java
@@ -32,13 +32,15 @@ public final class MySQLShowStatusStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowStatusStatement(final DatabaseType databaseType, final ShowFilterSegment filter) {
         super(databaseType);
         this.filter = filter;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/character/MySQLShowCharacterSetStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/character/MySQLShowCharacterSetStatement.java
index f39e7a5ffe3..bbbc87d04b9 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/character/MySQLShowCharacterSetStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/character/MySQLShowCharacterSetStatement.java
@@ -32,13 +32,15 @@ public final class MySQLShowCharacterSetStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowCharacterSetStatement(final DatabaseType databaseType, final ShowFilterSegment filter) {
         super(databaseType);
         this.filter = filter;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/character/MySQLShowCollationStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/character/MySQLShowCollationStatement.java
index d9abc86df91..6eeb5136c01 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/character/MySQLShowCollationStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/character/MySQLShowCollationStatement.java
@@ -32,13 +32,15 @@ public final class MySQLShowCollationStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowCollationStatement(final DatabaseType databaseType, final ShowFilterSegment filter) {
         super(databaseType);
         this.filter = filter;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/column/MySQLDescribeStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/column/MySQLDescribeStatement.java
index ab49d0658c0..4fda2a832dc 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/column/MySQLDescribeStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/column/MySQLDescribeStatement.java
@@ -38,6 +38,8 @@ public final class MySQLDescribeStatement extends DALStatement {
     
     private final ColumnSegment columnWildcard;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLDescribeStatement(final DatabaseType databaseType, final SimpleTableSegment table, final ColumnSegment columnWildcard) {
         super(databaseType);
         this.table = table;
@@ -54,7 +56,7 @@ public final class MySQLDescribeStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new ColumnInResultSetSQLStatementAttribute(1), new TableSQLStatementAttribute(table));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new ColumnInResultSetSQLStatementAttribute(1), new TableSQLStatementAttribute(table));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/column/MySQLShowColumnsStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/column/MySQLShowColumnsStatement.java
index 70e768c2d07..9f503ed8f24 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/column/MySQLShowColumnsStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/column/MySQLShowColumnsStatement.java
@@ -42,6 +42,8 @@ public final class MySQLShowColumnsStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowColumnsStatement(final DatabaseType databaseType, final SimpleTableSegment table, final FromDatabaseSegment fromDatabase, final ShowFilterSegment filter) {
         super(databaseType);
         this.table = table;
@@ -68,7 +70,7 @@ public final class MySQLShowColumnsStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new ColumnInResultSetSQLStatementAttribute(1), new FromDatabaseSQLStatementAttribute(fromDatabase), new TableSQLStatementAttribute(table));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new ColumnInResultSetSQLStatementAttribute(1), new FromDatabaseSQLStatementAttribute(fromDatabase), new TableSQLStatementAttribute(table));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/database/MySQLShowCreateDatabaseStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/database/MySQLShowCreateDatabaseStatement.java
index 6351c897622..8ab74eaf61d 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/database/MySQLShowCreateDatabaseStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/database/MySQLShowCreateDatabaseStatement.java
@@ -31,13 +31,15 @@ public final class MySQLShowCreateDatabaseStatement extends DALStatement {
     
     private final String databaseName;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowCreateDatabaseStatement(final DatabaseType databaseType, final String databaseName) {
         super(databaseType);
         this.databaseName = databaseName;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/database/MySQLShowDatabasesStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/database/MySQLShowDatabasesStatement.java
index 1225de7171a..9f91d7f0722 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/database/MySQLShowDatabasesStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/database/MySQLShowDatabasesStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.mysql.dal.show.database;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.segment.dal.ShowFilterSegment;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
@@ -33,6 +34,9 @@ public final class MySQLShowDatabasesStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowDatabasesStatement(final DatabaseType databaseType, final ShowFilterSegment filter) {
         super(databaseType);
         this.filter = filter;
@@ -48,7 +52,7 @@ public final class MySQLShowDatabasesStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute(), new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TablelessDataSourceBroadcastRouteSQLStatementAttribute(), new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/engine/MySQLShowEngineStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/engine/MySQLShowEngineStatement.java
index 77428991136..3f2d20e7da5 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/engine/MySQLShowEngineStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/engine/MySQLShowEngineStatement.java
@@ -31,13 +31,15 @@ public final class MySQLShowEngineStatement extends DALStatement {
     
     private final String engineName;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowEngineStatement(final DatabaseType databaseType, final String engineName) {
         super(databaseType);
         this.engineName = engineName;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/error/MySQLShowErrorsStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/error/MySQLShowErrorsStatement.java
index 812db05a68d..7a8b94d972b 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/error/MySQLShowErrorsStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/error/MySQLShowErrorsStatement.java
@@ -32,13 +32,15 @@ public final class MySQLShowErrorsStatement extends DALStatement {
     
     private final LimitSegment limit;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowErrorsStatement(final DatabaseType databaseType, final LimitSegment limit) {
         super(databaseType);
         this.limit = limit;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/error/MySQLShowWarningsStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/error/MySQLShowWarningsStatement.java
index 5efeb6a3a91..5a7e99062c2 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/error/MySQLShowWarningsStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/error/MySQLShowWarningsStatement.java
@@ -32,13 +32,15 @@ public final class MySQLShowWarningsStatement extends DALStatement {
     
     private final LimitSegment limit;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowWarningsStatement(final DatabaseType databaseType, final LimitSegment limit) {
         super(databaseType);
         this.limit = limit;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/event/MySQLShowCreateEventStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/event/MySQLShowCreateEventStatement.java
index 6aeab4036e0..3d321e4d184 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/event/MySQLShowCreateEventStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/event/MySQLShowCreateEventStatement.java
@@ -31,13 +31,15 @@ public final class MySQLShowCreateEventStatement extends DALStatement {
     
     private final String eventName;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowCreateEventStatement(final DatabaseType databaseType, final String eventName) {
         super(databaseType);
         this.eventName = eventName;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/event/MySQLShowEventsStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/event/MySQLShowEventsStatement.java
index 52869fec437..ecbfd46254b 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/event/MySQLShowEventsStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/event/MySQLShowEventsStatement.java
@@ -35,6 +35,8 @@ public final class MySQLShowEventsStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowEventsStatement(final DatabaseType databaseType, final FromDatabaseSegment fromDatabase, final ShowFilterSegment filter) {
         super(databaseType);
         this.fromDatabase = fromDatabase;
@@ -42,7 +44,7 @@ public final class MySQLShowEventsStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/function/MySQLShowFunctionStatusStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/function/MySQLShowFunctionStatusStatement.java
index eb943a94c79..9f182621ce2 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/function/MySQLShowFunctionStatusStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/function/MySQLShowFunctionStatusStatement.java
@@ -32,13 +32,15 @@ public final class MySQLShowFunctionStatusStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowFunctionStatusStatement(final DatabaseType databaseType, final ShowFilterSegment filter) {
         super(databaseType);
         this.filter = filter;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/index/MySQLShowIndexStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/index/MySQLShowIndexStatement.java
index 3bdad0d6b76..71770efb876 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/index/MySQLShowIndexStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/index/MySQLShowIndexStatement.java
@@ -38,6 +38,8 @@ public final class MySQLShowIndexStatement extends DALStatement {
     
     private final FromDatabaseSegment fromDatabase;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowIndexStatement(final DatabaseType databaseType, final SimpleTableSegment table, final FromDatabaseSegment fromDatabase) {
         super(databaseType);
         this.table = table;
@@ -54,7 +56,7 @@ public final class MySQLShowIndexStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase), new TableSQLStatementAttribute(table));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new FromDatabaseSQLStatementAttribute(fromDatabase), new TableSQLStatementAttribute(table));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowCreateUserStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowCreateUserStatement.java
index ef7a447aee4..4076f2ae87d 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowCreateUserStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowCreateUserStatement.java
@@ -31,13 +31,15 @@ public final class MySQLShowCreateUserStatement extends DALStatement {
     
     private final String name;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowCreateUserStatement(final DatabaseType databaseType, final String name) {
         super(databaseType);
         this.name = name;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowGrantsStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowGrantsStatement.java
index e28808c0734..74cfa6ea77a 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowGrantsStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowGrantsStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.mysql.dal.show.privilege;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.AllowNotUseDatabaseSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class MySQLShowGrantsStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowGrantsStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowPrivilegesStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowPrivilegesStatement.java
index 5dda21eb169..57413ec6a6b 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowPrivilegesStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/privilege/MySQLShowPrivilegesStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.mysql.dal.show.privilege;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.AllowNotUseDatabaseSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class MySQLShowPrivilegesStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowPrivilegesStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/procedure/MySQLShowProcedureStatusStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/procedure/MySQLShowProcedureStatusStatement.java
index 2110490050c..923a53c3e65 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/procedure/MySQLShowProcedureStatusStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/procedure/MySQLShowProcedureStatusStatement.java
@@ -32,13 +32,15 @@ public final class MySQLShowProcedureStatusStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowProcedureStatusStatement(final DatabaseType databaseType, final ShowFilterSegment filter) {
         super(databaseType);
         this.filter = filter;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/process/MySQLShowProcessListStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/process/MySQLShowProcessListStatement.java
index 063ba76b92a..a5b270e47cb 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/process/MySQLShowProcessListStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/process/MySQLShowProcessListStatement.java
@@ -31,13 +31,15 @@ public final class MySQLShowProcessListStatement extends DALStatement {
     
     private final boolean full;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowProcessListStatement(final DatabaseType databaseType, final boolean full) {
         super(databaseType);
         this.full = full;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/profile/MySQLShowProfileStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/profile/MySQLShowProfileStatement.java
index dd050323883..679b9a2e4c9 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/profile/MySQLShowProfileStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/profile/MySQLShowProfileStatement.java
@@ -32,13 +32,15 @@ public final class MySQLShowProfileStatement extends DALStatement {
     
     private final LimitSegment limit;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowProfileStatement(final DatabaseType databaseType, final LimitSegment limit) {
         super(databaseType);
         this.limit = limit;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/profile/MySQLShowProfilesStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/profile/MySQLShowProfilesStatement.java
index 83f4e1ea03a..2b225020c58 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/profile/MySQLShowProfilesStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/profile/MySQLShowProfilesStatement.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.statement.mysql.dal.show.profile;
 
+import lombok.Getter;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.SQLStatementAttributes;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.attribute.type.AllowNotUseDatabaseSQLStatementAttribute;
@@ -27,12 +28,15 @@ import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DA
  */
 public final class MySQLShowProfilesStatement extends DALStatement {
     
+    @Getter
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowProfilesStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowCreateTableStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowCreateTableStatement.java
index 3e5ec379ca1..bad884b60a3 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowCreateTableStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowCreateTableStatement.java
@@ -34,13 +34,15 @@ public final class MySQLShowCreateTableStatement extends DALStatement {
     
     private final SimpleTableSegment table;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowCreateTableStatement(final DatabaseType databaseType, final SimpleTableSegment table) {
         super(databaseType);
         this.table = table;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new DatabaseSelectRequiredSQLStatementAttribute(), new TableInResultSetSQLStatementAttribute(2), new TableSQLStatementAttribute(table));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new DatabaseSelectRequiredSQLStatementAttribute(), new TableInResultSetSQLStatementAttribute(2), new TableSQLStatementAttribute(table));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowOpenTablesStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowOpenTablesStatement.java
index 6287f768ba3..1e6e1628d56 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowOpenTablesStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowOpenTablesStatement.java
@@ -35,6 +35,8 @@ public final class MySQLShowOpenTablesStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowOpenTablesStatement(final DatabaseType databaseType, final FromDatabaseSegment fromDatabase, final ShowFilterSegment filter) {
         super(databaseType);
         this.fromDatabase = fromDatabase;
@@ -42,8 +44,8 @@ public final class MySQLShowOpenTablesStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
+    public void buildAttributes() {
         String databaseName = null == fromDatabase ? null : fromDatabase.getDatabase().getIdentifier().getValue();
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true, databaseName));
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true, databaseName));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowTableStatusStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowTableStatusStatement.java
index 6597e8e5b8e..4df544e84b9 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowTableStatusStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowTableStatusStatement.java
@@ -40,6 +40,8 @@ public final class MySQLShowTableStatusStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowTableStatusStatement(final DatabaseType databaseType, final FromDatabaseSegment fromDatabase, final ShowFilterSegment filter) {
         super(databaseType);
         this.fromDatabase = fromDatabase;
@@ -65,9 +67,9 @@ public final class MySQLShowTableStatusStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
+    public void buildAttributes() {
         String databaseName = null == fromDatabase ? null : fromDatabase.getDatabase().getIdentifier().getValue();
-        return new SQLStatementAttributes(new DatabaseSelectRequiredSQLStatementAttribute(), new FromDatabaseSQLStatementAttribute(fromDatabase),
+        attributes = new SQLStatementAttributes(new DatabaseSelectRequiredSQLStatementAttribute(), new FromDatabaseSQLStatementAttribute(fromDatabase),
                 new TablelessDataSourceBroadcastRouteSQLStatementAttribute(), new AllowNotUseDatabaseSQLStatementAttribute(true, databaseName));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowTablesStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowTablesStatement.java
index 2fe9c8b555a..460719e3e96 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowTablesStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/table/MySQLShowTablesStatement.java
@@ -42,6 +42,8 @@ public final class MySQLShowTablesStatement extends DALStatement {
     
     private final boolean containsFull;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowTablesStatement(final DatabaseType databaseType, final FromDatabaseSegment fromDatabase, final ShowFilterSegment filter, final boolean containsFull) {
         super(databaseType);
         this.fromDatabase = fromDatabase;
@@ -68,9 +70,9 @@ public final class MySQLShowTablesStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
+    public void buildAttributes() {
         String databaseName = null == fromDatabase ? null : fromDatabase.getDatabase().getIdentifier().getValue();
-        return new SQLStatementAttributes(new DatabaseSelectRequiredSQLStatementAttribute(), new FromDatabaseSQLStatementAttribute(fromDatabase),
+        attributes = new SQLStatementAttributes(new DatabaseSelectRequiredSQLStatementAttribute(), new FromDatabaseSQLStatementAttribute(fromDatabase),
                 new TablelessDataSourceBroadcastRouteSQLStatementAttribute(), new AllowNotUseDatabaseSQLStatementAttribute(true, databaseName));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/trigger/MySQLShowTriggersStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/trigger/MySQLShowTriggersStatement.java
index d794ab44a78..b0021a10873 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/trigger/MySQLShowTriggersStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/trigger/MySQLShowTriggersStatement.java
@@ -35,6 +35,8 @@ public final class MySQLShowTriggersStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowTriggersStatement(final DatabaseType databaseType, final FromDatabaseSegment fromDatabase, final ShowFilterSegment filter) {
         super(databaseType);
         this.fromDatabase = fromDatabase;
@@ -42,8 +44,8 @@ public final class MySQLShowTriggersStatement extends DALStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
+    public void buildAttributes() {
         String databaseName = null == fromDatabase ? null : fromDatabase.getDatabase().getIdentifier().getValue();
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true, databaseName));
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true, databaseName));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/variable/MySQLShowVariablesStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/variable/MySQLShowVariablesStatement.java
index 8d3652ccb7e..adec074eca8 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/variable/MySQLShowVariablesStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/variable/MySQLShowVariablesStatement.java
@@ -32,13 +32,15 @@ public final class MySQLShowVariablesStatement extends DALStatement {
     
     private final ShowFilterSegment filter;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowVariablesStatement(final DatabaseType databaseType, final ShowFilterSegment filter) {
         super(databaseType);
         this.filter = filter;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new AllowNotUseDatabaseSQLStatementAttribute(true));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/view/MySQLShowCreateViewStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/view/MySQLShowCreateViewStatement.java
index 26ae7e58252..cdfafce2a65 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/view/MySQLShowCreateViewStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/show/view/MySQLShowCreateViewStatement.java
@@ -33,13 +33,16 @@ public final class MySQLShowCreateViewStatement extends DALStatement {
     
     private final SimpleTableSegment viewName;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLShowCreateViewStatement(final DatabaseType databaseType, final SimpleTableSegment viewName) {
         super(databaseType);
         this.viewName = viewName;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new DatabaseSelectRequiredSQLStatementAttribute(), new ViewInResultSetSQLStatementAttribute(2, getViewName().getTableName().getIdentifier().getValue()));
+    public void buildAttributes() {
+        attributes =
+                new SQLStatementAttributes(new DatabaseSelectRequiredSQLStatementAttribute(), new ViewInResultSetSQLStatementAttribute(2, getViewName().getTableName().getIdentifier().getValue()));
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/table/MySQLOptimizeTableStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/table/MySQLOptimizeTableStatement.java
index 8d24582afca..499537df5d4 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/table/MySQLOptimizeTableStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dal/table/MySQLOptimizeTableStatement.java
@@ -35,13 +35,15 @@ public final class MySQLOptimizeTableStatement extends DALStatement {
     
     private final Collection<SimpleTableSegment> tables;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLOptimizeTableStatement(final DatabaseType databaseType, final Collection<SimpleTableSegment> tables) {
         super(databaseType);
         this.tables = tables;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(tables), new TableBroadcastRouteSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(tables), new TableBroadcastRouteSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dml/MySQLLoadDataStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dml/MySQLLoadDataStatement.java
index 97f3640a746..924749dc435 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dml/MySQLLoadDataStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dml/MySQLLoadDataStatement.java
@@ -33,13 +33,15 @@ public final class MySQLLoadDataStatement extends DMLStatement {
     
     private final SimpleTableSegment table;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLLoadDataStatement(final DatabaseType databaseType, final SimpleTableSegment table) {
         super(databaseType);
         this.table = table;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(table), new UnsupportedDistributeSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(table), new UnsupportedDistributeSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dml/MySQLLoadXMLStatement.java b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dml/MySQLLoadXMLStatement.java
index b642fd45e46..191aef5cb99 100644
--- a/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dml/MySQLLoadXMLStatement.java
+++ b/parser/sql/statement/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/statement/mysql/dml/MySQLLoadXMLStatement.java
@@ -33,13 +33,15 @@ public final class MySQLLoadXMLStatement extends DMLStatement {
     
     private final SimpleTableSegment table;
     
+    private SQLStatementAttributes attributes;
+    
     public MySQLLoadXMLStatement(final DatabaseType databaseType, final SimpleTableSegment table) {
         super(databaseType);
         this.table = table;
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(table), new UnsupportedDistributeSQLStatementAttribute());
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(table), new UnsupportedDistributeSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/statement/postgresql/dml/PostgreSQLCopyStatement.java b/parser/sql/statement/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/statement/postgresql/dml/PostgreSQLCopyStatement.java
index a07e40e73ce..2d5110f7b13 100644
--- a/parser/sql/statement/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/statement/postgresql/dml/PostgreSQLCopyStatement.java
+++ b/parser/sql/statement/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/statement/postgresql/dml/PostgreSQLCopyStatement.java
@@ -43,6 +43,8 @@ public final class PostgreSQLCopyStatement extends DMLStatement {
     
     private final PrepareStatementQuerySegment prepareStatementQuery;
     
+    private SQLStatementAttributes attributes;
+    
     public PostgreSQLCopyStatement(final DatabaseType databaseType,
                                    final SimpleTableSegment table, final Collection<ColumnSegment> columns, final PrepareStatementQuerySegment prepareStatementQuery) {
         super(databaseType);
@@ -70,8 +72,8 @@ public final class PostgreSQLCopyStatement extends DMLStatement {
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(
                 new TableSQLStatementAttribute(null == table ? Collections.emptyList() : Collections.singletonList(table)), new UnsupportedDistributeSQLStatementAttribute());
     }
 }
diff --git a/parser/sql/statement/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/statement/sqlserver/dcl/user/SQLServerDenyUserStatement.java b/parser/sql/statement/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/statement/sqlserver/dcl/user/SQLServerDenyUserStatement.java
index da7c52b497b..b2214e0f1a8 100644
--- a/parser/sql/statement/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/statement/sqlserver/dcl/user/SQLServerDenyUserStatement.java
+++ b/parser/sql/statement/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/statement/sqlserver/dcl/user/SQLServerDenyUserStatement.java
@@ -40,12 +40,14 @@ public final class SQLServerDenyUserStatement extends DCLStatement {
     
     private final Collection<ColumnSegment> columns = new LinkedList<>();
     
+    private SQLStatementAttributes attributes;
+    
     public SQLServerDenyUserStatement(final DatabaseType databaseType) {
         super(databaseType);
     }
     
     @Override
-    public SQLStatementAttributes getAttributes() {
-        return new SQLStatementAttributes(new TableSQLStatementAttribute(table));
+    public void buildAttributes() {
+        attributes = new SQLStatementAttributes(new TableSQLStatementAttribute(table));
     }
 }
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java
index 1341a3a353f..f50978cf926 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java
@@ -254,11 +254,13 @@ class ProxySQLExecutorTest {
     private CommonSQLStatementContext createCreateTableStatementContext(final DatabaseType databaseType) {
         CreateTableStatement sqlStatement = new CreateTableStatement(databaseType);
         sqlStatement.setTable(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
+        sqlStatement.buildAttributes();
         return new CommonSQLStatementContext(sqlStatement);
     }
     
     private SQLStatementContext createTruncateStatementContext(final DatabaseType databaseType) {
         TruncateStatement sqlStatement = new TruncateStatement(databaseType, Collections.singleton(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order")))));
+        sqlStatement.buildAttributes();
         return new CommonSQLStatementContext(sqlStatement);
     }
     
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactoryTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactoryTest.java
index bb9e972488a..cd0ff87be8a 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactoryTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactoryTest.java
@@ -234,6 +234,7 @@ class ProxyBackendHandlerFactoryTest {
         when(connectionSession.getTransactionStatus().isInTransaction()).thenReturn(true);
         String sql = "PREVIEW INSERT INTO account VALUES(1, 1, 1)";
         SQLStatement sqlStatement = ProxySQLComQueryParser.parse(sql, databaseType, connectionSession);
+        sqlStatement.buildAttributes();
         ProxyBackendHandler actual = ProxyBackendHandlerFactory.newInstance(databaseType, sql, sqlStatement, connectionSession, new HintValueContext());
         assertThat(actual, isA(DistSQLQueryProxyBackendHandler.class));
     }
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/ProxySQLComQueryParserTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/ProxySQLComQueryParserTest.java
index fdc8fe3a859..6090f5d43a4 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/ProxySQLComQueryParserTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/ProxySQLComQueryParserTest.java
@@ -28,6 +28,7 @@ import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
 import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.SQLStatement;
 import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.EmptyStatement;
+import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.UpdateStatement;
 import org.apache.shardingsphere.test.infra.framework.extension.mock.AutoMockExtension;
 import org.apache.shardingsphere.test.infra.framework.extension.mock.StaticMockSettings;
 import org.junit.jupiter.api.Test;
@@ -68,7 +69,7 @@ class ProxySQLComQueryParserTest {
     void assertParseWithMissingDatabaseUseDefaultType() {
         when(connectionSession.getUsedDatabaseName()).thenReturn("missing_db");
         SQLParserEngine parserEngine = mock(SQLParserEngine.class);
-        SQLStatement expected = new SQLStatement(databaseType);
+        SQLStatement expected = new UpdateStatement(databaseType);
         SQLParserRule parserRule = mockParserRule(parserEngine);
         mockProxyContext(parserRule, false, null);
         when(parserEngine.parse(anyString(), eq(false))).thenReturn(expected);
@@ -80,7 +81,7 @@ class ProxySQLComQueryParserTest {
         DatabaseType protocolType = TypedSPILoader.getService(DatabaseType.class, "PostgreSQL");
         when(connectionSession.getUsedDatabaseName()).thenReturn("logic_db");
         SQLParserEngine parserEngine = mock(SQLParserEngine.class);
-        SQLStatement expected = new SQLStatement(protocolType);
+        SQLStatement expected = new UpdateStatement(protocolType);
         SQLParserRule parserRule = mockParserRule(parserEngine);
         mockProxyContext(parserRule, true, protocolType);
         when(parserEngine.parse(anyString(), eq(false))).thenReturn(expected);
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/data/DatabaseProxyBackendHandlerFactoryTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/data/DatabaseProxyBackendHandlerFactoryTest.java
index 7ba7b61cbd8..44d8deb589c 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/data/DatabaseProxyBackendHandlerFactoryTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/data/DatabaseProxyBackendHandlerFactoryTest.java
@@ -80,7 +80,9 @@ class DatabaseProxyBackendHandlerFactoryTest {
     @Test
     void assertNewInstanceReturnedUnicastDatabaseProxyBackendHandlerWithQueryWithoutFrom() {
         String sql = "SELECT 1";
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new SelectStatement(databaseType));
+        SelectStatement selectStatement = new SelectStatement(databaseType);
+        selectStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(selectStatement);
         DatabaseProxyBackendHandler actual = DatabaseProxyBackendHandlerFactory.newInstance(
                 new QueryContext(sqlStatementContext, sql, Collections.emptyList(), new HintValueContext(), mockConnectionContext(), mock()), mock(), false);
         assertThat(actual, isA(UnicastDatabaseProxyBackendHandler.class));
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLProxyBackendHandlerFactoryTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLProxyBackendHandlerFactoryTest.java
index f6e4de45797..b5d7cb72d91 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLProxyBackendHandlerFactoryTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLProxyBackendHandlerFactoryTest.java
@@ -173,6 +173,7 @@ class DistSQLProxyBackendHandlerFactoryTest {
         when(contextManager.getDatabase("foo_db")).thenReturn(database);
         AlterDefaultShadowAlgorithmStatement statement = new AlterDefaultShadowAlgorithmStatement(
                 new ShadowAlgorithmSegment("foo", new AlgorithmSegment("SQL_HINT", PropertiesBuilder.build(new Property("type", "value")))));
+        statement.buildAttributes();
         assertThat(new DistSQLUpdateProxyBackendHandler(statement, mockQueryContext(), connectionSession, contextManager).execute(), isA(UpdateResponseHeader.class));
     }
     
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLQueryProxyBackendHandlerTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLQueryProxyBackendHandlerTest.java
index c26b5d9ac57..e3d2ea3d663 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLQueryProxyBackendHandlerTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLQueryProxyBackendHandlerTest.java
@@ -116,7 +116,9 @@ class DistSQLQueryProxyBackendHandlerTest {
     }
     
     private ShowTableMetaDataStatement createSqlStatement() {
-        return new ShowTableMetaDataStatement(Collections.singleton("t_order"), new FromDatabaseSegment(0, new DatabaseSegment(0, 0, new IdentifierValue("foo_db"))));
+        ShowTableMetaDataStatement result = new ShowTableMetaDataStatement(Collections.singleton("t_order"), new FromDatabaseSegment(0, new DatabaseSegment(0, 0, new IdentifierValue("foo_db"))));
+        result.buildAttributes();
+        return result;
     }
     
     @SuppressWarnings("unchecked")
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLUpdateProxyBackendHandlerTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLUpdateProxyBackendHandlerTest.java
index db6d660d7d0..94c6866d7fd 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLUpdateProxyBackendHandlerTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLUpdateProxyBackendHandlerTest.java
@@ -61,8 +61,9 @@ class DistSQLUpdateProxyBackendHandlerTest {
     @Test
     void assertEmptyStorageUnit() {
         when(contextManager.getDatabase("foo_db")).thenReturn(new ShardingSphereDatabase("foo_db", databaseType, mock(), mock(), Collections.emptyList()));
-        DistSQLUpdateProxyBackendHandler backendHandler = new DistSQLUpdateProxyBackendHandler(
-                new RefreshTableMetaDataStatement(), mockQueryContext(), mockConnectionSession("foo_db"), contextManager);
+        RefreshTableMetaDataStatement sqlStatement = new RefreshTableMetaDataStatement();
+        sqlStatement.buildAttributes();
+        DistSQLUpdateProxyBackendHandler backendHandler = new DistSQLUpdateProxyBackendHandler(sqlStatement, mockQueryContext(), mockConnectionSession("foo_db"), contextManager);
         assertThrows(EmptyStorageUnitException.class, backendHandler::execute);
     }
     
@@ -71,8 +72,9 @@ class DistSQLUpdateProxyBackendHandlerTest {
         ResourceMetaData resourceMetaData = mock(ResourceMetaData.class);
         when(resourceMetaData.getStorageUnits()).thenReturn(Collections.singletonMap("ds_0", mock(StorageUnit.class)));
         when(contextManager.getDatabase("foo_db")).thenReturn(new ShardingSphereDatabase("foo_db", databaseType, resourceMetaData, mock(), Collections.emptyList()));
-        DistSQLUpdateProxyBackendHandler backendHandler = new DistSQLUpdateProxyBackendHandler(
-                new RefreshTableMetaDataStatement("t_order", "ds_1", null), mockQueryContext(), mockConnectionSession("foo_db"), contextManager);
+        RefreshTableMetaDataStatement sqlStatement = new RefreshTableMetaDataStatement("t_order", "ds_1", null);
+        sqlStatement.buildAttributes();
+        DistSQLUpdateProxyBackendHandler backendHandler = new DistSQLUpdateProxyBackendHandler(sqlStatement, mockQueryContext(), mockConnectionSession("foo_db"), contextManager);
         assertThrows(MissingRequiredStorageUnitsException.class, backendHandler::execute);
     }
     
@@ -81,8 +83,9 @@ class DistSQLUpdateProxyBackendHandlerTest {
         ResourceMetaData resourceMetaData = mock(ResourceMetaData.class);
         when(resourceMetaData.getStorageUnits()).thenReturn(Collections.singletonMap("ds_0", mock(StorageUnit.class)));
         when(contextManager.getDatabase("foo_db")).thenReturn(new ShardingSphereDatabase("foo_db", databaseType, resourceMetaData, mock(), Collections.emptyList()));
-        DistSQLUpdateProxyBackendHandler backendHandler = new DistSQLUpdateProxyBackendHandler(
-                new RefreshTableMetaDataStatement("t_order", "ds_0", "bar_db"), mockQueryContext(), mockConnectionSession("foo_db"), contextManager);
+        RefreshTableMetaDataStatement sqlStatement = new RefreshTableMetaDataStatement("t_order", "ds_0", "bar_db");
+        sqlStatement.buildAttributes();
+        DistSQLUpdateProxyBackendHandler backendHandler = new DistSQLUpdateProxyBackendHandler(sqlStatement, mockQueryContext(), mockConnectionSession("foo_db"), contextManager);
         assertThrows(SchemaNotFoundException.class, backendHandler::execute);
     }
     
@@ -96,8 +99,9 @@ class DistSQLUpdateProxyBackendHandlerTest {
         when(database.getSchema("foo_db")).thenReturn(schema);
         when(database.getResourceMetaData()).thenReturn(resourceMetaData);
         when(contextManager.getDatabase("foo_db")).thenReturn(database);
-        DistSQLUpdateProxyBackendHandler backendHandler = new DistSQLUpdateProxyBackendHandler(
-                new RefreshTableMetaDataStatement("t_order", "ds_0", "foo_db"), mockQueryContext(), mockConnectionSession("foo_db"), contextManager);
+        RefreshTableMetaDataStatement sqlStatement = new RefreshTableMetaDataStatement("t_order", "ds_0", "foo_db");
+        sqlStatement.buildAttributes();
+        DistSQLUpdateProxyBackendHandler backendHandler = new DistSQLUpdateProxyBackendHandler(sqlStatement, mockQueryContext(), mockConnectionSession("foo_db"), contextManager);
         assertThrows(TableNotFoundException.class, backendHandler::execute);
     }
     
@@ -110,7 +114,9 @@ class DistSQLUpdateProxyBackendHandlerTest {
         when(database.getProtocolType()).thenReturn(databaseType);
         when(database.getResourceMetaData()).thenReturn(resourceMetaData);
         when(contextManager.getDatabase("foo_db")).thenReturn(database);
-        ResponseHeader actual = new DistSQLUpdateProxyBackendHandler(new RefreshTableMetaDataStatement(), mockQueryContext(), mockConnectionSession("foo_db"), contextManager).execute();
+        RefreshTableMetaDataStatement sqlStatement = new RefreshTableMetaDataStatement();
+        sqlStatement.buildAttributes();
+        ResponseHeader actual = new DistSQLUpdateProxyBackendHandler(sqlStatement, mockQueryContext(), mockConnectionSession("foo_db"), contextManager).execute();
         assertThat(actual, isA(UpdateResponseHeader.class));
     }
     
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/ParseDistSQLExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/ParseDistSQLExecutorTest.java
index 9c79777b43e..e35df8f9b40 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/ParseDistSQLExecutorTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/ParseDistSQLExecutorTest.java
@@ -66,7 +66,9 @@ class ParseDistSQLExecutorTest {
     void assertGetRowDataForMySQL() throws SQLException {
         String sql = "SELECT * FROM t_order";
         when(connectionSession.getProtocolType()).thenReturn(TypedSPILoader.getService(DatabaseType.class, "MySQL"));
-        DistSQLQueryProxyBackendHandler handler = new DistSQLQueryProxyBackendHandler(new ParseStatement(sql), mock(), connectionSession, contextManager);
+        ParseStatement parseStatement = new ParseStatement(sql);
+        parseStatement.buildAttributes();
+        DistSQLQueryProxyBackendHandler handler = new DistSQLQueryProxyBackendHandler(parseStatement, mock(), connectionSession, contextManager);
         handler.execute();
         handler.next();
         SQLStatement sqlStatement = sqlParserRule.getSQLParserEngine(TypedSPILoader.getService(DatabaseType.class, "MySQL")).parse(sql, false);
@@ -78,7 +80,9 @@ class ParseDistSQLExecutorTest {
     void assertGetRowDataForPostgreSQL() throws SQLException {
         String sql = "SELECT * FROM t_order";
         when(connectionSession.getProtocolType()).thenReturn(TypedSPILoader.getService(DatabaseType.class, "PostgreSQL"));
-        DistSQLQueryProxyBackendHandler handler = new DistSQLQueryProxyBackendHandler(new ParseStatement(sql), mock(), connectionSession, contextManager);
+        ParseStatement parseStatement = new ParseStatement(sql);
+        parseStatement.buildAttributes();
+        DistSQLQueryProxyBackendHandler handler = new DistSQLQueryProxyBackendHandler(parseStatement, mock(), connectionSession, contextManager);
         handler.execute();
         handler.next();
         SQLStatement sqlStatement = sqlParserRule.getSQLParserEngine(TypedSPILoader.getService(DatabaseType.class, "PostgreSQL")).parse(sql, false);
@@ -89,7 +93,9 @@ class ParseDistSQLExecutorTest {
     void assertExecute() {
         String sql = "wrong sql";
         when(connectionSession.getProtocolType()).thenReturn(TypedSPILoader.getService(DatabaseType.class, "MySQL"));
-        DistSQLQueryProxyBackendHandler handler = new DistSQLQueryProxyBackendHandler(new ParseStatement(sql), mock(), connectionSession, contextManager);
+        ParseStatement parseStatement = new ParseStatement(sql);
+        parseStatement.buildAttributes();
+        DistSQLQueryProxyBackendHandler handler = new DistSQLQueryProxyBackendHandler(parseStatement, mock(), connectionSession, contextManager);
         assertThrows(DialectSQLParsingException.class, handler::execute);
     }
 }
diff --git a/proxy/backend/dialect/firebird/src/test/java/org/apache/shardingsphere/proxy/backend/firebird/handler/admin/FirebirdAdminExecutorCreatorTest.java b/proxy/backend/dialect/firebird/src/test/java/org/apache/shardingsphere/proxy/backend/firebird/handler/admin/FirebirdAdminExecutorCreatorTest.java
index abc4b55b9a2..1d77518037a 100644
--- a/proxy/backend/dialect/firebird/src/test/java/org/apache/shardingsphere/proxy/backend/firebird/handler/admin/FirebirdAdminExecutorCreatorTest.java
+++ b/proxy/backend/dialect/firebird/src/test/java/org/apache/shardingsphere/proxy/backend/firebird/handler/admin/FirebirdAdminExecutorCreatorTest.java
@@ -55,7 +55,9 @@ class FirebirdAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithSetStatement() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new SetStatement(databaseType, Collections.emptyList()));
+        SetStatement sqlStatement = new SetStatement(databaseType, Collections.emptyList());
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Optional<DatabaseAdminExecutor> actual = new FirebirdAdminExecutorCreator().create(sqlStatementContext, "SET NAMES utf8", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(FirebirdSetVariableAdminExecutor.class));
@@ -63,8 +65,9 @@ class FirebirdAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithShowSQLStatement() {
-        Optional<DatabaseAdminExecutor> actual = new FirebirdAdminExecutorCreator().create(
-                new CommonSQLStatementContext(new ShowStatement(databaseType, "server_version")), "SHOW server_version", "", Collections.emptyList());
+        ShowStatement sqlStatement = new ShowStatement(databaseType, "server_version");
+        sqlStatement.buildAttributes();
+        Optional<DatabaseAdminExecutor> actual = new FirebirdAdminExecutorCreator().create(new CommonSQLStatementContext(sqlStatement), "SHOW server_version", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(FirebirdShowVariableExecutor.class));
     }
diff --git a/proxy/backend/dialect/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/MySQLAdminExecutorCreatorTest.java b/proxy/backend/dialect/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/MySQLAdminExecutorCreatorTest.java
index 7f69967391c..5f89cdda679 100644
--- a/proxy/backend/dialect/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/MySQLAdminExecutorCreatorTest.java
+++ b/proxy/backend/dialect/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/MySQLAdminExecutorCreatorTest.java
@@ -96,7 +96,9 @@ class MySQLAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithMySQLShowFunctionStatus() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new MySQLShowFunctionStatusStatement(databaseType, null));
+        MySQLShowFunctionStatusStatement sqlStatement = new MySQLShowFunctionStatusStatement(databaseType, null);
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Optional<DatabaseAdminExecutor> actual = new MySQLAdminExecutorCreator().create(sqlStatementContext, "", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(MySQLShowFunctionStatusExecutor.class));
@@ -104,7 +106,9 @@ class MySQLAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithShowProcedureStatus() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new MySQLShowProcedureStatusStatement(databaseType, null));
+        MySQLShowProcedureStatusStatement sqlStatement = new MySQLShowProcedureStatusStatement(databaseType, null);
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Optional<DatabaseAdminExecutor> actual = new MySQLAdminExecutorCreator().create(sqlStatementContext, "", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(MySQLShowProcedureStatusExecutor.class));
@@ -112,7 +116,9 @@ class MySQLAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithShowTables() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new MySQLShowTablesStatement(databaseType, null, null, false));
+        MySQLShowTablesStatement sqlStatement = new MySQLShowTablesStatement(databaseType, null, null, false);
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Optional<DatabaseAdminExecutor> actual = new MySQLAdminExecutorCreator().create(sqlStatementContext, "", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(MySQLShowTablesExecutor.class));
@@ -120,7 +126,9 @@ class MySQLAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithUse() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new MySQLUseStatement(databaseType, null));
+        MySQLUseStatement sqlStatement = new MySQLUseStatement(databaseType, null);
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Optional<DatabaseAdminExecutor> actual = new MySQLAdminExecutorCreator().create(sqlStatementContext, "use db", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(MySQLUseDatabaseExecutor.class));
@@ -128,7 +136,9 @@ class MySQLAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithShowDatabasesStatement() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new MySQLShowDatabasesStatement(databaseType, null));
+        MySQLShowDatabasesStatement sqlStatement = new MySQLShowDatabasesStatement(databaseType, null);
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Optional<DatabaseAdminExecutor> actual = new MySQLAdminExecutorCreator().create(sqlStatementContext, "", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(MySQLShowDatabasesExecutor.class));
@@ -136,7 +146,9 @@ class MySQLAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithMySQLShowProcessListStatement() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new MySQLShowProcessListStatement(databaseType, false));
+        MySQLShowProcessListStatement sqlStatement = new MySQLShowProcessListStatement(databaseType, false);
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Optional<DatabaseAdminExecutor> actual = new MySQLAdminExecutorCreator().create(sqlStatementContext, "", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(MySQLShowProcessListExecutor.class));
@@ -144,7 +156,9 @@ class MySQLAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithMySQLShowCreateDatabaseStatement() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new MySQLShowCreateDatabaseStatement(databaseType, null));
+        MySQLShowCreateDatabaseStatement sqlStatement = new MySQLShowCreateDatabaseStatement(databaseType, null);
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Optional<DatabaseAdminExecutor> actual = new MySQLAdminExecutorCreator().create(sqlStatementContext, "", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(MySQLShowCreateDatabaseExecutor.class));
@@ -152,7 +166,9 @@ class MySQLAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithSetStatement() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new SetStatement(databaseType, Collections.emptyList()));
+        SetStatement sqlStatement = new SetStatement(databaseType, Collections.emptyList());
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Optional<DatabaseAdminExecutor> actual = new MySQLAdminExecutorCreator().create(sqlStatementContext, "", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(MySQLSetVariableAdminExecutor.class));
@@ -402,7 +418,9 @@ class MySQLAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithDMLStatement() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new DeleteStatement(databaseType));
+        DeleteStatement sqlStatement = new DeleteStatement(databaseType);
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Optional<DatabaseAdminExecutor> actual = new MySQLAdminExecutorCreator().create(sqlStatementContext, "DELETE FROM t", "", Collections.emptyList());
         assertThat(actual, is(Optional.empty()));
     }
diff --git a/proxy/backend/dialect/postgresql/src/test/java/org/apache/shardingsphere/proxy/backend/postgresql/handler/admin/PostgreSQLAdminExecutorCreatorTest.java b/proxy/backend/dialect/postgresql/src/test/java/org/apache/shardingsphere/proxy/backend/postgresql/handler/admin/PostgreSQLAdminExecutorCreatorTest.java
index 8e0385bb00f..bf00bb4cc4e 100644
--- a/proxy/backend/dialect/postgresql/src/test/java/org/apache/shardingsphere/proxy/backend/postgresql/handler/admin/PostgreSQLAdminExecutorCreatorTest.java
+++ b/proxy/backend/dialect/postgresql/src/test/java/org/apache/shardingsphere/proxy/backend/postgresql/handler/admin/PostgreSQLAdminExecutorCreatorTest.java
@@ -118,7 +118,9 @@ class PostgreSQLAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithSetStatement() {
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new SetStatement(databaseType, Collections.emptyList()));
+        SetStatement sqlStatement = new SetStatement(databaseType, Collections.emptyList());
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         Optional<DatabaseAdminExecutor> actual = new PostgreSQLAdminExecutorCreator().create(sqlStatementContext, "SET client_encoding = utf8", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(PostgreSQLSetVariableAdminExecutor.class));
@@ -126,16 +128,18 @@ class PostgreSQLAdminExecutorCreatorTest {
     
     @Test
     void assertCreateWithResetStatement() {
-        Optional<DatabaseAdminExecutor> actual = new PostgreSQLAdminExecutorCreator()
-                .create(new CommonSQLStatementContext(new PostgreSQLResetParameterStatement(databaseType, "client_encoding")), "RESET client_encoding", "", Collections.emptyList());
+        PostgreSQLResetParameterStatement sqlStatement = new PostgreSQLResetParameterStatement(databaseType, "client_encoding");
+        sqlStatement.buildAttributes();
+        Optional<DatabaseAdminExecutor> actual = new PostgreSQLAdminExecutorCreator().create(new CommonSQLStatementContext(sqlStatement), "RESET client_encoding", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(PostgreSQLResetVariableAdminExecutor.class));
     }
     
     @Test
     void assertCreateWithShowSQLStatement() {
-        Optional<DatabaseAdminExecutor> actual = new PostgreSQLAdminExecutorCreator().create(
-                new CommonSQLStatementContext(new ShowStatement(databaseType, "client_encoding")), "SHOW client_encoding", "", Collections.emptyList());
+        ShowStatement sqlStatement = new ShowStatement(databaseType, "client_encoding");
+        sqlStatement.buildAttributes();
+        Optional<DatabaseAdminExecutor> actual = new PostgreSQLAdminExecutorCreator().create(new CommonSQLStatementContext(sqlStatement), "SHOW client_encoding", "", Collections.emptyList());
         assertTrue(actual.isPresent());
         assertThat(actual.get(), isA(PostgreSQLShowVariableExecutor.class));
     }
diff --git a/proxy/frontend/dialect/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/MySQLCommandPacketFactoryTest.java b/proxy/frontend/dialect/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/MySQLCommandPacketFactoryTest.java
index cc12fdb55a1..94bcdcebeb2 100644
--- a/proxy/frontend/dialect/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/MySQLCommandPacketFactoryTest.java
+++ b/proxy/frontend/dialect/mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/MySQLCommandPacketFactoryTest.java
@@ -100,7 +100,9 @@ class MySQLCommandPacketFactoryTest {
         when(payload.getByteBuf().getIntLE(anyInt())).thenReturn(1);
         ServerPreparedStatementRegistry serverPreparedStatementRegistry = new ServerPreparedStatementRegistry();
         when(connectionSession.getServerPreparedStatementRegistry()).thenReturn(serverPreparedStatementRegistry);
-        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(new SelectStatement(databaseType));
+        SelectStatement sqlStatement = new SelectStatement(databaseType);
+        sqlStatement.buildAttributes();
+        SQLStatementContext sqlStatementContext = new CommonSQLStatementContext(sqlStatement);
         serverPreparedStatementRegistry.addPreparedStatement(1, new MySQLServerPreparedStatement("SELECT 1", sqlStatementContext, new HintValueContext(), Collections.emptyList()));
         assertThat(MySQLCommandPacketFactory.newInstance(MySQLCommandPacketType.COM_STMT_EXECUTE, payload, connectionSession), isA(MySQLComStmtExecutePacket.class));
     }
diff --git a/proxy/frontend/dialect/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PortalTest.java b/proxy/frontend/dialect/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PortalTest.java
index 996a98266da..8f8caa083ce 100644
--- a/proxy/frontend/dialect/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PortalTest.java
+++ b/proxy/frontend/dialect/postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/PortalTest.java
@@ -227,6 +227,7 @@ class PortalTest {
         when(proxyBackendHandler.next()).thenReturn(false);
         String sql = "set client_encoding = utf8";
         SetStatement setStatement = new SetStatement(databaseType, Collections.singletonList(new VariableAssignSegment(0, 0, new VariableSegment(0, 0, "client_encoding"), null)));
+        setStatement.buildAttributes();
         PostgreSQLServerPreparedStatement preparedStatement = new PostgreSQLServerPreparedStatement(
                 sql, new CommonSQLStatementContext(setStatement), new HintValueContext(), Collections.emptyList(), Collections.emptyList());
         Portal portal = new Portal("", preparedStatement, Collections.emptyList(), Collections.emptyList(), databaseConnectionManager);
@@ -313,6 +314,7 @@ class PortalTest {
         when(proxyBackendHandler.next()).thenReturn(false);
         VariableAssignSegment assignSegment = new VariableAssignSegment(0, 0, new VariableSegment(0, 0, "client_encoding"), "'utf8'");
         SetStatement setStatement = new SetStatement(databaseType, Collections.singletonList(assignSegment));
+        setStatement.buildAttributes();
         PostgreSQLServerPreparedStatement preparedStatement = new PostgreSQLServerPreparedStatement(
                 "", new CommonSQLStatementContext(setStatement), new HintValueContext(), Collections.emptyList(), Collections.emptyList());
         Portal portal = new Portal("", preparedStatement, Collections.emptyList(), Collections.emptyList(), databaseConnectionManager);
diff --git a/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java b/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java
index 7c6516bae24..b329cf4f912 100644
--- a/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java
+++ b/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java
@@ -84,6 +84,7 @@ public abstract class SQLBinderIT {
     private SQLStatement bindSQLStatement(final String databaseType, final String sql, final List<Object> parameters) {
         HintValueContext hintValueContext = SQLHintUtils.extractHint(sql);
         SQLStatement sqlStatement = new SQLStatementVisitorEngine(databaseType).visit(new SQLParserEngine(databaseType, new CacheOption(128, 1024L)).parse(sql, false));
+        sqlStatement.buildAttributes();
         return new SQLBindEngine(mockMetaData(TypedSPILoader.getService(DatabaseType.class, databaseType)), "foo_db_1", hintValueContext).bind(sqlStatement).getSqlStatement();
     }