This is an automated email from the ASF dual-hosted git repository.
zhangchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 04233af66e6 [fix](partial-update) remove unnecessary DECHEK on
IndexChannel::num_rows_filtered (#33160)
04233af66e6 is described below
commit 04233af66e60fb9e9584a6ed9de81e97b0b1aef5
Author: huanghaibin <[email protected]>
AuthorDate: Mon Apr 8 21:18:20 2024 +0800
[fix](partial-update) remove unnecessary DECHEK on
IndexChannel::num_rows_filtered (#33160)
---
be/src/vec/sink/writer/vtablet_writer.h | 1 -
.../insert_into_table/partial_update.out | 36 +++++++++++++++++++++
.../insert_into_table/partial_update.groovy | 37 ++++++++++++++++++++++
3 files changed, 73 insertions(+), 1 deletion(-)
diff --git a/be/src/vec/sink/writer/vtablet_writer.h
b/be/src/vec/sink/writer/vtablet_writer.h
index c6ab6b49e92..b44ce7aabfb 100644
--- a/be/src/vec/sink/writer/vtablet_writer.h
+++ b/be/src/vec/sink/writer/vtablet_writer.h
@@ -458,7 +458,6 @@ public:
const std::vector<std::pair<int64_t, int64_t>>&
tablets_filtered_rows, int64_t node_id);
int64_t num_rows_filtered() {
- DCHECK(!_tablets_filtered_rows.empty());
// the Unique table has no roll up or materilized view
// we just add up filtered rows from all partitions
return std::accumulate(_tablets_filtered_rows.cbegin(),
_tablets_filtered_rows.cend(), 0,
diff --git
a/regression-test/data/nereids_p0/insert_into_table/partial_update.out
b/regression-test/data/nereids_p0/insert_into_table/partial_update.out
index 160af6eb168..50e7f37251e 100644
--- a/regression-test/data/nereids_p0/insert_into_table/partial_update.out
+++ b/regression-test/data/nereids_p0/insert_into_table/partial_update.out
@@ -64,6 +64,24 @@
3 3 3 2 3
4 4 4 1 2
+-- !8 --
+1 1 3 4
+2 2 4 5
+3 3 2 3
+4 4 1 2
+
+-- !9 --
+1 100
+2 200
+3 300
+4 400
+
+-- !10 --
+1 100 3 4
+2 200 4 5
+3 300 2 3
+4 400 1 2
+
-- !1 --
1 doris 1000 123 1
2 doris2 2000 223 1
@@ -129,3 +147,21 @@
3 3 3 2 3
4 4 4 1 2
+-- !8 --
+1 1 3 4
+2 2 4 5
+3 3 2 3
+4 4 1 2
+
+-- !9 --
+1 100
+2 200
+3 300
+4 400
+
+-- !10 --
+1 100 3 4
+2 200 4 5
+3 300 2 3
+4 400 1 2
+
diff --git
a/regression-test/suites/nereids_p0/insert_into_table/partial_update.groovy
b/regression-test/suites/nereids_p0/insert_into_table/partial_update.groovy
index da697fa20e6..c734bcf1846 100644
--- a/regression-test/suites/nereids_p0/insert_into_table/partial_update.groovy
+++ b/regression-test/suites/nereids_p0/insert_into_table/partial_update.groovy
@@ -242,6 +242,43 @@ suite("nereids_partial_update_native_insert_stmt", "p0") {
qt_7 "select * from ${tableName7} order by k1;"
sql """ DROP TABLE IF EXISTS ${tableName7}; """
+ def tableName8 = "nereids_partial_update_native_insert_stmt8"
+ sql "set enable_unique_key_partial_update=false;"
+ sql "set enable_insert_strict = true;"
+ sql "sync;"
+ sql """ DROP TABLE IF EXISTS ${tableName8} """
+ sql """create table ${tableName8} (
+ k int null,
+ v int null,
+ v2 int null,
+ v3 int null
+ ) unique key (k) distributed by hash(k) buckets 1
+ properties("replication_num" = "1",
+ "enable_unique_key_merge_on_write"="true",
+ "disable_auto_compaction"="true",
+ "store_row_column" = "${use_row_store}"); """
+ sql "insert into ${tableName8}
values(1,1,3,4),(2,2,4,5),(3,3,2,3),(4,4,1,2);"
+ qt_8 "select * from ${tableName8} order by k;"
+
+ def tableName9 = "nereids_partial_update_native_insert_stmt9"
+ sql """ DROP TABLE IF EXISTS ${tableName9} """
+ sql """create table ${tableName9} (
+ k int null,
+ v int null
+ ) unique key (k) distributed by hash(k) buckets 1
+ properties("replication_num" = "1",
+ "enable_unique_key_merge_on_write"="true",
+ "disable_auto_compaction"="true",
+ "store_row_column" = "${use_row_store}"); """
+ sql "insert into ${tableName9}
values(1,100),(2,200),(3,300),(4,400);"
+ qt_9 "select * from ${tableName9} order by k;"
+
+ sql "set enable_unique_key_partial_update=true;"
+ sql "set enable_insert_strict = true;"
+ sql "sync;"
+ sql "insert into ${tableName8}(k,v) select k,v from ${tableName9};"
+ qt_10 "select * from ${tableName8} order by k;"
+
sql "set enable_unique_key_partial_update=false;"
sql "set enable_insert_strict = false;"
sql "set enable_fallback_to_original_planner=true;"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]