You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/12/08 04:48:25 UTC
[shardingsphere] branch master updated: Add it for sql hint. (#22727)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 9465aa5a27e Add it for sql hint. (#22727)
9465aa5a27e is described below
commit 9465aa5a27e527abc09a66b79c2150f9b7b0e5aa
Author: Chuxin Chen <ch...@qq.com>
AuthorDate: Thu Dec 8 12:48:18 2022 +0800
Add it for sql hint. (#22727)
* Add it for sql hint.
* Add it for sql hint.
* Add it for sql hint.
---
.../tbl/insert_into_t_product_with_hint.xml | 48 ++++++++++++++++++++++
.../cases/dml/dml-integration-test-cases.xml | 4 ++
.../rql/dataset/tbl/show_sharding_algorithms.xml | 1 +
.../rql/dataset/tbl/show_sharding_table_nodes.xml | 1 +
.../rql/dataset/tbl/show_sharding_table_rules.xml | 1 +
.../env/common/cluster/proxy/conf/server.yaml | 9 ++++
.../env/common/standalone/proxy/conf/server.yaml | 9 ++++
.../env/scenario/tbl/data/actual/dataset.xml | 28 +++++++++++++
.../data/actual/init-sql/mysql/01-actual-init.sql | 11 +++++
.../env/scenario/tbl/data/expected/dataset.xml | 28 +++++++++++++
.../expected/init-sql/mysql/01-expected-init.sql | 1 +
.../scenario/tbl/proxy/conf/mysql/config-tbl.yaml | 9 ++++
.../tbl/proxy/conf/opengauss/config-tbl.yaml | 9 ++++
.../tbl/proxy/conf/postgresql/config-tbl.yaml | 9 ++++
.../src/test/resources/env/scenario/tbl/rules.yaml | 9 ++++
15 files changed, 177 insertions(+)
diff --git a/test/e2e/suite/src/test/resources/cases/dml/dataset/tbl/insert_into_t_product_with_hint.xml b/test/e2e/suite/src/test/resources/cases/dml/dataset/tbl/insert_into_t_product_with_hint.xml
new file mode 100644
index 00000000000..0e3188e6533
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/dml/dataset/tbl/insert_into_t_product_with_hint.xml
@@ -0,0 +1,48 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset update-count="1">
+ <metadata data-nodes="tbl.t_product_${0..9}">
+ <column name="product_id" type="numeric" />
+ <column name="product_name" type="varchar" />
+ <column name="category_id" type="numeric" />
+ <column name="price" type="decimal" />
+ <column name="status" type="varchar" />
+ <column name="creation_date" type="datetime" />
+ </metadata>
+ <row data-node="tbl.t_product_1" values="1, qq coins, 2, 200, off sale, 2017-08-08" />
+ <row data-node="tbl.t_product_2" values="2, haier washing machine, 4, 3121, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_3" values="3, huawei mobile phones, 6, 6666, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_4" values="4, alibaba cloud cards, 2, 500, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_5" values="5, lenovo mobile phones, 6, 3200, off sale, 2017-08-08" />
+ <row data-node="tbl.t_product_6" values="6, moutai liquor, 8, 3200, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_7" values="7, baidu cloud cards, 2, 700, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_8" values="8, xiaomi mobile phones, 6, 2799, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_9" values="9, vivo mobile phones, 6, 2899, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_0" values="10, oppo mobile phones, 6, 2299, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_1" values="11, google mobile phones, 6, 3399, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_2" values="12, walmart wine, 8, 1000, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_3" values="13, amazon cloud cards, 2, 1000, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_4" values="14, apple mobile phones, 6, 8200, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_5" values="15, microsoft x-box, 9, 5000, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_6" values="16, dell xps, 10, 9000, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_7" values="17, johnson shampoo, 12, 30, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_8" values="18, intel cpu, 10, 1600, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_9" values="19, hp computer, 10, 4600, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_0" values="20, tesla model 3, 14, 324600, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_1" values="21, macbook2022, 4, 13999, on sale, 2022-08-08" />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/dml/dml-integration-test-cases.xml b/test/e2e/suite/src/test/resources/cases/dml/dml-integration-test-cases.xml
index 7424caeb96b..c96169bd520 100644
--- a/test/e2e/suite/src/test/resources/cases/dml/dml-integration-test-cases.xml
+++ b/test/e2e/suite/src/test/resources/cases/dml/dml-integration-test-cases.xml
@@ -312,4 +312,8 @@
<assertion parameters="3:int, 3.4028235E38:float, 1.7976931348623157E308:double" expected-data-file="insert_max_floating_point_values.xml" />
<assertion parameters="4:int, 1.4E-45:float, 4.9E-324:double" expected-data-file="insert_min_floating_point_values.xml" />
</test-case>
+
+ <test-case sql="/* SHARDINGSPHERE_HINT: t_product.SHARDING_TABLE_VALUE=1 */INSERT INTO t_product values (21, 'macbook2022', 4, 13999, 'on sale', '2022-08-08')" db-types="MySQL" scenario-types="tbl">
+ <assertion expected-data-file="insert_into_t_product_with_hint.xml" />
+ </test-case>
</integration-test-cases>
diff --git a/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_algorithms.xml b/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_algorithms.xml
index e446877c085..44f806b9f3c 100644
--- a/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_algorithms.xml
+++ b/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_algorithms.xml
@@ -24,4 +24,5 @@
<row values="it_standard_fixture| IT.STANDARD.FIXTURE| " />
<row values="table_inline_item_id| INLINE| algorithm-expression=t_order_item_federate_sharding_${item_id % 2}" />
<row values="table_inline_order_id| INLINE| algorithm-expression=t_order_federate_sharding_${order_id_sharding % 2},allow-range-query-with-inline-sharding=true" />
+ <row values="t_product_hint_inline| HINT_INLINE| algorithm-expression=t_product_${value}" />
</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_nodes.xml b/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_nodes.xml
index 4df86ae7fef..8b5a023b954 100644
--- a/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_nodes.xml
+++ b/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_nodes.xml
@@ -25,4 +25,5 @@
<row values="t_order_details| tbl.t_order_details_0, tbl.t_order_details_1, tbl.t_order_details_2, tbl.t_order_details_3, tbl.t_order_details_4, tbl.t_order_details_5, tbl.t_order_details_6, tbl.t_order_details_7, tbl.t_order_details_8, tbl.t_order_details_9" />
<row values="t_order_federate_sharding| tbl.t_order_federate_sharding_0, tbl.t_order_federate_sharding_1" />
<row values="t_order_item_federate_sharding| tbl.t_order_item_federate_sharding_0, tbl.t_order_item_federate_sharding_1" />
+ <row values="t_product| tbl.t_product_0, tbl.t_product_1, tbl.t_product_2, tbl.t_product_3, tbl.t_product_4, tbl.t_product_5, tbl.t_product_6, tbl.t_product_7, tbl.t_product_8, tbl.t_product_9" />
</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rules.xml b/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rules.xml
index 09be70f6faf..be92003e94e 100644
--- a/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rules.xml
+++ b/test/e2e/suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rules.xml
@@ -39,4 +39,5 @@
<row values="t_order_details| tbl.t_order_details_${0..9}| | | | | | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | | | " />
<row values="t_order_federate_sharding| tbl.t_order_federate_sharding_${0..1}| | | | | | STANDARD| order_id_sharding| INLINE| algorithm-expression=t_order_federate_sharding_${order_id_sharding % 2},allow-range-query-with-inline-sharding=true| | | | | " />
<row values="t_order_item_federate_sharding | tbl.t_order_item_federate_sharding_${0..1}| | | | | | STANDARD| item_id| INLINE| algorithm-expression=t_order_item_federate_sharding_${item_id % 2}| | | | | " />
+ <row values="t_product | tbl.t_product_${0..9}| | | | | | HINT| | HINT_INLINE| algorithm-expression=t_product_${value}| | | | | " />
</dataset>
diff --git a/test/e2e/suite/src/test/resources/env/common/cluster/proxy/conf/server.yaml b/test/e2e/suite/src/test/resources/env/common/cluster/proxy/conf/server.yaml
index 2175a2242bb..6029ddacb64 100644
--- a/test/e2e/suite/src/test/resources/env/common/cluster/proxy/conf/server.yaml
+++ b/test/e2e/suite/src/test/resources/env/common/cluster/proxy/conf/server.yaml
@@ -33,6 +33,15 @@ authority:
password: Proxy@123
privilege:
type: ALL_PERMITTED
+
+sqlParser:
+ sqlCommentParseEnabled: true
+ sqlStatementCache:
+ initialCapacity: 2000
+ maximumSize: 65535
+ parseTreeCache:
+ initialCapacity: 128
+ maximumSize: 1024
props:
max-connections-size-per-query: 1
diff --git a/test/e2e/suite/src/test/resources/env/common/standalone/proxy/conf/server.yaml b/test/e2e/suite/src/test/resources/env/common/standalone/proxy/conf/server.yaml
index 42230dbac3d..0b93085a85c 100644
--- a/test/e2e/suite/src/test/resources/env/common/standalone/proxy/conf/server.yaml
+++ b/test/e2e/suite/src/test/resources/env/common/standalone/proxy/conf/server.yaml
@@ -34,6 +34,15 @@ authority:
privilege:
type: ALL_PERMITTED
+sqlParser:
+ sqlCommentParseEnabled: true
+ sqlStatementCache:
+ initialCapacity: 2000
+ maximumSize: 65535
+ parseTreeCache:
+ initialCapacity: 128
+ maximumSize: 1024
+
props:
max-connections-size-per-query: 1
kernel-executor-size: 16 # Infinite by default.
diff --git a/test/e2e/suite/src/test/resources/env/scenario/tbl/data/actual/dataset.xml b/test/e2e/suite/src/test/resources/env/scenario/tbl/data/actual/dataset.xml
index 9b819ef2211..25f5688f164 100644
--- a/test/e2e/suite/src/test/resources/env/scenario/tbl/data/actual/dataset.xml
+++ b/test/e2e/suite/src/test/resources/env/scenario/tbl/data/actual/dataset.xml
@@ -53,6 +53,14 @@
<column name="status" type="varchar" />
<column name="remarks" type="varchar" />
</metadata>
+ <metadata data-nodes="tbl.t_product_${0..9}">
+ <column name="product_id" type="numeric" />
+ <column name="product_name" type="varchar" />
+ <column name="category_id" type="numeric" />
+ <column name="price" type="decimal" />
+ <column name="status" type="varchar" />
+ <column name="creation_date" type="datetime" />
+ </metadata>
<row data-node="tbl.t_order_0" values="1000, 10, init, 1, test, 2017-08-08" />
<row data-node="tbl.t_order_1" values="1001, 10, init, 2, test, 2017-08-08" />
<row data-node="tbl.t_order_2" values="1002, 10, init, 3, test, 2017-08-08" />
@@ -126,4 +134,24 @@
<row data-node="tbl.t_order_item_federate_sharding_0" values="1010, 10001, 10, init, t_order_item_federate_sharding" />
<row data-node="tbl.t_order_item_federate_sharding_1" values="1001, 10001, 11, init, t_order_item_federate_sharding" />
<row data-node="tbl.t_order_item_federate_sharding_1" values="1011, 10001, 10, init, t_order_item_federate_sharding" />
+ <row data-node="tbl.t_product_1" values="1, qq coins, 2, 200, off sale, 2017-08-08" />
+ <row data-node="tbl.t_product_2" values="2, haier washing machine, 4, 3121, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_3" values="3, huawei mobile phones, 6, 6666, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_4" values="4, alibaba cloud cards, 2, 500, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_5" values="5, lenovo mobile phones, 6, 3200, off sale, 2017-08-08" />
+ <row data-node="tbl.t_product_6" values="6, moutai liquor, 8, 3200, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_7" values="7, baidu cloud cards, 2, 700, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_8" values="8, xiaomi mobile phones, 6, 2799, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_9" values="9, vivo mobile phones, 6, 2899, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_0" values="10, oppo mobile phones, 6, 2299, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_1" values="11, google mobile phones, 6, 3399, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_2" values="12, walmart wine, 8, 1000, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_3" values="13, amazon cloud cards, 2, 1000, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_4" values="14, apple mobile phones, 6, 8200, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_5" values="15, microsoft x-box, 9, 5000, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_6" values="16, dell xps, 10, 9000, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_7" values="17, johnson shampoo, 12, 30, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_8" values="18, intel cpu, 10, 1600, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_9" values="19, hp computer, 10, 4600, on sale, 2017-08-08" />
+ <row data-node="tbl.t_product_0" values="20, tesla model 3, 14, 324600, on sale, 2017-08-08" />
</dataset>
diff --git a/test/e2e/suite/src/test/resources/env/scenario/tbl/data/actual/init-sql/mysql/01-actual-init.sql b/test/e2e/suite/src/test/resources/env/scenario/tbl/data/actual/init-sql/mysql/01-actual-init.sql
index 34ae2e4038d..6b4a7cc01d1 100644
--- a/test/e2e/suite/src/test/resources/env/scenario/tbl/data/actual/init-sql/mysql/01-actual-init.sql
+++ b/test/e2e/suite/src/test/resources/env/scenario/tbl/data/actual/init-sql/mysql/01-actual-init.sql
@@ -69,3 +69,14 @@ CREATE INDEX order_index_t_order_9 ON tbl.t_order_9 (order_id);
CREATE TABLE tbl.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
CREATE TABLE tbl.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
+
+CREATE TABLE tbl.t_product_0 (product_id INT PRIMARY KEY, product_name VARCHAR(50) NOT NULL, category_id INT NOT NULL, price DECIMAL NOT NULL, status VARCHAR(50) NOT NULL, creation_date DATE NOT NULL);
+CREATE TABLE tbl.t_product_1 (product_id INT PRIMARY KEY, product_name VARCHAR(50) NOT NULL, category_id INT NOT NULL, price DECIMAL NOT NULL, status VARCHAR(50) NOT NULL, creation_date DATE NOT NULL);
+CREATE TABLE tbl.t_product_2 (product_id INT PRIMARY KEY, product_name VARCHAR(50) NOT NULL, category_id INT NOT NULL, price DECIMAL NOT NULL, status VARCHAR(50) NOT NULL, creation_date DATE NOT NULL);
+CREATE TABLE tbl.t_product_3 (product_id INT PRIMARY KEY, product_name VARCHAR(50) NOT NULL, category_id INT NOT NULL, price DECIMAL NOT NULL, status VARCHAR(50) NOT NULL, creation_date DATE NOT NULL);
+CREATE TABLE tbl.t_product_4 (product_id INT PRIMARY KEY, product_name VARCHAR(50) NOT NULL, category_id INT NOT NULL, price DECIMAL NOT NULL, status VARCHAR(50) NOT NULL, creation_date DATE NOT NULL);
+CREATE TABLE tbl.t_product_5 (product_id INT PRIMARY KEY, product_name VARCHAR(50) NOT NULL, category_id INT NOT NULL, price DECIMAL NOT NULL, status VARCHAR(50) NOT NULL, creation_date DATE NOT NULL);
+CREATE TABLE tbl.t_product_6 (product_id INT PRIMARY KEY, product_name VARCHAR(50) NOT NULL, category_id INT NOT NULL, price DECIMAL NOT NULL, status VARCHAR(50) NOT NULL, creation_date DATE NOT NULL);
+CREATE TABLE tbl.t_product_7 (product_id INT PRIMARY KEY, product_name VARCHAR(50) NOT NULL, category_id INT NOT NULL, price DECIMAL NOT NULL, status VARCHAR(50) NOT NULL, creation_date DATE NOT NULL);
+CREATE TABLE tbl.t_product_8 (product_id INT PRIMARY KEY, product_name VARCHAR(50) NOT NULL, category_id INT NOT NULL, price DECIMAL NOT NULL, status VARCHAR(50) NOT NULL, creation_date DATE NOT NULL);
+CREATE TABLE tbl.t_product_9 (product_id INT PRIMARY KEY, product_name VARCHAR(50) NOT NULL, category_id INT NOT NULL, price DECIMAL NOT NULL, status VARCHAR(50) NOT NULL, creation_date DATE NOT NULL);
diff --git a/test/e2e/suite/src/test/resources/env/scenario/tbl/data/expected/dataset.xml b/test/e2e/suite/src/test/resources/env/scenario/tbl/data/expected/dataset.xml
index d6e0104ea0b..97f8566fa9d 100644
--- a/test/e2e/suite/src/test/resources/env/scenario/tbl/data/expected/dataset.xml
+++ b/test/e2e/suite/src/test/resources/env/scenario/tbl/data/expected/dataset.xml
@@ -53,6 +53,14 @@
<column name="status" type="varchar" />
<column name="remarks" type="varchar" />
</metadata>
+ <metadata data-nodes="expected_dataset.t_product">
+ <column name="product_id" type="numeric" />
+ <column name="product_name" type="varchar" />
+ <column name="category_id" type="numeric" />
+ <column name="price" type="decimal" />
+ <column name="status" type="varchar" />
+ <column name="creation_date" type="datetime" />
+ </metadata>
<row data-node="expected_dataset.t_order" values="1000, 10, init, 1, test, 2017-08-08" />
<row data-node="expected_dataset.t_order" values="1001, 10, init, 2, test, 2017-08-08" />
<row data-node="expected_dataset.t_order" values="1002, 10, init, 3, test, 2017-08-08" />
@@ -126,4 +134,24 @@
<row data-node="expected_dataset.t_order_item_federate_sharding" values="1010, 10001, 10, init, t_order_item_federate_sharding" />
<row data-node="expected_dataset.t_order_item_federate_sharding" values="1001, 10001, 11, init, t_order_item_federate_sharding" />
<row data-node="expected_dataset.t_order_item_federate_sharding" values="1011, 10001, 10, init, t_order_item_federate_sharding" />
+ <row data-node="expected_dataset.t_product" values="1, qq coins, 2, 200, off sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="2, haier washing machine, 4, 3121, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="3, huawei mobile phones, 6, 6666, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="4, alibaba cloud cards, 2, 500, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="5, lenovo mobile phones, 6, 3200, off sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="6, moutai liquor, 8, 3200, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="7, baidu cloud cards, 2, 700, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="8, xiaomi mobile phones, 6, 2799, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="9, vivo mobile phones, 6, 2899, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="10, oppo mobile phones, 6, 2299, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="11, google mobile phones, 6, 3399, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="12, walmart wine, 8, 1000, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="13, amazon cloud cards, 2, 1000, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="14, apple mobile phones, 6, 8200, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="15, microsoft x-box, 9, 5000, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="16, dell xps, 10, 9000, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="17, johnson shampoo, 12, 30, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="18, intel cpu, 10, 1600, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="19, hp computer, 10, 4600, on sale, 2017-08-08" />
+ <row data-node="expected_dataset.t_product" values="20, tesla model 3, 14, 324600, on sale, 2017-08-08" />
</dataset>
diff --git a/test/e2e/suite/src/test/resources/env/scenario/tbl/data/expected/init-sql/mysql/01-expected-init.sql b/test/e2e/suite/src/test/resources/env/scenario/tbl/data/expected/init-sql/mysql/01-expected-init.sql
index 6efde829beb..402c323467e 100644
--- a/test/e2e/suite/src/test/resources/env/scenario/tbl/data/expected/init-sql/mysql/01-expected-init.sql
+++ b/test/e2e/suite/src/test/resources/env/scenario/tbl/data/expected/init-sql/mysql/01-expected-init.sql
@@ -27,5 +27,6 @@ CREATE TABLE expected_dataset.t_single_table (single_id INT NOT NULL, id INT NOT
CREATE TABLE expected_dataset.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
CREATE TABLE expected_dataset.t_order_federate_sharding (order_id_sharding INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id_sharding));
CREATE TABLE expected_dataset.t_order_item_federate_sharding (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, remarks VARCHAR(45) NULL, PRIMARY KEY (item_id));
+CREATE TABLE expected_dataset.t_product (product_id INT PRIMARY KEY, product_name VARCHAR(50) NOT NULL, category_id INT NOT NULL, price DECIMAL NOT NULL, status VARCHAR(50) NOT NULL, creation_date DATE NOT NULL);
CREATE INDEX order_index_t_order ON expected_dataset.t_order (order_id);
diff --git a/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/mysql/config-tbl.yaml b/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/mysql/config-tbl.yaml
index cccf7fac98b..dbd1f802c59 100644
--- a/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/mysql/config-tbl.yaml
+++ b/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/mysql/config-tbl.yaml
@@ -68,6 +68,11 @@ rules:
standard:
shardingColumn: item_id
shardingAlgorithmName: table_inline_item_id
+ t_product:
+ actualDataNodes: tbl.t_product_${0..9}
+ tableStrategy:
+ hint:
+ shardingAlgorithmName: t_product_hint_inline
bindingTables:
- ref_0:t_order,t_order_item,t_order_details
broadcastTables:
@@ -86,6 +91,10 @@ rules:
props:
algorithm-expression: t_order_federate_sharding_${order_id_sharding % 2}
allow-range-query-with-inline-sharding: true
+ t_product_hint_inline:
+ type: HINT_INLINE
+ props:
+ algorithm-expression: t_product_${value}
keyGenerators:
constant:
diff --git a/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/opengauss/config-tbl.yaml b/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/opengauss/config-tbl.yaml
index 0de6b2ac83e..635486d289a 100644
--- a/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/opengauss/config-tbl.yaml
+++ b/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/opengauss/config-tbl.yaml
@@ -68,6 +68,11 @@ rules:
standard:
shardingColumn: item_id
shardingAlgorithmName: table_inline_item_id
+ t_product:
+ actualDataNodes: tbl.t_product_${0..9}
+ tableStrategy:
+ hint:
+ shardingAlgorithmName: t_product_hint_inline
bindingTables:
- ref_0:t_order,t_order_item,t_order_details
broadcastTables:
@@ -86,6 +91,10 @@ rules:
props:
algorithm-expression: t_order_federate_sharding_${order_id_sharding % 2}
allow-range-query-with-inline-sharding: true
+ t_product_hint_inline:
+ type: HINT_INLINE
+ props:
+ algorithm-expression: t_product_${value}
keyGenerators:
constant:
diff --git a/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/postgresql/config-tbl.yaml b/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/postgresql/config-tbl.yaml
index ad97544ac0d..f5ff36630c4 100644
--- a/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/postgresql/config-tbl.yaml
+++ b/test/e2e/suite/src/test/resources/env/scenario/tbl/proxy/conf/postgresql/config-tbl.yaml
@@ -68,6 +68,11 @@ rules:
standard:
shardingColumn: item_id
shardingAlgorithmName: table_inline_item_id
+ t_product:
+ actualDataNodes: tbl.t_product_${0..9}
+ tableStrategy:
+ hint:
+ shardingAlgorithmName: t_product_hint_inline
bindingTables:
- ref_0:t_order,t_order_item,t_order_details
broadcastTables:
@@ -86,6 +91,10 @@ rules:
props:
algorithm-expression: t_order_federate_sharding_${order_id_sharding % 2}
allow-range-query-with-inline-sharding: true
+ t_product_hint_inline:
+ type: HINT_INLINE
+ props:
+ algorithm-expression: t_product_${value}
keyGenerators:
constant:
diff --git a/test/e2e/suite/src/test/resources/env/scenario/tbl/rules.yaml b/test/e2e/suite/src/test/resources/env/scenario/tbl/rules.yaml
index b6452cd16c5..54b353893c8 100644
--- a/test/e2e/suite/src/test/resources/env/scenario/tbl/rules.yaml
+++ b/test/e2e/suite/src/test/resources/env/scenario/tbl/rules.yaml
@@ -55,6 +55,11 @@ rules:
standard:
shardingColumn: item_id
shardingAlgorithmName: table_inline_item_id
+ t_product:
+ actualDataNodes: tbl.t_product_${0..9}
+ tableStrategy:
+ hint:
+ shardingAlgorithmName: t_product_hint_inline
bindingTables:
- ref_0:t_order,t_order_item,t_order_details
broadcastTables:
@@ -73,6 +78,10 @@ rules:
props:
algorithm-expression: t_order_federate_sharding_${order_id_sharding % 2}
allow-range-query-with-inline-sharding: true
+ t_product_hint_inline:
+ type: HINT_INLINE
+ props:
+ algorithm-expression: t_product_${value}
keyGenerators:
constant: