Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion be/src/olap/base_tablet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ Status BaseTablet::generate_new_block_for_partial_update(
mutable_column.get())
->insert_null_elements(1);
} else {
mutable_column->insert_default();
mutable_column->insert(rs_column.get_vec_type()->get_default());
}
} else {
mutable_column->insert_from(
Expand Down
2 changes: 1 addition & 1 deletion be/src/olap/partial_update_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ Status PartialUpdateReadPlan::fill_missing_columns(
// If the control flow reaches this branch, the column neither has default value
// nor is nullable. It means that the row's delete sign is marked, and the value
// columns are useless and won't be read. So we can just put arbitary values in the cells
missing_col->insert_default();
missing_col->insert(tablet_column.get_vec_type()->get_default());
}
// clang-format on
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
4 \N \N [1, 2, 3, 4, 5] \N
6 \N \N [] {"a":1000000, "b":10000000}

-- !sql --
3 doris3 {"jsonk3":456,"jsonk5":789} [600, 400] {"a":2, "b":7} {"cccc":10} 4 0

-- !sql --
1 doris1 {"jsonk1":123,"jsonk2":456} [100, 200] {"a":1, "b":2} {"b":3} 3 0
1 \N null [null] {"a":null, "b":null} {null:null} 5 1
2 doris2 {"jsonk2":333,"jsonk4":444} [300, 400] {"a":3, "b":4} {"a":2} 2 0
2 \N null [null] {"a":null, "b":null} {null:null} 5 1
3 doris3 {"jsonk3":456,"jsonk5":789} [600, 400] {"a":2, "b":7} {"cccc":10} 4 0

-- !update_varchar --
1 apache doris {"jsonk1":123,"jsonk2":456} [100, 200] {"a":1, "b":2}
2 apache doris 2.0 {"jsonk3":333,"jsonk4":444} [300, 400] {"a":3, "b":4}
Expand All @@ -43,3 +53,13 @@
4 \N \N [1, 2, 3, 4, 5] \N
6 \N \N [] {"a":1000000, "b":10000000}

-- !sql --
3 doris3 {"jsonk3":456,"jsonk5":789} [600, 400] {"a":2, "b":7} {"cccc":10} 4 0

-- !sql --
1 doris1 {"jsonk1":123,"jsonk2":456} [100, 200] {"a":1, "b":2} {"b":3} 3 0
1 \N null [null] {"a":null, "b":null} {null:null} 5 1
2 doris2 {"jsonk2":333,"jsonk4":444} [300, 400] {"a":3, "b":4} {"a":2} 2 0
2 \N null [null] {"a":null, "b":null} {null:null} 5 1
3 doris3 {"jsonk3":456,"jsonk5":789} [600, 400] {"a":2, "b":7} {"cccc":10} 4 0

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// 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
Expand Down Expand Up @@ -32,7 +31,7 @@ suite("test_primary_key_partial_update_complex_type", "p0") {
// 2. the combination of map type and row store may result in bugs, so we skip map type in temporary
//
// create table
sql """ DROP TABLE IF EXISTS ${tableName} """
sql """ DROP TABLE IF EXISTS ${tableName} FORCE"""
sql """ CREATE TABLE ${tableName} (
`id` int(11) NOT NULL COMMENT "用户 ID",
`c_varchar` varchar(65533) NULL COMMENT "用户姓名",
Expand Down Expand Up @@ -120,8 +119,36 @@ suite("test_primary_key_partial_update_complex_type", "p0") {
select * from ${tableName} order by id;
"""

// drop table
sql """ DROP TABLE IF EXISTS ${tableName} """
// create table for NOT NULL tests
def tableName2 = "${tableName}_not_null"
sql """ DROP TABLE IF EXISTS ${tableName2} FORCE"""
sql """ CREATE TABLE ${tableName2} (
`id` int(11) NOT NULL COMMENT "用户 ID",
`c_varchar` varchar(65533) NULL COMMENT "用户姓名",
`c_jsonb` JSONB NOT NULL,
`c_array` ARRAY<INT> NOT NULL,
`c_struct` STRUCT<a:INT, b:INT> NOT NULL,
`c_map` MAP<STRING,int> not null)
UNIQUE KEY(`id`) DISTRIBUTED BY HASH(`id`) BUCKETS 1
PROPERTIES("replication_num" = "1", "enable_unique_key_merge_on_write" = "true",
"store_row_column" = "${use_row_store}"); """

sql """insert into ${tableName2} values(2, "doris2", '{"jsonk2": 333, "jsonk4": 444}', [300, 400], {3, 4}, {'a': 2})"""
sql """insert into ${tableName2} values(1, "doris1", '{"jsonk1": 123, "jsonk2": 456}', [100, 200], {1, 2}, {'b': 3})"""
sql """insert into ${tableName2} values(3, "doris3", '{"jsonk3": 456, "jsonk5": 789}', [600, 400], {2, 7}, {'cccc': 10})"""
String sql1 = "delete from ${tableName2} where id<=2;"
explain {
sql sql1
contains "IS_PARTIAL_UPDATE: true"
}
sql(sql1)

qt_sql """ select *,__DORIS_VERSION_COL__,__DORIS_DELETE_SIGN__ from ${tableName2} order by id,__DORIS_VERSION_COL__;"""
sql "set skip_delete_bitmap=true;"
sql "set skip_delete_sign=true;"
qt_sql """ select *,__DORIS_VERSION_COL__,__DORIS_DELETE_SIGN__ from ${tableName2} order by id,__DORIS_VERSION_COL__;"""
sql "set skip_delete_bitmap=false;"
sql "set skip_delete_sign=false;"
}
}
}
Loading