This is an automated email from the ASF dual-hosted git repository.
yx9o 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 ec5380bed28 Remove the test of Local transactions for ClickHouse
integration module in nativeTest (#34530)
ec5380bed28 is described below
commit ec5380bed28be29f62066273e2568f979e302825
Author: Ling Hengqian <[email protected]>
AuthorDate: Fri Jan 31 17:26:58 2025 +0800
Remove the test of Local transactions for ClickHouse integration module in
nativeTest (#34530)
---
.../graalvm-native-image/_index.cn.md | 4 +-
.../graalvm-native-image/_index.en.md | 4 +-
.../optional-plugins/clickhouse/_index.cn.md | 178 +-------------------
.../optional-plugins/clickhouse/_index.en.md | 180 +--------------------
.../optional-plugins/hiveserver2/_index.cn.md | 2 +-
.../optional-plugins/hiveserver2/_index.en.md | 2 +-
infra/database/type/hive/pom.xml | 7 -
.../reflect-config.json | 65 ++------
.../resource-config.json | 9 --
.../reflect-config.json | 20 +++
.../org.hamcrest/hamcrest/3.0/reflect-config.json | 12 ++
pom.xml | 4 +-
.../test/natived/commons/TestShardingService.java | 34 ++--
.../commons/repository/OrderItemRepository.java | 34 ++--
.../natived/jdbc/databases/ClickHouseTest.java | 37 +----
.../test/natived/jdbc/databases/FirebirdTest.java | 2 +-
.../test/natived/proxy/databases/MySQLTest.java | 32 ++--
.../test/natived/proxy/databases/PostgresTest.java | 32 ++--
.../natived/proxy/transactions/base/SeataTest.java | 32 ++--
.../resource-config.json | 3 -
.../resources/test-native/xml/keeper_config.xml | 31 ----
.../resources/test-native/xml/transactions.xml | 25 ---
22 files changed, 158 insertions(+), 591 deletions(-)
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md
index f18270218c9..4f447442012 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md
@@ -389,11 +389,11 @@ Reachability Metadata 位于
`shardingsphere-infra-reachability-metadata` 子模
```bash
git clone [email protected]:apache/shardingsphere.git
cd ./shardingsphere/
-./mvnw -PgenerateMetadata -DskipNativeTests -e -T 1C clean test
native:metadata-copy
+./mvnw -PgenerateMetadata -e -T 1C clean test native:metadata-copy
```
受 https://github.com/apache/shardingsphere/issues/33206 影响,
-贡献者执行 `./mvnw -PgenerateMetadata -DskipNativeTests -T 1C -e clean test
native:metadata-copy` 后,
+贡献者执行 `./mvnw -PgenerateMetadata -T 1C -e clean test native:metadata-copy` 后,
`infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json`
会生成不必要的包含绝对路径的 JSON 条目,
类似如下,
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md
index 8ebe31f5e42..70626b881ae 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md
@@ -405,11 +405,11 @@ contributors should place it on the classpath of the
`shardingsphere-test-native
```bash
git clone [email protected]:apache/shardingsphere.git
cd ./shardingsphere/
-./mvnw -PgenerateMetadata -DskipNativeTests -e -T 1C clean test
native:metadata-copy
+./mvnw -PgenerateMetadata -e -T 1C clean test native:metadata-copy
```
Affected by https://github.com/apache/shardingsphere/issues/33206 ,
-After the contributor executes `./mvnw -PgenerateMetadata -DskipNativeTests -T
1C -e clean test native:metadata-copy`,
+After the contributor executes `./mvnw -PgenerateMetadata -T 1C -e clean test
native:metadata-copy`,
`infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json`
will generate unnecessary JSON entries containing absolute paths,
similar to the following.
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.cn.md
index 9e12705225b..a9594b8f1fc 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.cn.md
@@ -213,182 +213,12 @@ public class ExampleTest {
### 事务限制
-ClickHouse 不支持 ShardingSphere 集成级别的 XA 事务,
-因为 https://github.com/ClickHouse/clickhouse-java 未实现 `javax.sql.XADataSource`
的相关 Java 接口。
-
-ClickHouse 不支持 ShardingSphere 集成级别的 Seata AT 模式事务,
-因为 https://github.com/apache/incubator-seata 未实现 ClickHouse 的 SQL 方言解析。
-
-ClickHouse 支持 ShardingSphere 集成级别的本地事务,但需要对 ClickHouse 进行额外配置,
+ClickHouse 不支持 ShardingSphere 集成级别的本地事务,XA 事务或 Seata 的 AT 模式事务,
更多讨论位于 https://github.com/ClickHouse/clickhouse-docs/issues/2300 。
-引入讨论,编写 Docker Compose 文件来启动 ClickHouse 和 ClickHouse Keeper。
-
-```yaml
-services:
- clickhouse-keeper-01:
- image: clickhouse/clickhouse-keeper:24.11.1.2557
- volumes:
- - ./keeper_config.xml:/etc/clickhouse-keeper/keeper_config.xml
- clickhouse-server:
- image: clickhouse/clickhouse-server:24.11.1.2557
- depends_on:
- - clickhouse-keeper-01
- ports:
- - "8123:8123"
- volumes:
- - ./transactions.xml:/etc/clickhouse-server/config.d/transactions.xml
-```
-
-`./keeper_config.xml` 的内容如下,
-
-```xml
-<clickhouse replace="true">
- <listen_host>0.0.0.0</listen_host>
- <keeper_server>
- <tcp_port>9181</tcp_port>
- <server_id>1</server_id>
-
<snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path>
- <raft_configuration>
- <server>
- <id>1</id>
- <hostname>clickhouse-keeper-01</hostname>
- <port>9234</port>
- </server>
- </raft_configuration>
- </keeper_server>
-</clickhouse>
-```
-
-`./transactions.xml` 的内容如下,
-
-```xml
-<clickhouse>
- <allow_experimental_transactions>1</allow_experimental_transactions>
- <zookeeper>
- <node index="1">
- <host>clickhouse-keeper-01</host>
- <port>9181</port>
- </node>
- </zookeeper>
-</clickhouse>
-```
-
-在 DBeaver Community 内,使用 `jdbc:ch://localhost:8123/default` 的
`jdbcUrl`,`default` 的`username` 连接至 ClickHouse,
-`password` 留空。
-执行如下 SQL,
-
-```sql
--- noinspection SqlNoDataSourceInspectionForFile
-CREATE DATABASE demo_ds_0;
-CREATE DATABASE demo_ds_1;
-CREATE DATABASE demo_ds_2;
-```
-
-分别使用 `jdbc:ch://localhost:8123/demo_ds_0` ,
-`jdbc:ch://localhost:8123/demo_ds_1` 和 `jdbc:ch://localhost:8123/demo_ds_2` 的
`jdbcUrl` 连接至 ClickHouse 来执行如下 SQL,
-
-```sql
--- noinspection SqlNoDataSourceInspectionForFile
-create table IF NOT EXISTS t_order (
- order_id Int64 NOT NULL,
- order_type Int32,
- user_id Int32 NOT NULL,
- address_id Int64 NOT NULL,
- status VARCHAR(50)
-) engine = MergeTree
- primary key (order_id)
- order by (order_id);
-
-TRUNCATE TABLE t_order;
-```
-
-在业务项目引入`前提条件`涉及的依赖后,在业务项目的 classpath 上编写 ShardingSphere 数据源的配置文件`demo.yaml`,
-
-```yaml
-dataSources:
- ds_0:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.clickhouse.jdbc.ClickHouseDriver
- jdbcUrl: jdbc:ch://localhost:8123/demo_ds_0?transactionSupport=true
- username: default
- password:
- ds_1:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.clickhouse.jdbc.ClickHouseDriver
- jdbcUrl: jdbc:ch://localhost:8123/demo_ds_1?transactionSupport=true
- username: default
- password:
- ds_2:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.clickhouse.jdbc.ClickHouseDriver
- jdbcUrl: jdbc:ch://localhost:8123/demo_ds_2?transactionSupport=true
- username: default
- password:
-rules:
-- !SHARDING
- tables:
- t_order:
- actualDataNodes:
- keyGenerateStrategy:
- column: order_id
- keyGeneratorName: snowflake
- defaultDatabaseStrategy:
- standard:
- shardingColumn: user_id
- shardingAlgorithmName: inline
- shardingAlgorithms:
- inline:
- type: INLINE
- props:
- algorithm-expression: ds_${user_id % 2}
- keyGenerators:
- snowflake:
- type: SNOWFLAKE
-```
-
-创建 ShardingSphere 的数据源后可正常使用本地事务,
-
-```java
-import com.zaxxer.hikari.HikariConfig;
-import com.zaxxer.hikari.HikariDataSource;
-import java.sql.Connection;
-import java.sql.SQLException;
-@SuppressWarnings({"SqlNoDataSourceInspection", "AssertWithSideEffects"})
-public class ExampleUtils {
- void test() throws SQLException {
- HikariConfig config = new HikariConfig();
- config.setJdbcUrl("jdbc:shardingsphere:classpath:demo.yaml");
-
config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver");
- try (HikariDataSource dataSource = new HikariDataSource(config);
Connection connection = dataSource.getConnection()) {
- try {
- connection.setAutoCommit(false);
- connection.createStatement().executeUpdate("INSERT INTO
t_order (user_id, order_type, address_id, status) VALUES (2024, 0, 2024,
'INSERT_TEST')");
- connection.createStatement().executeUpdate("INSERT INTO
t_order_does_not_exist (test_id_does_not_exist) VALUES (2024)");
- connection.commit();
- } catch (final SQLException ignored) {
- connection.rollback();
- } finally {
- connection.setAutoCommit(true);
- }
- try (Connection conn = dataSource.getConnection()) {
- assert !conn.createStatement().executeQuery("SELECT * FROM
t_order WHERE user_id = 2024").next();
- }
- }
- }
-}
-```
-
-一旦在 ShardingSphere 的配置文件为 ClickHouse JDBC Driver 的 jdbcUrl 设置
`transactionSupport=true`,
-用户在执行 `alter table` 语句前应确保没有尚未完成执行的 `insert` 语句,以避免如下 Error 的发生,
-
-```shell
-java.sql.BatchUpdateException: Code: 341. DB::Exception: Exception happened
during execution of mutation 'mutation_6.txt' with part 'all_1_1_0' reason:
'Serialization error: part all_1_1_0 is locked by transaction
5672402456378293316'. This error maybe retryable or not. In case of unretryable
error, mutation can be killed with KILL MUTATION query. (UNFINISHED) (version
24.10.2.80 (official build))
- at
com.clickhouse.jdbc.SqlExceptionUtils.batchUpdateError(SqlExceptionUtils.java:107)
- at
com.clickhouse.jdbc.internal.SqlBasedPreparedStatement.executeAny(SqlBasedPreparedStatement.java:223)
- at
com.clickhouse.jdbc.internal.SqlBasedPreparedStatement.executeLargeUpdate(SqlBasedPreparedStatement.java:302)
- at
com.clickhouse.jdbc.internal.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:135)
-```
+这与 https://clickhouse.com/docs/en/guides/developer/transactional 为 ClickHouse
提供的 `Transactions, Commit, and Rollback` 功能无关,
+仅与 `com.clickhouse.jdbc.ConnectionImpl` 未实现 `java.sql.Connection#rollback()`
有关。
+参考 https://github.com/ClickHouse/clickhouse-java/issues/2023 。
### 嵌入式 ClickHouse 限制
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.en.md
index 0e81b120748..d2a08b8ce26 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.en.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.en.md
@@ -219,182 +219,12 @@ public class ExampleTest {
### Transaction Limitations
-ClickHouse does not support XA transactions at the ShardingSphere integration
level,
-because https://github.com/ClickHouse/clickhouse-java does not implement the
relevant Java interface of `javax.sql.XADataSource`.
+ClickHouse does not support local transactions at the ShardingSphere
integration level, XA transactions, or AT mode transactions for Seata,
+More discussion is at
https://github.com/ClickHouse/clickhouse-docs/issues/2300 .
-ClickHouse does not support Seata AT mode transactions at the ShardingSphere
integration level,
-because https://github.com/apache/incubator-seata does not implement
ClickHouse's SQL dialect parsing.
-
-ClickHouse supports local transactions at the ShardingSphere integration
level, but additional configuration of ClickHouse is required,
-For more discussion, please visit
https://github.com/ClickHouse/clickhouse-docs/issues/2300 .
-
-Introduce the discussion of writing a Docker Compose file to start ClickHouse
and ClickHouse Keeper.
-
-```yaml
-services:
- clickhouse-keeper-01:
- image: clickhouse/clickhouse-keeper:24.11.1.2557
- volumes:
- - ./keeper_config.xml:/etc/clickhouse-keeper/keeper_config.xml
- clickhouse-server:
- image: clickhouse/clickhouse-server:24.11.1.2557
- depends_on:
- - clickhouse-keeper-01
- ports:
- - "8123:8123"
- volumes:
- - ./transactions.xml:/etc/clickhouse-server/config.d/transactions.xml
-```
-
-The content of `./keeper_config.xml` is as follows,
-
-```xml
-<clickhouse replace="true">
- <listen_host>0.0.0.0</listen_host>
- <keeper_server>
- <tcp_port>9181</tcp_port>
- <server_id>1</server_id>
-
<snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path>
- <raft_configuration>
- <server>
- <id>1</id>
- <hostname>clickhouse-keeper-01</hostname>
- <port>9234</port>
- </server>
- </raft_configuration>
- </keeper_server>
-</clickhouse>
-```
-
-The content of `./transactions.xml` is as follows,
-
-```xml
-<clickhouse>
- <allow_experimental_transactions>1</allow_experimental_transactions>
- <zookeeper>
- <node index="1">
- <host>clickhouse-keeper-01</host>
- <port>9181</port>
- </node>
- </zookeeper>
-</clickhouse>
-```
-
-In DBeaver Community, use `jdbcUrl` of `jdbc:ch://localhost:8123/default`,
`username` of `default` to connect to ClickHouse,
-and leave `password` blank. Execute the following SQL,
-
-```sql
--- noinspection SqlNoDataSourceInspectionForFile
-CREATE DATABASE demo_ds_0;
-CREATE DATABASE demo_ds_1;
-CREATE DATABASE demo_ds_2;
-```
-
-Use `jdbcUrl` of `jdbc:ch://localhost:8123/demo_ds_0`,
`jdbc:ch://localhost:8123/demo_ds_1`
-and `jdbc:ch://localhost:8123/demo_ds_2` to connect to ClickHouse and execute
the following SQL.
-
-```sql
--- noinspection SqlNoDataSourceInspectionForFile
-create table IF NOT EXISTS t_order (
- order_id Int64 NOT NULL,
- order_type Int32,
- user_id Int32 NOT NULL,
- address_id Int64 NOT NULL,
- status VARCHAR(50)
-) engine = MergeTree
- primary key (order_id)
- order by (order_id);
-
-TRUNCATE TABLE t_order;
-```
-
-After the business project introduces the dependencies involved in the
`prerequisites`,
-write the ShardingSphere data source configuration file `demo.yaml` on the
classpath of the business project.
-
-```yaml
-dataSources:
- ds_0:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.clickhouse.jdbc.ClickHouseDriver
- jdbcUrl: jdbc:ch://localhost:8123/demo_ds_0?transactionSupport=true
- username: default
- password:
- ds_1:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.clickhouse.jdbc.ClickHouseDriver
- jdbcUrl: jdbc:ch://localhost:8123/demo_ds_1?transactionSupport=true
- username: default
- password:
- ds_2:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: com.clickhouse.jdbc.ClickHouseDriver
- jdbcUrl: jdbc:ch://localhost:8123/demo_ds_2?transactionSupport=true
- username: default
- password:
-rules:
-- !SHARDING
- tables:
- t_order:
- actualDataNodes:
- keyGenerateStrategy:
- column: order_id
- keyGeneratorName: snowflake
- defaultDatabaseStrategy:
- standard:
- shardingColumn: user_id
- shardingAlgorithmName: inline
- shardingAlgorithms:
- inline:
- type: INLINE
- props:
- algorithm-expression: ds_${user_id % 2}
- keyGenerators:
- snowflake:
- type: SNOWFLAKE
-```
-
-After creating the ShardingSphere data source, local transactions can be used
normally.
-
-```java
-import com.zaxxer.hikari.HikariConfig;
-import com.zaxxer.hikari.HikariDataSource;
-import java.sql.Connection;
-import java.sql.SQLException;
-@SuppressWarnings({"SqlNoDataSourceInspection", "AssertWithSideEffects"})
-public class ExampleUtils {
- void test() throws SQLException {
- HikariConfig config = new HikariConfig();
- config.setJdbcUrl("jdbc:shardingsphere:classpath:demo.yaml");
-
config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver");
- try (HikariDataSource dataSource = new HikariDataSource(config);
Connection connection = dataSource.getConnection()) {
- try {
- connection.setAutoCommit(false);
- connection.createStatement().executeUpdate("INSERT INTO
t_order (user_id, order_type, address_id, status) VALUES (2024, 0, 2024,
'INSERT_TEST')");
- connection.createStatement().executeUpdate("INSERT INTO
t_order_does_not_exist (test_id_does_not_exist) VALUES (2024)");
- connection.commit();
- } catch (final SQLException ignored) {
- connection.rollback();
- } finally {
- connection.setAutoCommit(true);
- }
- try (Connection conn = dataSource.getConnection()) {
- assert !conn.createStatement().executeQuery("SELECT * FROM
t_order WHERE user_id = 2024").next();
- }
- }
- }
-}
-```
-
-Once `transactionSupport=true` is set for the jdbcUrl of ClickHouse JDBC
Driver in the ShardingSphere configuration file,
-users should ensure that there are no unfinished `insert` statements before
executing the `alter table` statement to avoid the following Error.
-
-```shell
-java.sql.BatchUpdateException: Code: 341. DB::Exception: Exception happened
during execution of mutation 'mutation_6.txt' with part 'all_1_1_0' reason:
'Serialization error: part all_1_1_0 is locked by transaction
5672402456378293316'. This error maybe retryable or not. In case of unretryable
error, mutation can be killed with KILL MUTATION query. (UNFINISHED) (version
24.10.2.80 (official build))
- at
com.clickhouse.jdbc.SqlExceptionUtils.batchUpdateError(SqlExceptionUtils.java:107)
- at
com.clickhouse.jdbc.internal.SqlBasedPreparedStatement.executeAny(SqlBasedPreparedStatement.java:223)
- at
com.clickhouse.jdbc.internal.SqlBasedPreparedStatement.executeLargeUpdate(SqlBasedPreparedStatement.java:302)
- at
com.clickhouse.jdbc.internal.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:135)
-```
+This has nothing to do with the `Transactions, Commit, and Rollback` feature
provided by https://clickhouse.com/docs/en/guides/developer/transactional for
ClickHouse,
+but only with `com.clickhouse.jdbc.ConnectionImpl` not implementing
`java.sql.Connection#rollback()`.
+See https://github.com/ClickHouse/clickhouse-java/issues/2023 .
### Embedded ClickHouse Limitations
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/hiveserver2/_index.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/hiveserver2/_index.cn.md
index 28637148be3..4ec84b5cf42 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/hiveserver2/_index.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/hiveserver2/_index.cn.md
@@ -80,7 +80,7 @@ ShardingSphere 对 HiveServer2 JDBC Driver 的支持位于可选模块中。
<dependency>
<groupId>io.github.linghengqian</groupId>
<artifactId>hive-server2-jdbc-driver-thin</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.woodstox</groupId>
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/hiveserver2/_index.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/hiveserver2/_index.en.md
index 4bc6a90939d..66ee9beccbf 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/hiveserver2/_index.en.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/hiveserver2/_index.en.md
@@ -82,7 +82,7 @@ The following is an example of a possible configuration,
<dependency>
<groupId>io.github.linghengqian</groupId>
<artifactId>hive-server2-jdbc-driver-thin</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.woodstox</groupId>
diff --git a/infra/database/type/hive/pom.xml b/infra/database/type/hive/pom.xml
index f5495105f4c..ea6600e4036 100644
--- a/infra/database/type/hive/pom.xml
+++ b/infra/database/type/hive/pom.xml
@@ -33,13 +33,6 @@
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.hive</groupId>
- <artifactId>hive-jdbc</artifactId>
- <version>${hive.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
<dependency>
<groupId>io.github.linghengqian</groupId>
<artifactId>hive-server2-jdbc-driver-thin</artifactId>
diff --git
a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json
b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json
index 5ea99760f55..ae8bd0a05a1 100644
---
a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json
+++
b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json
@@ -28,7 +28,7 @@
"name":"[Lcom.github.dockerjava.api.model.VolumesFrom;"
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.connection.DriverDatabaseConnectionManager$$Lambda/0x00007f7c3fdf9c28"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.connection.DriverDatabaseConnectionManager$$Lambda/0x00007f1973df8240"},
"name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;"
},
{
@@ -76,7 +76,7 @@
"name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;"
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.MetaDataContexts"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.service.DatabaseMetaDataPersistService"},
"name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;"
},
{
@@ -362,7 +362,7 @@
"allDeclaredFields":true
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistFacade"},
"name":"java.lang.Object",
"allDeclaredFields":true
},
@@ -372,12 +372,12 @@
"allDeclaredFields":true
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.table.TableMetaDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.service.TableMetaDataPersistService"},
"name":"java.lang.Object",
"allDeclaredFields":true
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.table.TableRowDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.service.TableRowDataPersistService"},
"name":"java.lang.Object",
"allDeclaredFields":true
},
@@ -749,11 +749,6 @@
"queryAllPublicConstructors":true,
"methods":[{"name":"<init>","parameterTypes":[] },
{"name":"add","parameterTypes":["long"] }, {"name":"sum","parameterTypes":[] }]
},
-{
-
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask"},
- "name":"java.util.concurrent.atomic.Striped64$Cell",
- "fields":[{"name":"value"}]
-},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser"},
"name":"java.util.function.DoubleFunction",
@@ -963,7 +958,7 @@
"allDeclaredFields":true
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistFacade"},
"name":"org.apache.shardingsphere.broadcast.yaml.config.YamlBroadcastRuleConfiguration",
"allDeclaredFields":true
},
@@ -1351,7 +1346,7 @@
"methods":[{"name":"getProps","parameterTypes":[] },
{"name":"getType","parameterTypes":[] }]
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistFacade"},
"name":"org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfiguration",
"allDeclaredFields":true,
"methods":[{"name":"getProps","parameterTypes":[] },
{"name":"getType","parameterTypes":[] }]
@@ -1699,7 +1694,7 @@
"name":"org.apache.shardingsphere.infra.instance.metadata.proxy.ProxyInstanceMetaDataBuilder"
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.global.ComputeNodeOnlineHandler"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.global.type.ComputeNodeOnlineHandler"},
"name":"org.apache.shardingsphere.infra.instance.yaml.YamlComputeNodeData",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
@@ -1815,7 +1810,7 @@
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.table.TableRowDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.service.TableRowDataPersistService"},
"name":"org.apache.shardingsphere.infra.yaml.data.pojo.YamlRowStatistics",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] },
{"name":"getRows","parameterTypes":[] },
{"name":"getUniqueKey","parameterTypes":[] },
{"name":"setRows","parameterTypes":["java.util.List"] },
{"name":"setUniqueKey","parameterTypes":["java.lang.String"] }]
@@ -1832,7 +1827,7 @@
"methods":[{"name":"<init>","parameterTypes":[] },
{"name":"setCaseSensitive","parameterTypes":["boolean"] },
{"name":"setDataType","parameterTypes":["int"] },
{"name":"setGenerated","parameterTypes":["boolean"] },
{"name":"setName","parameterTypes":["java.lang.String"] },
{"name":"setPrimaryKey","parameterTypes":["boolean"] },
{"name":"setUnsigned","parameterTypes":["boolean"] },
{"name":"setVisible","parameterTypes":["boolean"] }]
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.table.TableMetaDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.service.TableMetaDataPersistService"},
"name":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereColumn",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] },
{"name":"setCaseSensitive","parameterTypes":["boolean"] },
{"name":"setDataType","parameterTypes":["int"] },
{"name":"setGenerated","parameterTypes":["boolean"] },
{"name":"setName","parameterTypes":["java.lang.String"] },
{"name":"setNullable","parameterTypes":["boolean"] },
{"name":"setPrimaryKey","parameterTypes":["boolean"] },
{"name":"setUnsigned","parameterTypes":["boolean"] },
{"name":"setVisible","parameterTypes":["boolean"] }]
@@ -1862,7 +1857,7 @@
"methods":[{"name":"<init>","parameterTypes":[] },
{"name":"setName","parameterTypes":["java.lang.String"] }]
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.table.TableMetaDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.service.TableMetaDataPersistService"},
"name":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndex",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] },
{"name":"setName","parameterTypes":["java.lang.String"] },
{"name":"setUnique","parameterTypes":["boolean"] }]
@@ -1892,7 +1887,7 @@
"methods":[{"name":"<init>","parameterTypes":[] },
{"name":"setColumns","parameterTypes":["java.util.Map"] },
{"name":"setIndexes","parameterTypes":["java.util.Map"] },
{"name":"setName","parameterTypes":["java.lang.String"] }]
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.table.TableMetaDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.metadata.service.TableMetaDataPersistService"},
"name":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereTable",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] },
{"name":"getColumns","parameterTypes":[] },
{"name":"getConstraints","parameterTypes":[] },
{"name":"getIndexes","parameterTypes":[] },
{"name":"getName","parameterTypes":[] }, {"name":"getType","parameterTypes":[]
}, {"name":"setColumns","parameterTypes":["java.util.Map"] },
{"name":"setIndexes","parameterTypes":["java.util.Map"] },
{"name":"setName","parameterTypes":["java.lang.String"] },
{"name":"setType","parameterTypes":["org.apa [...]
@@ -2139,10 +2134,6 @@
"name":"org.apache.shardingsphere.mode.manager.cluster.persist.builder.ClusterPersistServiceBuilder",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
-{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacade"},
-
"name":"org.apache.shardingsphere.mode.manager.cluster.persist.coordinator.ClusterPersistCoordinatorFacadeBuilder"
-},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlModeConfigurationSwapper"},
"name":"org.apache.shardingsphere.mode.manager.cluster.yaml.ClusterYamlPersistRepositoryConfigurationSwapper"
@@ -2156,10 +2147,6 @@
"name":"org.apache.shardingsphere.mode.manager.standalone.persist.builder.StandalonePersistServiceBuilder",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
-{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacade"},
-
"name":"org.apache.shardingsphere.mode.manager.standalone.persist.coordinator.StandalonePersistCoordinatorFacadeBuilder"
-},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlModeConfigurationSwapper"},
"name":"org.apache.shardingsphere.mode.manager.standalone.yaml.StandaloneYamlPersistRepositoryConfigurationSwapper"
@@ -3005,7 +2992,7 @@
"allDeclaredFields":true
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistFacade"},
"name":"org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration",
"allDeclaredFields":true
},
@@ -3042,7 +3029,7 @@
"methods":[{"name":"getActualDataNodes","parameterTypes":[] },
{"name":"getAuditStrategy","parameterTypes":[] },
{"name":"getDatabaseStrategy","parameterTypes":[] },
{"name":"getKeyGenerateStrategy","parameterTypes":[] },
{"name":"getLogicTable","parameterTypes":[] },
{"name":"getTableStrategy","parameterTypes":[] }]
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistFacade"},
"name":"org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration",
"allDeclaredFields":true,
"methods":[{"name":"getActualDataNodes","parameterTypes":[] },
{"name":"getAuditStrategy","parameterTypes":[] },
{"name":"getDatabaseStrategy","parameterTypes":[] },
{"name":"getKeyGenerateStrategy","parameterTypes":[] },
{"name":"getLogicTable","parameterTypes":[] },
{"name":"getTableStrategy","parameterTypes":[] }]
@@ -3112,7 +3099,7 @@
"methods":[{"name":"getComplex","parameterTypes":[] },
{"name":"getHint","parameterTypes":[] }, {"name":"getNone","parameterTypes":[]
}, {"name":"getStandard","parameterTypes":[] }]
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistFacade"},
"name":"org.apache.shardingsphere.sharding.yaml.config.strategy.sharding.YamlShardingStrategyConfiguration",
"allDeclaredFields":true,
"methods":[{"name":"getComplex","parameterTypes":[] },
{"name":"getHint","parameterTypes":[] }, {"name":"getNone","parameterTypes":[]
}, {"name":"getStandard","parameterTypes":[] }]
@@ -3233,30 +3220,15 @@
"allDeclaredFields":true
},
{
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService"},
+
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistFacade"},
"name":"org.apache.shardingsphere.single.yaml.config.YamlSingleRuleConfiguration",
"allDeclaredFields":true
},
-{
-
"condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement"},
-
"name":"org.apache.shardingsphere.sql.parser.clickhouse.parser.ClickHouseLexer",
-
"methods":[{"name":"<init>","parameterTypes":["org.antlr.v4.runtime.CharStream"]
}]
-},
-{
-
"condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement"},
-
"name":"org.apache.shardingsphere.sql.parser.clickhouse.parser.ClickHouseParser",
-
"methods":[{"name":"<init>","parameterTypes":["org.antlr.v4.runtime.TokenStream"]
}]
-},
{
"condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.core.database.visitor.SQLStatementVisitorFactory"},
"name":"org.apache.shardingsphere.sql.parser.clickhouse.visitor.statement.ClickHouseStatementVisitorFacade",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
-{
-
"condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement"},
-
"name":"org.apache.shardingsphere.sql.parser.clickhouse.visitor.statement.type.ClickHouseDMLStatementVisitor",
- "methods":[{"name":"<init>","parameterTypes":[] }]
-},
{
"condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.core.database.cache.ParseTreeCacheBuilder"},
"name":"org.apache.shardingsphere.sql.parser.core.database.cache.ParseTreeCacheLoader"
@@ -3441,11 +3413,6 @@
"name":"org.apache.shardingsphere.sql.parser.statement.clickhouse.dml.ClickHouseSelectStatement",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
-{
-
"condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement"},
-
"name":"org.apache.shardingsphere.sql.parser.statement.clickhouse.dml.ClickHouseSelectStatement",
- "methods":[{"name":"<init>","parameterTypes":[] }]
-},
{
"condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement"},
"name":"org.apache.shardingsphere.sql.parser.statement.firebird.ddl.FirebirdCreateTableStatement",
diff --git
a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json
b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json
index 90fc000ab6f..d21e821b84a 100644
---
a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json
+++
b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json
@@ -87,12 +87,6 @@
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.transaction.xa.atomikos.manager.AtomikosTransactionManagerProvider"},
"pattern":"\\QMETA-INF/services/com.atomikos.recovery.OltpLogFactory\\E"
- }, {
-
"condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.connection.DriverDatabaseConnectionManager"},
- "pattern":"\\QMETA-INF/services/com.clickhouse.client.ClickHouseClient\\E"
- }, {
-
"condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.connection.DriverDatabaseConnectionManager$$Lambda/0x00007f7c3fca2710"},
- "pattern":"\\QMETA-INF/services/com.clickhouse.client.ClickHouseClient\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource"},
"pattern":"\\QMETA-INF/services/com.clickhouse.client.ClickHouseClient\\E"
@@ -339,9 +333,6 @@
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.node.spi.RuleNodePathProvider\\E"
- }, {
-
"condition":{"typeReachable":"org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacade"},
-
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.persist.coordinator.PersistCoordinatorFacadeBuilder\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.initializer.BootstrapInitializer"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.persist.service.PersistServiceBuilder\\E"
diff --git
a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json
b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json
index 7cdc40c4f3c..cfcef31c6ef 100644
---
a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json
+++
b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json
@@ -337,6 +337,26 @@
"name":"org.apache.shardingsphere.infra.yaml.data.pojo.YamlShardingSphereRowData",
"allPublicMethods": true
},
+{
+
"condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.data.pojo.YamlRowStatistics"},
+ "name":"org.apache.shardingsphere.infra.yaml.data.pojo.YamlRowStatistics",
+ "allPublicMethods": true
+},
+{
+
"condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.clickhouse.parser.ClickHouseLexer"},
+
"name":"org.apache.shardingsphere.sql.parser.clickhouse.parser.ClickHouseLexer",
+
"methods":[{"name":"<init>","parameterTypes":["org.antlr.v4.runtime.CharStream"]
}]
+},
+{
+
"condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.clickhouse.parser.ClickHouseParser"},
+
"name":"org.apache.shardingsphere.sql.parser.clickhouse.parser.ClickHouseParser",
+
"methods":[{"name":"<init>","parameterTypes":["org.antlr.v4.runtime.TokenStream"]
}]
+},
+{
+
"condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.clickhouse.visitor.statement.type.ClickHouseDMLStatementVisitor"},
+
"name":"org.apache.shardingsphere.sql.parser.clickhouse.visitor.statement.type.ClickHouseDMLStatementVisitor",
+ "methods":[{"name":"<init>","parameterTypes":[] }]
+},
{
"condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.statement.opengauss.ddl.OpenGaussTruncateStatement"},
"name":"org.apache.shardingsphere.sql.parser.statement.opengauss.ddl.OpenGaussTruncateStatement",
diff --git
a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.hamcrest/hamcrest/3.0/reflect-config.json
b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.hamcrest/hamcrest/3.0/reflect-config.json
new file mode 100644
index 00000000000..62d58b2e9fc
--- /dev/null
+++
b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.hamcrest/hamcrest/3.0/reflect-config.json
@@ -0,0 +1,12 @@
+[
+{
+ "condition":{"typeReachable":"org.hamcrest.TypeSafeMatcher"},
+ "name":"org.hamcrest.collection.IsEmptyCollection",
+ "queryAllDeclaredMethods":true
+},
+{
+ "condition":{"typeReachable":"org.hamcrest.TypeSafeDiagnosingMatcher"},
+ "name":"org.hamcrest.collection.IsIterableContainingInAnyOrder",
+ "queryAllDeclaredMethods":true
+}
+]
diff --git a/pom.xml b/pom.xml
index 0dcf96dd3e6..aca4752834b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -128,8 +128,7 @@
<opengauss.version>3.1.0-og</opengauss.version>
<mariadb-java-client.version>2.4.2</mariadb-java-client.version>
<clickhouse-jdbc.version>0.6.3</clickhouse-jdbc.version>
- <hive.version>4.0.1</hive.version>
-
<hive-server2-jdbc-driver-thin.version>1.6.0</hive-server2-jdbc-driver-thin.version>
+
<hive-server2-jdbc-driver-thin.version>1.7.0</hive-server2-jdbc-driver-thin.version>
<hadoop.version>3.3.6</hadoop.version>
<presto.version>0.288.1</presto.version>
<jaybird.version>5.0.6.java8</jaybird.version>
@@ -1065,6 +1064,7 @@
<version>${native-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
+ <skipNativeTests>true</skipNativeTests>
<agent>
<enabled>true</enabled>
<defaultMode>Conditional</defaultMode>
diff --git
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/TestShardingService.java
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/TestShardingService.java
index 552484ede96..52c3047af1c 100644
---
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/TestShardingService.java
+++
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/TestShardingService.java
@@ -24,23 +24,22 @@ import
org.apache.shardingsphere.test.natived.commons.entity.OrderItem;
import
org.apache.shardingsphere.test.natived.commons.repository.AddressRepository;
import
org.apache.shardingsphere.test.natived.commons.repository.OrderItemRepository;
import
org.apache.shardingsphere.test.natived.commons.repository.OrderRepository;
-import org.awaitility.Awaitility;
import javax.sql.DataSource;
import java.sql.SQLException;
import java.sql.Statement;
-import java.time.Duration;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashSet;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.LongStream;
-import java.util.stream.Stream;
import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.empty;
@Getter
public final class TestShardingService {
@@ -73,7 +72,7 @@ public final class TestShardingService {
}
/**
- * Process success in ClickHouse.
+ * Process success in ClickHouse. ClickHouse JDBC Driver does not support
the use of transactions.
*
* @throws SQLException An exception that provides information on a
database access error or other errors.
*/
@@ -84,28 +83,30 @@ public final class TestShardingService {
assertThat(orderRepository.selectAll(),
equalTo(Collections.emptyList()));
assertThat(orderItemRepository.selectAll(),
equalTo(Collections.emptyList()));
assertThat(addressRepository.selectAll(),
equalTo(Collections.emptyList()));
- orderItemRepository.assertRollbackWithTransactions();
}
private void extracted() throws SQLException {
Collection<Order> orders = orderRepository.selectAll();
+
assertThat(orders.stream().map(Order::getOrderId).collect(Collectors.toList()),
not(empty()));
assertThat(orders.stream().map(Order::getOrderType).collect(Collectors.toList()),
- equalTo(Stream.of(0, 0, 0, 0, 0, 1, 1, 1, 1,
1).collect(Collectors.toList())));
-
assertThat(orders.stream().map(Order::getUserId).collect(Collectors.toSet()),
- equalTo(Stream.of(2, 4, 6, 8, 10, 1, 3, 5, 7,
9).collect(Collectors.toSet())));
-
assertThat(orders.stream().map(Order::getAddressId).collect(Collectors.toSet()),
- equalTo(Stream.of(2L, 4L, 6L, 8L, 10L, 1L, 3L, 5L, 7L,
9L).collect(Collectors.toSet())));
+ containsInAnyOrder(0, 1, 0, 1, 0, 1, 0, 1, 0, 1));
+
assertThat(orders.stream().map(Order::getUserId).collect(Collectors.toList()),
+ containsInAnyOrder(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+
assertThat(orders.stream().map(Order::getAddressId).collect(Collectors.toList()),
+ containsInAnyOrder(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L));
assertThat(orders.stream().map(Order::getStatus).collect(Collectors.toList()),
equalTo(IntStream.range(1, 11).mapToObj(i ->
"INSERT_TEST").collect(Collectors.toList())));
Collection<OrderItem> orderItems = orderItemRepository.selectAll();
-
assertThat(orderItems.stream().map(OrderItem::getUserId).collect(Collectors.toSet()),
- equalTo(Stream.of(2, 4, 6, 8, 10, 1, 3, 5, 7,
9).collect(Collectors.toSet())));
+
assertThat(orderItems.stream().map(OrderItem::getOrderItemId).collect(Collectors.toList()),
not(empty()));
+
assertThat(orderItems.stream().map(OrderItem::getOrderId).collect(Collectors.toList()),
not(empty()));
+
assertThat(orderItems.stream().map(OrderItem::getUserId).collect(Collectors.toList()),
+ containsInAnyOrder(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
assertThat(orderItems.stream().map(OrderItem::getPhone).collect(Collectors.toList()),
equalTo(IntStream.range(1, 11).mapToObj(i ->
"13800000001").collect(Collectors.toList())));
assertThat(orderItems.stream().map(OrderItem::getStatus).collect(Collectors.toList()),
equalTo(IntStream.range(1, 11).mapToObj(i ->
"INSERT_TEST").collect(Collectors.toList())));
- assertThat(new HashSet<>(addressRepository.selectAll()),
- equalTo(LongStream.range(1L, 11L).mapToObj(each -> new
Address(each, "address_test_" + each)).collect(Collectors.toSet())));
+ assertThat(addressRepository.selectAll(),
+ equalTo(LongStream.range(1L, 11L).mapToObj(each -> new
Address(each, "address_test_" + each)).collect(Collectors.toList())));
}
/**
@@ -174,14 +175,11 @@ public final class TestShardingService {
/**
* Delete data in ClickHouse.
- * TODO It is necessary to avoid the use of {@code
Awaitility.await().pollDelay(Duration.ofSeconds(5L)).until(()->true)}.
- * After ClickHouse enables experimental transactions, performance drops
significantly.
*
* @param orderIds orderId of the insert statement.
* @throws SQLException An exception that provides information on a
database access error or other errors.
*/
public void deleteDataInClickHouse(final Collection<Long> orderIds) throws
SQLException {
- Awaitility.await().pollDelay(Duration.ofSeconds(5L)).until(() -> true);
long count = 1L;
for (Long each : orderIds) {
orderRepository.deleteInClickHouse(each);
diff --git
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/repository/OrderItemRepository.java
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/repository/OrderItemRepository.java
index 038f283250f..2181a37f4b4 100644
---
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/repository/OrderItemRepository.java
+++
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/repository/OrderItemRepository.java
@@ -321,22 +321,36 @@ public final class OrderItemRepository {
* @throws SQLException An exception that provides information on a
database access error or other errors.
*/
public void assertRollbackWithTransactions() throws SQLException {
- try (Connection connection = dataSource.getConnection()) {
+ try (Connection conn = dataSource.getConnection()) {
try {
- connection.setAutoCommit(false);
- connection.createStatement().executeUpdate("INSERT INTO
t_order_item (order_id, user_id, phone, status) VALUES (2024, 2024,
'13800000001', 'INSERT_TEST')");
- connection.createStatement().executeUpdate("INSERT INTO
t_order_item_does_not_exist (test_id_does_not_exist) VALUES (2024)");
- connection.commit();
+ conn.setAutoCommit(false);
+ conn.createStatement().executeUpdate("INSERT INTO t_order_item
(order_id, user_id, phone, status) VALUES (2024, 2024, '13800000001',
'INSERT_TEST')");
+ conn.createStatement().executeUpdate("INSERT INTO
t_order_item_does_not_exist (test_id_does_not_exist) VALUES (2024)");
+ conn.commit();
} catch (final SQLException ignored) {
- connection.rollback();
+ conn.rollback();
} finally {
- connection.setAutoCommit(true);
+ conn.setAutoCommit(true);
}
}
- try (
- Connection conn = dataSource.getConnection();
- ResultSet resultSet =
conn.createStatement().executeQuery("SELECT * FROM t_order_item WHERE user_id =
2024")) {
+ try (Connection conn = dataSource.getConnection()) {
+ ResultSet resultSet = conn.createStatement().executeQuery("SELECT
* FROM t_order_item WHERE user_id = 2024");
assertThat(resultSet.next(), is(false));
}
+ try (Connection conn = dataSource.getConnection()) {
+ try {
+ conn.setAutoCommit(false);
+ conn.createStatement().executeUpdate("INSERT INTO t_order_item
(order_id, user_id, phone, status) VALUES (2025, 2025, '13800000001',
'INSERT_TEST')");
+ conn.commit();
+ } catch (final SQLException ignored) {
+ conn.rollback();
+ } finally {
+ conn.setAutoCommit(true);
+ }
+ }
+ try (Connection conn = dataSource.getConnection()) {
+ ResultSet resultSet = conn.createStatement().executeQuery("SELECT
* FROM t_order_item WHERE user_id = 2025");
+ assertThat(resultSet.next(), is(true));
+ }
}
}
diff --git
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java
index 593b541a96f..3a7c6a2f73d 100644
---
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java
+++
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java
@@ -19,9 +19,6 @@ package org.apache.shardingsphere.test.natived.jdbc.databases;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.retry.ExponentialBackoffRetry;
import
org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection;
import org.apache.shardingsphere.infra.database.core.DefaultDatabase;
import
org.apache.shardingsphere.infra.metadata.database.resource.unit.StorageUnit;
@@ -33,13 +30,10 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledInNativeImage;
import org.testcontainers.containers.GenericContainer;
-import org.testcontainers.containers.Network;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
-import org.testcontainers.utility.MountableFile;
import javax.sql.DataSource;
-import java.nio.file.Paths;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
@@ -61,25 +55,9 @@ import static org.hamcrest.Matchers.nullValue;
@Testcontainers
class ClickHouseTest {
- private final Network network = Network.newNetwork();
-
- @Container
- private final GenericContainer<?> clickhouseKeeperContainer = new
GenericContainer<>("clickhouse/clickhouse-keeper:24.11.1.2557")
- .withCopyFileToContainer(
-
MountableFile.forHostPath(Paths.get("src/test/resources/test-native/xml/keeper_config.xml").toAbsolutePath()),
- "/etc/clickhouse-keeper/keeper_config.xml")
- .withNetwork(network)
- .withExposedPorts(9181)
- .withNetworkAliases("clickhouse-keeper-01");
-
@Container
private final GenericContainer<?> container = new
GenericContainer<>("clickhouse/clickhouse-server:24.11.1.2557")
- .withCopyFileToContainer(
-
MountableFile.forHostPath(Paths.get("src/test/resources/test-native/xml/transactions.xml").toAbsolutePath()),
- "/etc/clickhouse-server/config.d/transactions.xml")
- .withNetwork(network)
- .withExposedPorts(8123)
- .dependsOn(clickhouseKeeperContainer);
+ .withExposedPorts(8123);
private final String systemPropKeyPrefix =
"fixture.test-native.yaml.database.clickhouse.";
@@ -103,7 +81,6 @@ class ClickHouseTest {
}
contextManager.close();
}
- network.close();
System.clearProperty(systemPropKeyPrefix + "ds0.jdbc-url");
System.clearProperty(systemPropKeyPrefix + "ds1.jdbc-url");
System.clearProperty(systemPropKeyPrefix + "ds2.jdbc-url");
@@ -125,13 +102,7 @@ class ClickHouseTest {
}
private DataSource createDataSource() throws SQLException {
- String connectionString = clickhouseKeeperContainer.getHost() + ":" +
clickhouseKeeperContainer.getMappedPort(9181);
Awaitility.await().atMost(Duration.ofMinutes(1L)).ignoreExceptions().until(()
-> {
- try (
- CuratorFramework client =
CuratorFrameworkFactory.builder().connectString(connectionString)
- .retryPolicy(new ExponentialBackoffRetry(1000,
3)).build()) {
- client.start();
- }
openConnection("default").close();
return true;
});
@@ -146,9 +117,9 @@ class ClickHouseTest {
HikariConfig config = new HikariConfig();
config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver");
config.setJdbcUrl("jdbc:shardingsphere:classpath:test-native/yaml/jdbc/databases/clickhouse.yaml?placeholder-type=system_props");
- System.setProperty(systemPropKeyPrefix + "ds0.jdbc-url", jdbcUrlPrefix
+ "demo_ds_0?transactionSupport=true");
- System.setProperty(systemPropKeyPrefix + "ds1.jdbc-url", jdbcUrlPrefix
+ "demo_ds_1?transactionSupport=true");
- System.setProperty(systemPropKeyPrefix + "ds2.jdbc-url", jdbcUrlPrefix
+ "demo_ds_2?transactionSupport=true");
+ System.setProperty(systemPropKeyPrefix + "ds0.jdbc-url", jdbcUrlPrefix
+ "demo_ds_0");
+ System.setProperty(systemPropKeyPrefix + "ds1.jdbc-url", jdbcUrlPrefix
+ "demo_ds_1");
+ System.setProperty(systemPropKeyPrefix + "ds2.jdbc-url", jdbcUrlPrefix
+ "demo_ds_2");
return new HikariDataSource(config);
}
diff --git
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/FirebirdTest.java
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/FirebirdTest.java
index 83e867ea0ab..4e8dddbd132 100644
---
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/FirebirdTest.java
+++
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/FirebirdTest.java
@@ -56,7 +56,7 @@ class FirebirdTest {
@SuppressWarnings("resource")
@Container
- private final GenericContainer<?> container = new
GenericContainer<>("ghcr.io/fdcastel/firebird:5.0.1")
+ private final GenericContainer<?> container = new
GenericContainer<>("firebirdsql/firebird:5.0.1")
.withEnv("FIREBIRD_ROOT_PASSWORD", password)
.withEnv("FIREBIRD_USER", "alice")
.withEnv("FIREBIRD_PASSWORD", password)
diff --git
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/databases/MySQLTest.java
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/databases/MySQLTest.java
index 33ad7b441ac..6b868b6c4ca 100644
---
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/databases/MySQLTest.java
+++
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/databases/MySQLTest.java
@@ -96,37 +96,37 @@ class MySQLTest {
statement.execute("CREATE DATABASE sharding_db");
statement.execute("USE sharding_db");
statement.execute("REGISTER STORAGE UNIT ds_0 (\n"
- + " URL=\"jdbc:mysql://127.0.0.1:" +
mysqlContainer.getMappedPort(3306) + "/demo_ds_0\",\n"
- + " USER=\"root\",\n"
- + " PASSWORD=\"yourStrongPassword123!\"\n"
+ + " URL='jdbc:mysql://127.0.0.1:" +
mysqlContainer.getMappedPort(3306) + "/demo_ds_0',\n"
+ + " USER='root',\n"
+ + " PASSWORD='yourStrongPassword123!'\n"
+ "),ds_1 (\n"
- + " URL=\"jdbc:mysql://127.0.0.1:" +
mysqlContainer.getMappedPort(3306) + "/demo_ds_1\",\n"
- + " USER=\"root\",\n"
- + " PASSWORD=\"yourStrongPassword123!\"\n"
+ + " URL='jdbc:mysql://127.0.0.1:" +
mysqlContainer.getMappedPort(3306) + "/demo_ds_1',\n"
+ + " USER='root',\n"
+ + " PASSWORD='yourStrongPassword123!'\n"
+ "),ds_2 (\n"
- + " URL=\"jdbc:mysql://127.0.0.1:" +
mysqlContainer.getMappedPort(3306) + "/demo_ds_2\",\n"
- + " USER=\"root\",\n"
- + " PASSWORD=\"yourStrongPassword123!\"\n"
+ + " URL='jdbc:mysql://127.0.0.1:" +
mysqlContainer.getMappedPort(3306) + "/demo_ds_2',\n"
+ + " USER='root',\n"
+ + " PASSWORD='yourStrongPassword123!'\n"
+ ")");
statement.execute("CREATE DEFAULT SHARDING DATABASE STRATEGY (\n"
- + " TYPE=\"standard\", \n"
+ + " TYPE='standard', \n"
+ " SHARDING_COLUMN=user_id, \n"
+ " SHARDING_ALGORITHM(\n"
+ " TYPE(\n"
+ " NAME=CLASS_BASED, \n"
+ " PROPERTIES(\n"
- + " \"strategy\"=\"STANDARD\",\n"
- + "
\"algorithmClassName\"=\"org.apache.shardingsphere.test.natived.commons.algorithm.ClassBasedInlineShardingAlgorithmFixture\"\n"
+ + " 'strategy'='STANDARD',\n"
+ + "
'algorithmClassName'='org.apache.shardingsphere.test.natived.commons.algorithm.ClassBasedInlineShardingAlgorithmFixture'\n"
+ " )\n"
+ " )\n"
+ " )\n"
+ ")");
statement.execute("CREATE SHARDING TABLE RULE t_order (\n"
- + " DATANODES(\"<LITERAL>ds_0.t_order, ds_1.t_order,
ds_2.t_order\"),\n"
- + "
KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=\"SNOWFLAKE\"))\n"
+ + " DATANODES('<LITERAL>ds_0.t_order, ds_1.t_order,
ds_2.t_order'),\n"
+ + "
KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME='SNOWFLAKE'))\n"
+ "), t_order_item (\n"
- + " DATANODES(\"<LITERAL>ds_0.t_order_item,
ds_1.t_order_item, ds_2.t_order_item\"),\n"
- + "
KEY_GENERATE_STRATEGY(COLUMN=order_item_id,TYPE(NAME=\"SNOWFLAKE\"))\n"
+ + " DATANODES('<LITERAL>ds_0.t_order_item,
ds_1.t_order_item, ds_2.t_order_item'),\n"
+ + "
KEY_GENERATE_STRATEGY(COLUMN=order_item_id,TYPE(NAME='SNOWFLAKE'))\n"
+ ")");
statement.execute("CREATE BROADCAST TABLE RULE t_address");
}
diff --git
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/databases/PostgresTest.java
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/databases/PostgresTest.java
index ab8511fcb48..05acc997fdb 100644
---
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/databases/PostgresTest.java
+++
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/databases/PostgresTest.java
@@ -96,37 +96,37 @@ class PostgresTest {
Connection connection = openConnection("root", "root",
"jdbc:postgresql://127.0.0.1:" + proxyTestingServer.getProxyPort() +
"/sharding_db");
Statement statement = connection.createStatement()) {
statement.execute("REGISTER STORAGE UNIT ds_0 (\n"
- + " URL=\"jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_0\",\n"
- + " USER=\"test\",\n"
- + " PASSWORD=\"test\"\n"
+ + " URL='jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_0',\n"
+ + " USER='test',\n"
+ + " PASSWORD='test'\n"
+ "),ds_1 (\n"
- + " URL=\"jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_1\",\n"
- + " USER=\"test\",\n"
- + " PASSWORD=\"test\"\n"
+ + " URL='jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_1',\n"
+ + " USER='test',\n"
+ + " PASSWORD='test'\n"
+ "),ds_2 (\n"
- + " URL=\"jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_2\",\n"
- + " USER=\"test\",\n"
- + " PASSWORD=\"test\"\n"
+ + " URL='jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_2',\n"
+ + " USER='test',\n"
+ + " PASSWORD='test'\n"
+ ")");
statement.execute("CREATE DEFAULT SHARDING DATABASE STRATEGY (\n"
- + " TYPE=\"standard\", \n"
+ + " TYPE='standard', \n"
+ " SHARDING_COLUMN=user_id, \n"
+ " SHARDING_ALGORITHM(\n"
+ " TYPE(\n"
+ " NAME=CLASS_BASED, \n"
+ " PROPERTIES(\n"
- + " \"strategy\"=\"STANDARD\",\n"
- + "
\"algorithmClassName\"=\"org.apache.shardingsphere.test.natived.commons.algorithm.ClassBasedInlineShardingAlgorithmFixture\"\n"
+ + " 'strategy'='STANDARD',\n"
+ + "
'algorithmClassName'='org.apache.shardingsphere.test.natived.commons.algorithm.ClassBasedInlineShardingAlgorithmFixture'\n"
+ " )\n"
+ " )\n"
+ " )\n"
+ ")");
statement.execute("CREATE SHARDING TABLE RULE t_order (\n"
- + " DATANODES(\"<LITERAL>ds_0.t_order, ds_1.t_order,
ds_2.t_order\"),\n"
- + "
KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=\"SNOWFLAKE\"))\n"
+ + " DATANODES('<LITERAL>ds_0.t_order, ds_1.t_order,
ds_2.t_order'),\n"
+ + "
KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME='SNOWFLAKE'))\n"
+ "), t_order_item (\n"
- + " DATANODES(\"<LITERAL>ds_0.t_order_item,
ds_1.t_order_item, ds_2.t_order_item\"),\n"
- + "
KEY_GENERATE_STRATEGY(COLUMN=order_item_id,TYPE(NAME=\"SNOWFLAKE\"))\n"
+ + " DATANODES('<LITERAL>ds_0.t_order_item,
ds_1.t_order_item, ds_2.t_order_item'),\n"
+ + "
KEY_GENERATE_STRATEGY(COLUMN=order_item_id,TYPE(NAME='SNOWFLAKE'))\n"
+ ")");
statement.execute("CREATE BROADCAST TABLE RULE t_address");
}
diff --git
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/transactions/base/SeataTest.java
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/transactions/base/SeataTest.java
index 7f0f8996ef7..4cbd3873915 100644
---
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/transactions/base/SeataTest.java
+++
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/proxy/transactions/base/SeataTest.java
@@ -122,37 +122,37 @@ class SeataTest {
Connection connection = openConnection("root", "root",
"jdbc:postgresql://127.0.0.1:" + proxyTestingServer.getProxyPort() +
"/sharding_db");
Statement statement = connection.createStatement()) {
statement.execute("REGISTER STORAGE UNIT ds_0 (\n"
- + " URL=\"jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_0\",\n"
- + " USER=\"test\",\n"
- + " PASSWORD=\"test\"\n"
+ + " URL='jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_0',\n"
+ + " USER='test',\n"
+ + " PASSWORD='test'\n"
+ "),ds_1 (\n"
- + " URL=\"jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_1\",\n"
- + " USER=\"test\",\n"
- + " PASSWORD=\"test\"\n"
+ + " URL='jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_1',\n"
+ + " USER='test',\n"
+ + " PASSWORD='test'\n"
+ "),ds_2 (\n"
- + " URL=\"jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_2\",\n"
- + " USER=\"test\",\n"
- + " PASSWORD=\"test\"\n"
+ + " URL='jdbc:postgresql://127.0.0.1:" +
postgresContainer.getMappedPort(5432) + "/demo_ds_2',\n"
+ + " USER='test',\n"
+ + " PASSWORD='test'\n"
+ ")");
statement.execute("CREATE DEFAULT SHARDING DATABASE STRATEGY (\n"
- + " TYPE=\"standard\", \n"
+ + " TYPE='standard', \n"
+ " SHARDING_COLUMN=user_id, \n"
+ " SHARDING_ALGORITHM(\n"
+ " TYPE(\n"
+ " NAME=CLASS_BASED, \n"
+ " PROPERTIES(\n"
- + " \"strategy\"=\"STANDARD\",\n"
- + "
\"algorithmClassName\"=\"org.apache.shardingsphere.test.natived.commons.algorithm.ClassBasedInlineShardingAlgorithmFixture\"\n"
+ + " 'strategy'='STANDARD',\n"
+ + "
'algorithmClassName'='org.apache.shardingsphere.test.natived.commons.algorithm.ClassBasedInlineShardingAlgorithmFixture'\n"
+ " )\n"
+ " )\n"
+ " )\n"
+ ")");
statement.execute("CREATE SHARDING TABLE RULE t_order (\n"
- + " DATANODES(\"<LITERAL>ds_0.t_order, ds_1.t_order,
ds_2.t_order\"),\n"
- + "
KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=\"SNOWFLAKE\"))\n"
+ + " DATANODES('<LITERAL>ds_0.t_order, ds_1.t_order,
ds_2.t_order'),\n"
+ + "
KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME='SNOWFLAKE'))\n"
+ "), t_order_item (\n"
- + " DATANODES(\"<LITERAL>ds_0.t_order_item,
ds_1.t_order_item, ds_2.t_order_item\"),\n"
- + "
KEY_GENERATE_STRATEGY(COLUMN=order_item_id,TYPE(NAME=\"SNOWFLAKE\"))\n"
+ + " DATANODES('<LITERAL>ds_0.t_order_item,
ds_1.t_order_item, ds_2.t_order_item'),\n"
+ + "
KEY_GENERATE_STRATEGY(COLUMN=order_item_id,TYPE(NAME='SNOWFLAKE'))\n"
+ ")");
statement.execute("CREATE BROADCAST TABLE RULE t_address");
}
diff --git
a/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/resource-config.json
b/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/resource-config.json
index 0f6f4683a75..5a22d077ea7 100644
---
a/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/resource-config.json
+++
b/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/resource-config.json
@@ -6,9 +6,6 @@
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.test.natived.jdbc.transactions.base.SeataTest"},
"pattern":".*test-native/sql/.+\\.sql$"
- }, {
-
"condition":{"typeReachable":"org.apache.shardingsphere.test.natived.jdbc.databases.ClickHouseTest"},
- "pattern":".*test-native/xml/.+\\.xml$"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.test.natived.jdbc.databases.SQLServerTest"},
"pattern":"\\Qcontainer-license-acceptance.txt\\E"
diff --git a/test/native/src/test/resources/test-native/xml/keeper_config.xml
b/test/native/src/test/resources/test-native/xml/keeper_config.xml
deleted file mode 100644
index 2a7d254adfa..00000000000
--- a/test/native/src/test/resources/test-native/xml/keeper_config.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
- ~ 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.
- -->
-<clickhouse replace="true">
- <listen_host>0.0.0.0</listen_host>
- <keeper_server>
- <tcp_port>9181</tcp_port>
- <server_id>1</server_id>
-
<snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path>
- <raft_configuration>
- <server>
- <id>1</id>
- <hostname>clickhouse-keeper-01</hostname>
- <port>9234</port>
- </server>
- </raft_configuration>
- </keeper_server>
-</clickhouse>
diff --git a/test/native/src/test/resources/test-native/xml/transactions.xml
b/test/native/src/test/resources/test-native/xml/transactions.xml
deleted file mode 100644
index 1c54dd5f003..00000000000
--- a/test/native/src/test/resources/test-native/xml/transactions.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
- ~ 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.
- -->
-<clickhouse>
- <allow_experimental_transactions>1</allow_experimental_transactions>
- <zookeeper>
- <node index="1">
- <host>clickhouse-keeper-01</host>
- <port>9181</port>
- </node>
- </zookeeper>
-</clickhouse>