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

jianglongtao 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 111c3bedd81 Remove check-duplicate-table-enabled (#18613)
111c3bedd81 is described below

commit 111c3bedd81966f6b4a34f112f6a7aa85eea9ee5
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Jun 27 00:36:45 2022 +0800

    Remove check-duplicate-table-enabled (#18613)
    
    * Remove check-duplicate-table-enabled
    
    * Fix test cases
    
    * Fix test cases
---
 ...3_DistSQL_Cluster_Governance_Capabilities.en.md |  1 -
 docs/blog/content/material/proxyIntroduce.cn.md    |  1 -
 .../user-manual/shardingsphere-jdbc/props.cn.md    |  1 -
 .../user-manual/shardingsphere-jdbc/props.en.md    |  1 -
 .../shardingsphere-proxy/yaml-config/props.cn.md   |  1 -
 .../shardingsphere-proxy/yaml-config/props.en.md   |  1 -
 .../src/main/resources/template/proxy/server.ftl   |  1 -
 .../src/main/resources/server/server.yaml          |  1 -
 .../config/props/ConfigurationPropertyKey.java     |  5 --
 .../driver/jdbc/base/AbstractSQLTest.java          |  4 +-
 ...gSphereDataSourceForReadwriteSplittingTest.java |  2 +-
 ...actShardingSphereDataSourceForShardingTest.java |  2 +-
 .../config/config-readwrite-splitting.yaml         |  2 +-
 .../src/test/resources/sql/jdbc_init.sql           |  3 --
 .../src/test/resources/sql/single_jdbc_init.sql    | 19 +++++++
 .../datanode/SingleTableDataNodeLoader.java        |  6 +--
 .../datanode/SingleTableDataNodeLoaderTest.java    | 60 ++++------------------
 .../singletable/rule/SingleTableRuleTest.java      | 18 +++----
 .../rule/builder/SingleTableRuleBuilderTest.java   | 11 +---
 .../src/main/resources/conf/server.yaml            |  1 -
 .../src/test/resources/env/opengauss/server.yaml   |  1 -
 .../src/test/resources/env/postgresql/server.yaml  |  1 -
 22 files changed, 47 insertions(+), 96 deletions(-)

diff --git 
a/docs/blog/content/material/Mar_23_DistSQL_Cluster_Governance_Capabilities.en.md
 
b/docs/blog/content/material/Mar_23_DistSQL_Cluster_Governance_Capabilities.en.md
index 6d86051aa33..4e54f57132e 100644
--- 
a/docs/blog/content/material/Mar_23_DistSQL_Cluster_Governance_Capabilities.en.md
+++ 
b/docs/blog/content/material/Mar_23_DistSQL_Cluster_Governance_Capabilities.en.md
@@ -193,7 +193,6 @@ props:
     # Proxy backend query fetch size. A larger value may increase the memory 
usage of ShardingSphere Proxy.
     # The default value is -1, which means set the minimum value for different 
JDBC drivers.
   proxy-backend-query-fetch-size: -1
-  check-duplicate-table-enabled: false
   proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default 
value is 0, which means let Netty decide.
     # Available options of proxy backend executor suitable: OLAP(default), 
OLTP. The OLTP option may reduce time cost of writing packets to client, but it 
may increase the latency of SQL execution
     # and block other clients if client connections are more than 
`proxy-frontend-executor-size`, especially executing slow SQL.
diff --git a/docs/blog/content/material/proxyIntroduce.cn.md 
b/docs/blog/content/material/proxyIntroduce.cn.md
index 5f62f6548a8..80c8d86562a 100644
--- a/docs/blog/content/material/proxyIntroduce.cn.md
+++ b/docs/blog/content/material/proxyIntroduce.cn.md
@@ -142,7 +142,6 @@ props: # 公用配置
    # Proxy backend query fetch size. A larger value may increase the memory 
usage of ShardingSphere Proxy.
    # The default value is -1, which means set the minimum value for different 
JDBC drivers.
  proxy-backend-query-fetch-size: -1
- check-duplicate-table-enabled: false
  proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default 
value is 0, which means let Netty decide.
    # Available options of proxy backend executor suitable: OLAP(default), 
OLTP. The OLTP option may reduce time cost of writing packets to client, but it 
may increase the latency of SQL execution
    # and block other clients if client connections are more than 
`proxy-frontend-executor-size`, especially executing slow SQL.
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/props.cn.md 
b/docs/document/content/user-manual/shardingsphere-jdbc/props.cn.md
index 8e481b4eb1c..fee90768999 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/props.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/props.cn.md
@@ -15,5 +15,4 @@ Apache ShardingSphere 提供属性配置的方式配置系统级配置。
 | kernel-executor-size (?)           | int        | 用于设置任务处理线程池的大小<br />每个 
ShardingSphereDataSource 使用一个独立的线程池,同一个 JVM 的不同数据源不共享线程池                        
                                          | infinite |
 | max-connections-size-per-query (?) | int        | 一次查询请求在每个数据库实例中所能使用的最大连接数  
                                                                                
                                                 | 1        |
 | check-table-metadata-enabled (?)   | boolean    | 在程序启动和更新时,是否检查分片元数据的结构一致性  
                                                                                
                                                 | false    |
-| check-duplicate-table-enabled (?)  | boolean    | 在程序启动和更新时,是否检查重复表          
                                                                                
                                                      | false    |
 | sql-federation-enabled (?)         | boolean    | 是否开启联邦查询                   
                                                                                
                                                            | false    |
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/props.en.md 
b/docs/document/content/user-manual/shardingsphere-jdbc/props.en.md
index dde5084b853..26d96d3552b 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/props.en.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/props.en.md
@@ -15,5 +15,4 @@ Apache ShardingSphere provides the way of property 
configuration to configure sy
 | kernel-executor-size (?)           | int         | The max thread size of 
worker group to execute SQL. One ShardingSphereDataSource will use a 
independent thread pool, it does not share thread pool even different data 
source in same JVM                                                              
     | infinite        |
 | max-connections-size-per-query (?) | int         | Max opened connection 
size for each query                                                             
                                                                                
                                                                      | 1       
        |
 | check-table-metadata-enabled (?)   | boolean     | Whether validate table 
meta data consistency when application startup or updated                       
                                                                                
                                                                     | false    
       |
-| check-duplicate-table-enabled (?)  | boolean     | Whether validate 
duplicate table when application startup or updated                             
                                                                                
                                                                           | 
false           |
 | sql-federation-enabled (?)         | boolean     | Whether enable SQL 
federation                                                                      
                                                                                
                                                                         | 
false           |
diff --git 
a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
 
b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
index 3fafd94a2eb..29988ff472e 100644
--- 
a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
+++ 
b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
@@ -21,7 +21,6 @@ Apache ShardingSphere 提供属性配置的方式配置系统级配置。
 | proxy-opentracing-enabled (?)       | boolean | 是否允许在 ShardingSphere-Proxy 
中使用 OpenTracing。                                                                
                            | false    | 是      |
 | proxy-hint-enabled (?)              | boolean | 是否允许在 ShardingSphere-Proxy 
中使用 Hint。使用 Hint 会将 Proxy 的线程处理模型由 IO 多路复用变更为每个请求一个独立的线程,会降低 Proxy 的吞吐量。        
                            | false    | 是      |
 | proxy-backend-query-fetch-size (?)  | int     | Proxy 
后端与数据库交互的每次获取数据行数(使用游标的情况下)。数值增大可能会增加 ShardingSphere Proxy 的内存使用。默认值为 -1,代表设置为 
JDBC 驱动的最小值。                                      | -1       | 是      |
-| check-duplicate-table-enabled (?)   | boolean | 在程序启动和更新时,是否检查重复表。           
                                                                                
                          | false    | 是      |
 | proxy-frontend-executor-size (?)    | int     | Proxy 前端 Netty 线程池线程数量,默认值 0 
代表使用 Netty 默认值。                                                                 
                          | 0        | 否      |
 | proxy-backend-executor-suitable (?) | String  | 可选选项:OLAP、OLTP。OLTP 
选项可能会减少向客户端写入数据包的时间开销,但如果客户端连接数超过 `proxy-frontend-executor-size`,尤其是执行慢 SQL 
时,它可能会增加 SQL 执行的延迟甚至阻塞其他客户端的连接。        | OLAP     | 是      |
 | proxy-frontend-max-connections (?)  | int     | 允许连接 Proxy 的最大客户端数量,默认值 0 
代表不限制。                                                                          
                             | 0        | 是      |
diff --git 
a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
 
b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
index 3cebdb6b83d..0030728c5e6 100644
--- 
a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
+++ 
b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
@@ -21,7 +21,6 @@ Apache ShardingSphere provides the way of property 
configuration to configure sy
 | proxy-opentracing-enabled (?)       | boolean     | Whether enable 
opentracing for ShardingSphere-Proxy.                                           
                                                                                
                                                                                
                                                           | false           | 
true             |
 | proxy-hint-enabled (?)              | boolean     | Whether enable hint for 
ShardingSphere-Proxy. Using Hint will switch proxy thread mode from IO 
multiplexing to per connection per thread, which will reduce system throughput. 
                                                                                
                                                           | false           | 
true             |
 | proxy-backend-query-fetch-size (?)  | int         | Proxy backend query 
fetch size. A larger value may increase the memory usage of ShardingSphere 
Proxy. The default value is -1, which means set the minimum value for different 
JDBC drivers.                                                                   
                                                           | -1              | 
true             |
-| check-duplicate-table-enabled (?)   | boolean     | Whether validate 
duplicate table when application startup or updated.                            
                                                                                
                                                                                
                                                         | false           | 
true             |
 | proxy-frontend-executor-size (?)    | int         | Proxy frontend Netty 
executor size. The default value is 0, which means let Netty decide.            
                                                                                
                                                                                
                                                     | 0               | false  
          |
 | proxy-backend-executor-suitable (?) | String      | Available options of 
proxy backend executor suitable: OLAP(default), OLTP. The OLTP option may 
reduce time cost of writing packets to client, but it may increase the latency 
of SQL execution and block other clients if client connections are more than 
`proxy-frontend-executor-size`, especially executing slow SQL. | OLAP           
 | true             |
 | proxy-frontend-max-connections (?)  | int         | The maximum permitted 
number of client connections to Proxy. The default value is 0 and less than or 
equal to 0 means no limitation.                                                 
                                                                                
                                                     | 0               | true   
          |
diff --git 
a/examples/shardingsphere-example-generator/src/main/resources/template/proxy/server.ftl
 
b/examples/shardingsphere-example-generator/src/main/resources/template/proxy/server.ftl
index b776a818d07..82bf1f9c000 100644
--- 
a/examples/shardingsphere-example-generator/src/main/resources/template/proxy/server.ftl
+++ 
b/examples/shardingsphere-example-generator/src/main/resources/template/proxy/server.ftl
@@ -37,4 +37,3 @@ props:
   sql-show: false
   check-table-metadata-enabled: false
   sql-simple: false
-  check-duplicate-table-enabled: false
diff --git 
a/examples/shardingsphere-proxy-example/shardingsphere-proxy-distsql-example/src/main/resources/server/server.yaml
 
b/examples/shardingsphere-proxy-example/shardingsphere-proxy-distsql-example/src/main/resources/server/server.yaml
index ece2027c18b..4d57fd301e9 100644
--- 
a/examples/shardingsphere-proxy-example/shardingsphere-proxy-distsql-example/src/main/resources/server/server.yaml
+++ 
b/examples/shardingsphere-proxy-example/shardingsphere-proxy-distsql-example/src/main/resources/server/server.yaml
@@ -60,7 +60,6 @@ props:
     # Proxy backend query fetch size. A larger value may increase the memory 
usage of ShardingSphere Proxy.
   # The default value is -1, which means set the minimum value for different 
JDBC drivers.
   proxy-backend-query-fetch-size: -1
-  check-duplicate-table-enabled: false
   proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default 
value is 0, which means let Netty decide.
     # Available options of proxy backend executor suitable: OLAP(default), 
OLTP. The OLTP option may reduce time cost of writing packets to client, but it 
may increase the latency of SQL execution
   # if client connections are more than proxy-frontend-netty-executor-size, 
especially executing slow SQL.
diff --git 
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
 
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
index f7b1d3543b4..9c51733e539 100644
--- 
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
+++ 
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
@@ -88,11 +88,6 @@ public enum ConfigurationPropertyKey implements 
TypedPropertyKey {
      */
     PROXY_BACKEND_QUERY_FETCH_SIZE("proxy-backend-query-fetch-size", 
String.valueOf(-1), int.class, false),
     
-    /**
-     * Whether check duplicate table.
-     */
-    CHECK_DUPLICATE_TABLE_ENABLED("check-duplicate-table-enabled", 
String.valueOf(Boolean.FALSE), boolean.class, false),
-    
     /**
      * Proxy frontend executor size. The default value is 0, which means let 
Netty decide.
      */
diff --git 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractSQLTest.java
 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractSQLTest.java
index 70d8f415de7..204fa1908bd 100644
--- 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractSQLTest.java
+++ 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractSQLTest.java
@@ -33,7 +33,7 @@ import java.util.Objects;
 
 public abstract class AbstractSQLTest {
     
-    private static final List<String> ACTUAL_DATA_SOURCE_NAMES = 
Arrays.asList("jdbc_0", "jdbc_1", "shadow_jdbc_0", "shadow_jdbc_1", "encrypt", 
"test_write_ds", "test_read_ds");
+    private static final List<String> ACTUAL_DATA_SOURCE_NAMES = 
Arrays.asList("jdbc_0", "jdbc_1", "single_jdbc", "shadow_jdbc_0", 
"shadow_jdbc_1", "encrypt", "test_primary_ds", "test_replica_ds");
     
     private static final Map<String, DataSource> ACTUAL_DATA_SOURCES = new 
HashMap<>();
     
@@ -55,6 +55,8 @@ public abstract class AbstractSQLTest {
                 RunScript.execute(conn, new 
InputStreamReader(Objects.requireNonNull(AbstractSQLTest.class.getClassLoader().getResourceAsStream("sql/jdbc_encrypt_init.sql"))));
             } else if ("shadow_jdbc_0".equals(dataSourceName) || 
"shadow_jdbc_1".equals(dataSourceName)) {
                 RunScript.execute(conn, new 
InputStreamReader(Objects.requireNonNull(AbstractSQLTest.class.getClassLoader().getResourceAsStream("sql/jdbc_shadow_init.sql"))));
+            } else if ("single_jdbc".equals(dataSourceName)) {
+                RunScript.execute(conn, new 
InputStreamReader(Objects.requireNonNull(AbstractSQLTest.class.getClassLoader().getResourceAsStream("sql/single_jdbc_init.sql"))));
             } else {
                 RunScript.execute(conn, new 
InputStreamReader(Objects.requireNonNull(AbstractSQLTest.class.getClassLoader().getResourceAsStream("sql/jdbc_init.sql"))));
             }
diff --git 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractShardingSphereDataSourceForReadwriteSplittingTest.java
 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractShardingSphereDataSourceForReadwriteSplittingTest.java
index 50c6f7db1e4..e663ca5cc0a 100644
--- 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractShardingSphereDataSourceForReadwriteSplittingTest.java
+++ 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractShardingSphereDataSourceForReadwriteSplittingTest.java
@@ -39,7 +39,7 @@ public abstract class 
AbstractShardingSphereDataSourceForReadwriteSplittingTest
     
     private static final String CONFIG_FILE = 
"config/config-readwrite-splitting.yaml";
     
-    private static final List<String> ACTUAL_DATA_SOURCE_NAMES = 
Arrays.asList("test_write_ds", "test_read_ds");
+    private static final List<String> ACTUAL_DATA_SOURCE_NAMES = 
Arrays.asList("test_primary_ds", "test_replica_ds");
     
     @BeforeClass
     public static void initReadwriteSplittingDataSources() throws 
SQLException, IOException {
diff --git 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractShardingSphereDataSourceForShardingTest.java
 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractShardingSphereDataSourceForShardingTest.java
index eeac945d679..95e69e9b53a 100644
--- 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractShardingSphereDataSourceForShardingTest.java
+++ 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/base/AbstractShardingSphereDataSourceForShardingTest.java
@@ -41,7 +41,7 @@ public abstract class 
AbstractShardingSphereDataSourceForShardingTest extends Ab
     
     private static ShardingSphereDataSource dataSource;
     
-    private static final List<String> ACTUAL_DATA_SOURCE_NAMES = 
Arrays.asList("jdbc_0", "jdbc_1");
+    private static final List<String> ACTUAL_DATA_SOURCE_NAMES = 
Arrays.asList("jdbc_0", "jdbc_1", "single_jdbc");
     
     private static final String CONFIG_FILE = "config/config-sharding.yaml";
     
diff --git 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-readwrite-splitting.yaml
 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-readwrite-splitting.yaml
index 01479c64596..f5c7b31f723 100644
--- 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-readwrite-splitting.yaml
+++ 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-readwrite-splitting.yaml
@@ -23,7 +23,7 @@ rules:
     test_ds:
       type: Static
       props:
-        write-data-source-name: test_write_ds
+        write-data-source-name: test_primary_ds
         read-data-source-names: test_replica_ds
       loadBalancerName: roundRobin
   loadBalancers:
diff --git 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/sql/jdbc_init.sql
 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/sql/jdbc_init.sql
index 28f8537f455..07820bacfaf 100644
--- 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/sql/jdbc_init.sql
+++ 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/sql/jdbc_init.sql
@@ -29,6 +29,3 @@ CREATE TABLE IF NOT EXISTS t_config (id INT NOT NULL 
AUTO_INCREMENT, status VARC
 
 CREATE TABLE IF NOT EXISTS t_user_0 (id INT NOT NULL, name VARCHAR(45) NULL, 
PRIMARY KEY (id));
 CREATE TABLE IF NOT EXISTS t_user_1 (id INT NOT NULL, name VARCHAR(45) NULL, 
PRIMARY KEY (id));
-
-CREATE TABLE IF NOT EXISTS t_sys_0 (id INT NOT NULL AUTO_INCREMENT, param_key 
VARCHAR(45) NULL, param_value VARCHAR(45) NULL, PRIMARY KEY (id));
-CREATE TABLE IF NOT EXISTS t_sys_1 (id INT NOT NULL AUTO_INCREMENT, param_key 
VARCHAR(45) NULL, param_value VARCHAR(45) NULL, PRIMARY KEY (id));
diff --git 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/sql/single_jdbc_init.sql
 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/sql/single_jdbc_init.sql
new file mode 100644
index 00000000000..cfd8d1baa5b
--- /dev/null
+++ 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/sql/single_jdbc_init.sql
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+CREATE TABLE IF NOT EXISTS t_sys_0 (id INT NOT NULL AUTO_INCREMENT, param_key 
VARCHAR(45) NULL, param_value VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE IF NOT EXISTS t_sys_1 (id INT NOT NULL AUTO_INCREMENT, param_key 
VARCHAR(45) NULL, param_value VARCHAR(45) NULL, PRIMARY KEY (id));
diff --git 
a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/main/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoader.java
 
b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/main/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoader.java
index c70e108c65f..02b8b839de0 100644
--- 
a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/main/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoader.java
+++ 
b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/main/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoader.java
@@ -22,7 +22,6 @@ import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import 
org.apache.shardingsphere.infra.config.exception.ShardingSphereConfigurationException;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
 import org.apache.shardingsphere.infra.database.type.DatabaseType;
 import org.apache.shardingsphere.infra.datanode.DataNode;
 import 
org.apache.shardingsphere.infra.metadata.database.schema.loader.common.SchemaTableNamesLoader;
@@ -57,7 +56,6 @@ public final class SingleTableDataNodeLoader {
     public static Map<String, Collection<DataNode>> load(final String 
databaseName, final DatabaseType databaseType, final Map<String, DataSource> 
dataSourceMap,
                                                          final 
Collection<String> excludedTables, final ConfigurationProperties props) {
         Map<String, Collection<DataNode>> result = new ConcurrentHashMap<>();
-        boolean checkDuplicateTable = 
props.getValue(ConfigurationPropertyKey.CHECK_DUPLICATE_TABLE_ENABLED);
         for (Entry<String, DataSource> entry : dataSourceMap.entrySet()) {
             Map<String, Collection<DataNode>> dataNodeMap = load(databaseName, 
databaseType, entry.getKey(), entry.getValue(), excludedTables);
             for (String each : dataNodeMap.keySet()) {
@@ -65,9 +63,7 @@ public final class SingleTableDataNodeLoader {
                 Collection<DataNode> existDataNodes = 
result.getOrDefault(each.toLowerCase(), new 
LinkedHashSet<>(addedDataNodes.size(), 1));
                 existDataNodes.addAll(addedDataNodes);
                 result.putIfAbsent(each.toLowerCase(), existDataNodes);
-                if (checkDuplicateTable) {
-                    
Preconditions.checkState(!containsDuplicateTable(existDataNodes), "Single table 
conflict, there are multiple tables `%s` existed.", each);
-                }
+                
Preconditions.checkState(!containsDuplicateTable(existDataNodes), "Single table 
conflict, there are multiple tables `%s` existed.", each);
             }
         }
         return result;
diff --git 
a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoaderTest.java
 
b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoaderTest.java
index 72e02e3bac8..da9be3b79ff 100644
--- 
a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoaderTest.java
+++ 
b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoaderTest.java
@@ -18,16 +18,15 @@
 package org.apache.shardingsphere.singletable.datanode;
 
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
 import org.apache.shardingsphere.infra.database.DefaultDatabase;
 import org.apache.shardingsphere.infra.database.type.DatabaseType;
 import org.apache.shardingsphere.infra.datanode.DataNode;
+import org.apache.shardingsphere.test.mock.MockedDataSource;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.junit.MockitoJUnitRunner;
 
 import javax.sql.DataSource;
+import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.Arrays;
@@ -47,7 +46,6 @@ import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-@RunWith(MockitoJUnitRunner.class)
 public final class SingleTableDataNodeLoaderTest {
     
     private static final String TABLE_TYPE = "TABLE";
@@ -66,11 +64,11 @@ public final class SingleTableDataNodeLoaderTest {
     }
     
     private DataSource mockDataSource(final String dataSourceName, final 
List<String> tableNames) throws SQLException {
-        DataSource result = mock(DataSource.class, RETURNS_DEEP_STUBS);
-        when(result.getConnection().getCatalog()).thenReturn(dataSourceName);
+        Connection connection = mock(Connection.class, RETURNS_DEEP_STUBS);
+        when(connection.getCatalog()).thenReturn(dataSourceName);
         ResultSet resultSet = mockResultSet(tableNames);
-        when(result.getConnection().getMetaData().getTables(dataSourceName, 
null, null, new String[]{TABLE_TYPE, VIEW_TYPE})).thenReturn(resultSet);
-        return result;
+        when(connection.getMetaData().getTables(dataSourceName, null, null, 
new String[]{TABLE_TYPE, VIEW_TYPE})).thenReturn(resultSet);
+        return new MockedDataSource(connection);
     }
     
     private ResultSet mockResultSet(final List<String> tableNames) throws 
SQLException {
@@ -86,27 +84,9 @@ public final class SingleTableDataNodeLoaderTest {
     
     @Test
     public void assertLoad() {
-        ConfigurationProperties props = new ConfigurationProperties(new 
Properties());
-        Map<String, Collection<DataNode>> dataNodeMap = 
SingleTableDataNodeLoader.load(DefaultDatabase.LOGIC_NAME, 
mock(DatabaseType.class), dataSourceMap, Collections.emptyList(), props);
-        assertTrue(dataNodeMap.containsKey("employee"));
-        assertTrue(dataNodeMap.containsKey("dept"));
-        assertTrue(dataNodeMap.containsKey("salary"));
-        assertTrue(dataNodeMap.containsKey("student"));
-        assertTrue(dataNodeMap.containsKey("teacher"));
-        assertTrue(dataNodeMap.containsKey("class"));
-        
assertThat(dataNodeMap.get("employee").iterator().next().getDataSourceName(), 
is("ds0"));
-        
assertThat(dataNodeMap.get("dept").iterator().next().getDataSourceName(), 
is("ds0"));
-        
assertThat(dataNodeMap.get("salary").iterator().next().getDataSourceName(), 
is("ds0"));
-        
assertThat(dataNodeMap.get("student").iterator().next().getDataSourceName(), 
is("ds1"));
-        
assertThat(dataNodeMap.get("teacher").iterator().next().getDataSourceName(), 
is("ds1"));
-        
assertThat(dataNodeMap.get("class").iterator().next().getDataSourceName(), 
is("ds1"));
-    }
-    
-    @Test
-    public void assertLoadWithExcludeTables() {
-        ConfigurationProperties props = new ConfigurationProperties(new 
Properties());
         Collection<String> excludedTables = Arrays.asList("salary", 
"employee", "student");
-        Map<String, Collection<DataNode>> dataNodeMap = 
SingleTableDataNodeLoader.load(DefaultDatabase.LOGIC_NAME, 
mock(DatabaseType.class), dataSourceMap, excludedTables, props);
+        Map<String, Collection<DataNode>> dataNodeMap = 
SingleTableDataNodeLoader.load(
+                DefaultDatabase.LOGIC_NAME, mock(DatabaseType.class), 
dataSourceMap, excludedTables, new ConfigurationProperties(new Properties()));
         assertFalse(dataNodeMap.containsKey("employee"));
         assertFalse(dataNodeMap.containsKey("salary"));
         assertFalse(dataNodeMap.containsKey("student"));
@@ -119,27 +99,7 @@ public final class SingleTableDataNodeLoaderTest {
     }
     
     @Test(expected = IllegalStateException.class)
-    public void assertLoadWithCheckOption() {
-        Properties props = new Properties();
-        
props.setProperty(ConfigurationPropertyKey.CHECK_DUPLICATE_TABLE_ENABLED.getKey(),
 Boolean.TRUE.toString());
-        SingleTableDataNodeLoader.load(DefaultDatabase.LOGIC_NAME, 
mock(DatabaseType.class), dataSourceMap, Collections.emptyList(), new 
ConfigurationProperties(props));
-    }
-    
-    @Test
-    public void assertLoadWithExcludeTablesCheckOption() {
-        Properties props = new Properties();
-        
props.setProperty(ConfigurationPropertyKey.CHECK_DUPLICATE_TABLE_ENABLED.getKey(),
 Boolean.TRUE.toString());
-        Collection<String> excludedTables = Arrays.asList("salary", 
"employee", "student");
-        Map<String, Collection<DataNode>> dataNodeMap = 
SingleTableDataNodeLoader.load(
-                DefaultDatabase.LOGIC_NAME, mock(DatabaseType.class), 
dataSourceMap, excludedTables, new ConfigurationProperties(props));
-        assertFalse(dataNodeMap.containsKey("employee"));
-        assertFalse(dataNodeMap.containsKey("salary"));
-        assertFalse(dataNodeMap.containsKey("student"));
-        assertTrue(dataNodeMap.containsKey("dept"));
-        assertTrue(dataNodeMap.containsKey("teacher"));
-        assertTrue(dataNodeMap.containsKey("class"));
-        
assertThat(dataNodeMap.get("dept").iterator().next().getDataSourceName(), 
is("ds0"));
-        
assertThat(dataNodeMap.get("teacher").iterator().next().getDataSourceName(), 
is("ds1"));
-        
assertThat(dataNodeMap.get("class").iterator().next().getDataSourceName(), 
is("ds1"));
+    public void assertLoadWithConflictTables() {
+        SingleTableDataNodeLoader.load(DefaultDatabase.LOGIC_NAME, 
mock(DatabaseType.class), dataSourceMap, Collections.emptyList(), new 
ConfigurationProperties(new Properties()));
     }
 }
diff --git 
a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/SingleTableRuleTest.java
 
b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/SingleTableRuleTest.java
index 0a0610e1799..5b48d5c3cd9 100644
--- 
a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/SingleTableRuleTest.java
+++ 
b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/SingleTableRuleTest.java
@@ -65,8 +65,8 @@ public final class SingleTableRuleTest {
     @Before
     public void setUp() throws SQLException {
         dataSourceMap = new LinkedHashMap<>(2, 1);
-        dataSourceMap.put("ds_0", mockDataSource("ds_0", 
Arrays.asList("employee", "t_order_0", "t_order_1")));
-        dataSourceMap.put("ds_1", mockDataSource("ds_1", 
Arrays.asList("student", "t_order_0", "t_order_1")));
+        dataSourceMap.put("foo_ds", mockDataSource("foo_ds", 
Arrays.asList("employee", "t_order_0")));
+        dataSourceMap.put("bar_ds", mockDataSource("bar_ds", 
Arrays.asList("student", "t_order_1")));
     }
     
     private DataSource mockDataSource(final String dataSourceName, final 
List<String> tableNames) throws SQLException {
@@ -121,7 +121,7 @@ public final class SingleTableRuleTest {
                 new SingleTableRuleConfiguration(), 
DefaultDatabase.LOGIC_NAME, dataSourceMap, 
Collections.singleton(dataNodeContainedRule), new ConfigurationProperties(new 
Properties()));
         Optional<DataNode> actual = 
singleTableRule.findSingleTableDataNode(DefaultDatabase.LOGIC_NAME, "employee");
         assertTrue(actual.isPresent());
-        assertThat(actual.get().getDataSourceName(), is("ds_0"));
+        assertThat(actual.get().getDataSourceName(), is("foo_ds"));
         assertThat(actual.get().getTableName(), is("employee"));
     }
     
@@ -132,7 +132,7 @@ public final class SingleTableRuleTest {
                 new SingleTableRuleConfiguration(), 
DefaultDatabase.LOGIC_NAME, dataSourceMap, 
Collections.singleton(dataNodeContainedRule), new ConfigurationProperties(new 
Properties()));
         Optional<DataNode> actual = 
singleTableRule.findSingleTableDataNode(DefaultDatabase.LOGIC_NAME, "EMPLOYEE");
         assertTrue(actual.isPresent());
-        assertThat(actual.get().getDataSourceName(), is("ds_0"));
+        assertThat(actual.get().getDataSourceName(), is("foo_ds"));
         assertThat(actual.get().getTableName(), is("employee"));
     }
     
@@ -150,7 +150,7 @@ public final class SingleTableRuleTest {
     public void assertIsAllTablesInSameDataSource() {
         Collection<QualifiedTable> singleTableNames = new LinkedList<>();
         singleTableNames.add(new QualifiedTable(DefaultDatabase.LOGIC_NAME, 
"employee"));
-        RouteMapper dataSourceMapper = new RouteMapper("ds_0", null);
+        RouteMapper dataSourceMapper = new RouteMapper("foo_ds", null);
         Collection<RouteMapper> tableMappers = new LinkedList<>();
         tableMappers.add(dataSourceMapper);
         RouteContext routeContext = new RouteContext();
@@ -165,10 +165,10 @@ public final class SingleTableRuleTest {
     public void assertAssignNewDataSourceName() {
         DataNodeContainedRule dataNodeContainedRule = 
mock(DataNodeContainedRule.class);
         SingleTableRuleConfiguration singleTableRuleConfig = new 
SingleTableRuleConfiguration();
-        singleTableRuleConfig.setDefaultDataSource("ds_0");
+        singleTableRuleConfig.setDefaultDataSource("foo_ds");
         SingleTableRule singleTableRule = new SingleTableRule(
                 singleTableRuleConfig, DefaultDatabase.LOGIC_NAME, 
dataSourceMap, Collections.singleton(dataNodeContainedRule), new 
ConfigurationProperties(new Properties()));
-        assertThat(singleTableRule.assignNewDataSourceName(), is("ds_0"));
+        assertThat(singleTableRule.assignNewDataSourceName(), is("foo_ds"));
     }
     
     @Test
@@ -188,7 +188,7 @@ public final class SingleTableRuleTest {
         SingleTableRule singleTableRule = new SingleTableRule(
                 new SingleTableRuleConfiguration(), 
DefaultDatabase.LOGIC_NAME, dataSourceMap, 
Collections.singleton(dataNodeContainedRule), new ConfigurationProperties(new 
Properties()));
         String tableName = "teacher";
-        String dataSourceName = "ds_0";
+        String dataSourceName = "foo_ds";
         singleTableRule.put(dataSourceName, DefaultDatabase.LOGIC_NAME, 
tableName);
         Collection<QualifiedTable> tableNames = new LinkedList<>();
         tableNames.add(new QualifiedTable(DefaultDatabase.LOGIC_NAME, 
"teacher"));
@@ -235,7 +235,7 @@ public final class SingleTableRuleTest {
         Collection<DataNode> actual = 
singleTableRule.getDataNodesByTableName("EMPLOYEE");
         assertThat(actual.size(), is(1));
         DataNode dataNode = actual.iterator().next();
-        assertThat(dataNode.getDataSourceName(), is("ds_0"));
+        assertThat(dataNode.getDataSourceName(), is("foo_ds"));
         assertThat(dataNode.getTableName(), is("employee"));
     }
     
diff --git 
a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilderTest.java
 
b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilderTest.java
index e9f93a1e4a5..aa6718b8ad8 100644
--- 
a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilderTest.java
+++ 
b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilderTest.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.singletable.rule.builder;
 
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
 import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
 import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
 import 
org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilderFactory;
@@ -41,7 +40,7 @@ public final class SingleTableRuleBuilderTest {
     public void assertBuild() {
         DatabaseRuleBuilder builder = 
DatabaseRuleBuilderFactory.getInstances().iterator().next();
         DatabaseRule actual = builder.build(
-                mock(SingleTableRuleConfiguration.class), "", 
Collections.emptyMap(), Collections.singleton(mock(ShardingSphereRule.class)), 
new ConfigurationProperties(createProperties()));
+                mock(SingleTableRuleConfiguration.class), "", 
Collections.emptyMap(), Collections.singleton(mock(ShardingSphereRule.class)), 
new ConfigurationProperties(new Properties()));
         assertThat(actual, instanceOf(SingleTableRule.class));
     }
     
@@ -50,13 +49,7 @@ public final class SingleTableRuleBuilderTest {
     public void assertBuildWithDefaultDataSource() {
         DatabaseRuleBuilder builder = 
DatabaseRuleBuilderFactory.getInstances().iterator().next();
         DatabaseRule actual = builder.build(
-                new SingleTableRuleConfiguration("foo_ds"), "", 
Collections.emptyMap(), Collections.singleton(mock(ShardingSphereRule.class)), 
new ConfigurationProperties(createProperties()));
+                new SingleTableRuleConfiguration("foo_ds"), "", 
Collections.emptyMap(), Collections.singleton(mock(ShardingSphereRule.class)), 
new ConfigurationProperties(new Properties()));
         assertThat(actual, instanceOf(SingleTableRule.class));
     }
-    
-    private Properties createProperties() {
-        Properties result = new Properties();
-        
result.setProperty(ConfigurationPropertyKey.CHECK_DUPLICATE_TABLE_ENABLED.getKey(),
 Boolean.FALSE.toString());
-        return result;
-    }
 }
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml
 
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml
index b121e467cb3..3caeb9764cf 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml
@@ -64,7 +64,6 @@
 #    # Proxy backend query fetch size. A larger value may increase the memory 
usage of ShardingSphere Proxy.
 #    # The default value is -1, which means set the minimum value for 
different JDBC drivers.
 #  proxy-backend-query-fetch-size: -1
-#  check-duplicate-table-enabled: false
 #  proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default 
value is 0, which means let Netty decide.
 #    # Available options of proxy backend executor suitable: OLAP(default), 
OLTP. The OLTP option may reduce time cost of writing packets to client, but it 
may increase the latency of SQL execution
 #    # and block other clients if client connections are more than 
`proxy-frontend-executor-size`, especially executing slow SQL.
diff --git 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/resources/env/opengauss/server.yaml
 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/resources/env/opengauss/server.yaml
index 35ceb5e284c..96e201077e5 100644
--- 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/resources/env/opengauss/server.yaml
+++ 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/resources/env/opengauss/server.yaml
@@ -45,7 +45,6 @@ props:
   check-table-metadata-enabled: false
   show-process-list-enabled: false
   proxy-backend-query-fetch-size: -1
-  check-duplicate-table-enabled: false
   proxy-backend-executor-suitable: OLAP
   proxy-frontend-max-connections: 0 # Less than or equal to 0 means no 
limitation.
   sql-federation-enabled: false
diff --git 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/resources/env/postgresql/server.yaml
 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/resources/env/postgresql/server.yaml
index 26d83c0771e..314fee5e950 100644
--- 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/resources/env/postgresql/server.yaml
+++ 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/resources/env/postgresql/server.yaml
@@ -47,7 +47,6 @@ props:
   # Proxy backend query fetch size. A larger value may increase the memory 
usage of ShardingSphere Proxy.
   # The default value is -1, which means set the minimum value for different 
JDBC drivers.
   proxy-backend-query-fetch-size: -1
-  check-duplicate-table-enabled: false
   proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default 
value is 0, which means let Netty decide.
   # Available options of proxy backend executor suitable: OLAP(default), OLTP. 
The OLTP option may reduce time cost of writing packets to client, but it may 
increase the latency of SQL execution
   # and block other clients if client connections are more than 
`proxy-frontend-executor-size`, especially executing slow SQL.

Reply via email to