You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by yx...@apache.org on 2024/11/20 16:20:15 UTC
(shardingsphere) branch master updated: Fixes the outdated description of Key Generation and Hadoop in HiveServer2 integration doc (#33739)
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 8722823a8d8 Fixes the outdated description of Key Generation and Hadoop in HiveServer2 integration doc (#33739)
8722823a8d8 is described below
commit 8722823a8d8cd770ec3b493858a08d490cb3560c
Author: Ling Hengqian <li...@outlook.com>
AuthorDate: Thu Nov 21 00:20:08 2024 +0800
Fixes the outdated description of Key Generation and Hadoop in HiveServer2 integration doc (#33739)
---
.../optional-plugins/hiveserver2/_index.cn.md | 39 ++++++------------
.../optional-plugins/hiveserver2/_index.en.md | 38 ++++++-----------
.../reflect-config.json | 11 ++---
.../test/natived/commons/TestShardingService.java | 48 +++-------------------
.../commons/repository/OrderItemRepository.java | 1 +
.../commons/repository/OrderRepository.java | 21 ----------
.../natived/jdbc/transactions/base/SeataTest.java | 4 --
.../yaml/jdbc/databases/clickhouse.yaml | 4 +-
.../test-native/yaml/jdbc/databases/hive.yaml | 4 +-
.../test-native/yaml/jdbc/databases/mysql.yaml | 4 +-
.../test-native/yaml/jdbc/databases/opengauss.yaml | 4 +-
.../yaml/jdbc/databases/postgresql.yaml | 4 +-
.../test-native/yaml/jdbc/databases/sqlserver.yaml | 4 +-
.../test-native/yaml/jdbc/features/encrypt.yaml | 4 +-
.../test-native/yaml/jdbc/features/mask.yaml | 4 +-
.../yaml/jdbc/features/readwrite-splitting.yaml | 12 +++---
.../test-native/yaml/jdbc/features/shadow.yaml | 8 ++--
.../test-native/yaml/jdbc/features/sharding.yaml | 16 ++++----
.../test-native/yaml/jdbc/modes/cluster/etcd.yaml | 16 ++++----
.../yaml/jdbc/modes/cluster/zookeeper.yaml | 16 ++++----
.../yaml/jdbc/transactions/base/seata.yaml | 4 +-
.../yaml/jdbc/transactions/xa/atomikos.yaml | 16 ++++----
.../yaml/jdbc/transactions/xa/narayana.yaml | 4 +-
23 files changed, 98 insertions(+), 188 deletions(-)
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 8279de4ed99..b87f156a0df 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
@@ -40,11 +40,6 @@ ShardingSphere 对 HiveServer2 JDBC Driver 的支持位于可选模块中。
<artifactId>hive-service</artifactId>
<version>4.0.1</version>
</dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-client-api</artifactId>
- <version>3.3.6</version>
- </dependency>
</dependencies>
```
@@ -185,30 +180,30 @@ rules:
### 享受集成
-创建 ShardingSphere 的数据源,
+创建 ShardingSphere 的数据源以享受集成,
```java
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
-import javax.sql.DataSource;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
public class ExampleUtils {
- DataSource createDataSource() {
+ void test() throws SQLException {
HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:shardingsphere:classpath:demo.yaml");
config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver");
- return new HikariDataSource(config);
+ try (HikariDataSource dataSource = new HikariDataSource(config);
+ Connection connection = dataSource.getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("INSERT INTO t_order (user_id, order_type, address_id, status) VALUES (1, 1, 1, 'INSERT_TEST')");
+ statement.executeQuery("SELECT * FROM t_order");
+ statement.execute("DELETE FROM t_order WHERE order_id=1");
+ }
}
}
```
-可直接在此`javax.sql.DataSource`相关的 ShardingSphere DataSource 上执行逻辑 SQL,享受它,
-
-```sql
--- noinspection SqlNoDataSourceInspectionForFile
-INSERT INTO t_order (user_id, order_type, address_id, status) VALUES (1, 1, 1, "INSERT_TEST");
-DELETE FROM t_order WHERE order_id=1;
-```
-
## 使用限制
### 版本限制
@@ -258,16 +253,6 @@ ShardingSphere 当前对参数的解析仅支持以`jdbc:hive2://localhost:10000
若用户需使用`;sess_var_list`或`#hive_var_list`的 jdbcURL 参数,考虑为 ShardingSphere 提交包含单元测试的 PR。
-
-### 分布式序列限制
-
-由于 `org.apache.hive.jdbc.HiveStatement` 未实现 `java.sql.Statement#getGeneratedKeys()`,
-ShardingSphere JDBC Connection 无法通过 `java.sql.Statement.RETURN_GENERATED_KEYS` 获得 ShardingSphere 生成的雪花 ID 等分布式序列。
-
-若用户需要通过 `java.sql.Statement.RETURN_GENERATED_KEYS` 从 HiveServer2 获得 ShardingSphere 生成的雪花 ID 等分布式序列,
-用户应当考虑在 Hive 的主分支实现 `java.sql.DatabaseMetaData#getURL()`,
-而不是尝试修改 ShardingSphere 的内部类。
-
### 在 ShardingSphere 数据源上使用 DML SQL 语句的前提条件
为了能够使用 `delete` 等 DML SQL 语句,当连接到 HiveServer2 时,用户应当考虑在 ShardingSphere JDBC 中仅使用支持 ACID 的表。
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 14ef61ba7ac..610c7c55ea4 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
@@ -41,11 +41,6 @@ The possible Maven dependencies are as follows.
<artifactId>hive-service</artifactId>
<version>4.0.1</version>
</dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-client-api</artifactId>
- <version>3.3.6</version>
- </dependency>
</dependencies>
```
@@ -188,30 +183,30 @@ rules:
### Enjoy the integration
-Create a ShardingSphere data source,
+Create a ShardingSphere data source to enjoy the integration.
```java
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
-import javax.sql.DataSource;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
public class ExampleUtils {
- DataSource createDataSource() {
+ void test() throws SQLException {
HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:shardingsphere:classpath:demo.yaml");
config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver");
- return new HikariDataSource(config);
+ try (HikariDataSource dataSource = new HikariDataSource(config);
+ Connection connection = dataSource.getConnection();
+ Statement statement = connection.createStatement()) {
+ statement.execute("INSERT INTO t_order (user_id, order_type, address_id, status) VALUES (1, 1, 1, 'INSERT_TEST')");
+ statement.executeQuery("SELECT * FROM t_order");
+ statement.execute("DELETE FROM t_order WHERE order_id=1");
+ }
}
}
```
-You can directly execute logical SQL on the ShardingSphere DataSource related to this `javax.sql.DataSource`, enjoy it,
-
-```sql
--- noinspection SqlNoDataSourceInspectionForFile
-INSERT INTO t_order (user_id, order_type, address_id, status) VALUES (1, 1, 1, "INSERT_TEST");
-DELETE FROM t_order WHERE order_id=1;
-```
-
## Usage Restrictions
### Version Restrictions
@@ -265,15 +260,6 @@ ShardingSphere currently only supports the `;hive_conf_list` part represented by
If users need to use the jdbcURL parameters of `;sess_var_list` or `#hive_var_list`,
consider submitting a PR containing unit tests for ShardingSphere.
-### Distributed sequence limitations
-
-Since `org.apache.hive.jdbc.HiveStatement` does not implement `java.sql.Statement#getGeneratedKeys()`,
-ShardingSphere JDBC Connection cannot obtain distributed sequences such as Snowflake ID generated by ShardingSphere through `java.sql.Statement.RETURN_GENERATED_KEYS`.
-
-If users need to obtain distributed sequences such as Snowflake ID generated by ShardingSphere from HiveServer2 through `java.sql.Statement.RETURN_GENERATED_KEYS`,
-users should consider implementing `java.sql.DatabaseMetaData#getURL()` in the main branch of Hive,
-rather than trying to modify the internal classes of ShardingSphere.
-
### Prerequisites for using DML SQL statements on ShardingSphere data sources
In order to be able to use DML SQL statements such as `delete`,
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 7ec9d7b5ed2..a5d2b3f54bd 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
@@ -71,10 +71,6 @@
"condition":{"typeReachable":"org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository"},
"name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;"
},
-{
- "condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.connector.jdbc.datasource.JDBCBackendDataSource"},
- "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;"
-},
{
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal"},
"name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;"
@@ -696,6 +692,11 @@
"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",
@@ -2074,7 +2075,7 @@
"queryAllDeclaredMethods":true
},
{
- "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.listener.DatabaseMetaDataChangedListener$$Lambda/0x00007f619fb277d8"},
+ "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.listener.DatabaseMetaDataChangedListener$$Lambda/0x00007f401fb273a8"},
"name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.MetaDataChangedSubscriber"
},
{
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 82627ea5d5b..8a53808f55a 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
@@ -128,16 +128,16 @@ public final class TestShardingService {
* Process success in Hive.
* Hive has not fully supported BEGIN, COMMIT, and ROLLBACK. Refer to <a href="https://cwiki.apache.org/confluence/display/Hive/Hive+Transactions">Hive Transactions</a>.
* So ShardingSphere should not use {@link OrderItemRepository#assertRollbackWithTransactions()}
- * TODO It looks like HiveServer2 insert and delete statements are inserted out of order. Waiting for further investigation.
+ * TODO It looks like HiveServer2 insert statements are inserted out of order. Waiting for further investigation.
* The result of the insert is not currently asserted.
- * TODO It is currently not convenient to operate on the `t_order` and `t_order_item` tables because
- * {@link org.apache.hive.jdbc.HiveStatement} does not implement {@link org.apache.hive.jdbc.HiveStatement#getGeneratedKeys()}
*
* @throws SQLException An exception that provides information on a database access error or other errors.
*/
public void processSuccessInHive() throws SQLException {
- insertDataInHive();
- deleteDataInHive();
+ final Collection<Long> orderIds = insertData(Statement.RETURN_GENERATED_KEYS);
+ deleteData(orderIds);
+ assertThat(orderRepository.selectAll(), equalTo(Collections.emptyList()));
+ assertThat(orderItemRepository.selectAll(), equalTo(Collections.emptyList()));
assertThat(addressRepository.selectAll(), equalTo(Collections.emptyList()));
}
@@ -173,30 +173,6 @@ public final class TestShardingService {
return result;
}
- /**
- * Insert data in Hive.
- * {@link org.apache.hive.jdbc.HiveStatement} does not implement {@link java.sql.Statement#getGeneratedKeys()},
- * so the snowflake ID generated by ShardingSphere cannot be obtained.
- */
- public void insertDataInHive() {
- IntStream.range(1, 11).forEach(this::insertSingleDataInHive);
- }
-
- private void insertSingleDataInHive(final int action) {
- Order order = new Order();
- order.setUserId(action);
- order.setOrderType(action % 2);
- order.setAddressId(action);
- order.setStatus("INSERT_TEST");
- Address address = new Address((long) action, "address_test_" + action);
- try {
- orderRepository.insertInHive(order);
- addressRepository.insert(address);
- } catch (final SQLException ex) {
- throw new RuntimeException(ex);
- }
- }
-
/**
* Delete data.
*
@@ -227,20 +203,6 @@ public final class TestShardingService {
}
}
- /**
- * Delete data in Hive.
- */
- public void deleteDataInHive() {
- LongStream.range(1, 11).forEach(action -> {
- try {
- orderRepository.delete(action);
- addressRepository.delete(action);
- } catch (final SQLException exception) {
- throw new RuntimeException(exception);
- }
- });
- }
-
/**
* Clean environment.
*
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 7eb5bfbbc8f..ce58a765bd0 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
@@ -243,6 +243,7 @@ public final class OrderItemRepository {
* @return orderItemId of the insert statement
* @throws SQLException SQL exception
*/
+ @SuppressWarnings("MagicConstant")
public Long insert(final OrderItem orderItem, final int autoGeneratedKeys) throws SQLException {
String sql = "INSERT INTO t_order_item (order_id, user_id, phone, status) VALUES (?, ?, ?, ?)";
try (
diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/repository/OrderRepository.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/repository/OrderRepository.java
index d4f28c41c0a..30fdd662568 100644
--- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/repository/OrderRepository.java
+++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/repository/OrderRepository.java
@@ -289,27 +289,6 @@ public final class OrderRepository {
return order.getOrderId();
}
- /**
- * insert Order to table in HiveServer2.
- * {@link org.apache.hive.jdbc.HiveStatement} does not implement {@link java.sql.Statement#getGeneratedKeys()},
- * so the snowflake ID generated by ShardingSphere cannot be obtained.
- *
- * @param order order
- * @throws SQLException SQL Exception
- */
- public void insertInHive(final Order order) throws SQLException {
- String sql = "INSERT INTO t_order (user_id, order_type, address_id, status) VALUES (?, ?, ?, ?)";
- try (
- Connection connection = dataSource.getConnection();
- PreparedStatement preparedStatement = connection.prepareStatement(sql, Statement.NO_GENERATED_KEYS)) {
- preparedStatement.setInt(1, order.getUserId());
- preparedStatement.setInt(2, order.getOrderType());
- preparedStatement.setLong(3, order.getAddressId());
- preparedStatement.setString(4, order.getStatus());
- preparedStatement.executeUpdate();
- }
- }
-
/**
* delete by orderId.
*
diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/base/SeataTest.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/base/SeataTest.java
index 789cc425d7e..e9c9e29d1fc 100644
--- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/base/SeataTest.java
+++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/base/SeataTest.java
@@ -21,7 +21,6 @@ import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import org.apache.http.HttpStatus;
import org.apache.shardingsphere.test.natived.commons.TestShardingService;
-import org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -33,7 +32,6 @@ import org.testcontainers.junit.jupiter.Testcontainers;
import javax.sql.DataSource;
import java.sql.SQLException;
-import java.time.Duration;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
@@ -68,12 +66,10 @@ class SeataTest {
/**
* TODO Just checking `/health` of `7091` port of Seata Server is not enough to indicate that Seata Server is ready.
- * The use of {@code Awaitility.await().pollDelay(Duration.ofSeconds(9L)).until(() -> true);} needs to be removed.
* @throws SQLException An exception that provides information on a database access error or other errors.
*/
@Test
void assertShardingInSeataTransactions() throws SQLException {
- Awaitility.await().pollDelay(Duration.ofSeconds(9L)).until(() -> true);
DataSource dataSource = createDataSource(CONTAINER.getMappedPort(8091));
testShardingService = new TestShardingService(dataSource);
initEnvironment();
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/databases/clickhouse.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/databases/clickhouse.yaml
index 5d62805858a..dccec281475 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/databases/clickhouse.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/databases/clickhouse.yaml
@@ -44,12 +44,12 @@ rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/databases/hive.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/databases/hive.yaml
index 5cff80297e9..c999127daec 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/databases/hive.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/databases/hive.yaml
@@ -38,12 +38,12 @@ rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/databases/mysql.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/databases/mysql.yaml
index 93bd77375d9..5291896aa4e 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/databases/mysql.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/databases/mysql.yaml
@@ -44,12 +44,12 @@ rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/databases/opengauss.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/databases/opengauss.yaml
index fe57af27086..a3e6b8d9376 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/databases/opengauss.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/databases/opengauss.yaml
@@ -44,12 +44,12 @@ rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/databases/postgresql.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/databases/postgresql.yaml
index 80ca30c249d..e6415b5a8ab 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/databases/postgresql.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/databases/postgresql.yaml
@@ -38,12 +38,12 @@ rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/databases/sqlserver.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/databases/sqlserver.yaml
index 3cc6b019680..2a0f7518c06 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/databases/sqlserver.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/databases/sqlserver.yaml
@@ -38,12 +38,12 @@ rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/features/encrypt.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/features/encrypt.yaml
index cab9498b954..f5264168e18 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/features/encrypt.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/features/encrypt.yaml
@@ -25,8 +25,8 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:local_encrypt_ds_0;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
rules:
- !ENCRYPT
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/features/mask.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/features/mask.yaml
index 6020ba6c1ca..948845285d4 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/features/mask.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/features/mask.yaml
@@ -25,8 +25,8 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:local_mask_ds_0;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
rules:
- !MASK
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/features/readwrite-splitting.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/features/readwrite-splitting.yaml
index 623e87ca950..dcf4c85f435 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/features/readwrite-splitting.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/features/readwrite-splitting.yaml
@@ -25,20 +25,20 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:local_readwrite_splitting_ds_0;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:local_readwrite_splitting_ds_1;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
ds_2:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:local_readwrite_splitting_ds_2;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
rules:
- !READWRITE_SPLITTING
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/features/shadow.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/features/shadow.yaml
index 3defd897e1a..89c73ad895f 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/features/shadow.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/features/shadow.yaml
@@ -25,14 +25,14 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:local_shadow_ds_0;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:local_shadow_ds_1;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
rules:
- !SHADOW
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/features/sharding.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/features/sharding.yaml
index 740db6101fb..3671c4176d2 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/features/sharding.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/features/sharding.yaml
@@ -25,31 +25,31 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:local_sharding_ds_0;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:local_sharding_ds_1;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
ds_2:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:local_sharding_ds_2;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/modes/cluster/etcd.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/modes/cluster/etcd.yaml
index 6ed94a9773a..e4bf8f4e41e 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/modes/cluster/etcd.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/modes/cluster/etcd.yaml
@@ -28,31 +28,31 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:cluster_etcd_ds_0;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:cluster_etcd_ds_1;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
ds_2:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:cluster_etcd_ds_2;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/modes/cluster/zookeeper.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/modes/cluster/zookeeper.yaml
index 55af6d82742..f778adc2643 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/modes/cluster/zookeeper.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/modes/cluster/zookeeper.yaml
@@ -28,31 +28,31 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:cluster_zookeeper_ds_0;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:cluster_zookeeper_ds_1;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
ds_2:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:cluster_zookeeper_ds_2;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/transactions/base/seata.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/transactions/base/seata.yaml
index 951823bf0cb..fdb7fd77ff3 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/transactions/base/seata.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/transactions/base/seata.yaml
@@ -38,12 +38,12 @@ rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/transactions/xa/atomikos.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/transactions/xa/atomikos.yaml
index cea747ea4b7..26efecf48d9 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/transactions/xa/atomikos.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/transactions/xa/atomikos.yaml
@@ -25,31 +25,31 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:xa_atomikos_sharding_ds_0;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:xa_atomikos_sharding_ds_1;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
ds_2:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: org.h2.Driver
jdbcUrl: jdbc:h2:mem:xa_atomikos_sharding_ds_2;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: root
- password: 123456
+ username: sa
+ password:
rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/transactions/xa/narayana.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/transactions/xa/narayana.yaml
index b599e1eb05f..5fa3628ef2f 100644
--- a/test/native/src/test/resources/test-native/yaml/jdbc/transactions/xa/narayana.yaml
+++ b/test/native/src/test/resources/test-native/yaml/jdbc/transactions/xa/narayana.yaml
@@ -44,12 +44,12 @@ rules:
- !SHARDING
tables:
t_order:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
t_order_item:
- actualDataNodes:
+ actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item, ds_2.t_order_item
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake