Skip to content

Commit

Permalink
fix and update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobhan1 committed Oct 17, 2024
1 parent 6054cb0 commit b4386f1
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 210 deletions.
2 changes: 1 addition & 1 deletion be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,8 @@ Status VerticalSegmentWriter::_merge_rows_for_sequence_column(
pos = start;
auto& skip_bitmap = skip_bitmaps->at(pos);
bool row_has_sequence_col = (!skip_bitmap.contains(seq_col_unique_id));
output_block.add_row(block, pos);
if (row_has_sequence_col) {
output_block.add_row(block, pos);
std::string seq_val {};
// for rows that don't specify seqeunce col, seq_val will be encoded to minial value
_encode_seq_column(seq_column, pos, &seq_val);
Expand Down
4 changes: 2 additions & 2 deletions regression-test/data/unique_with_mow_p0/flexible/test4.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
{"k": 6, "v4": 666}
{"k": 6, "v2": 666, "__DORIS_SEQUENCE_COL__": 30}
{"k": 6, "v5": 666}
{"k": 6, "v1": 123, "v3": 8970}
{"k": 6, "v3": 666, "__DORIS_SEQUENCE_COL__": 20}
{"k": 6, "v1": 123}
{"k": 6, "v3": 8970, "__DORIS_SEQUENCE_COL__": 70}
{"k": 6, "v2": 123}
27 changes: 24 additions & 3 deletions regression-test/data/unique_with_mow_p0/flexible/test6.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,31 @@
{"k": 2, "v5": 777}
{"k": 2, "v4": 666, "v6": 15}
{"k": 2, "v4": 777}
{"k": 5, "v1": 999, "v6": 10}
{"k": 5, "v2": 888, "v6": 30}
{"k": 5, "v4": 5678, "v6": 40}
{"k": 5, "v1": 1234, "v6": 90}
{"k": 5, "v2": 1234, "v3": 7890}
{"k": 5, "v5": 1234, "v6": 100}
{"k": 5, "v1": 333, "v6": 80}
{"k": 5, "v1": 111222}
{"k": 6, "v1": 666, "v6": 10}
{"k": 6, "v4": 666}
{"k": 6, "v2": 666, "v6": 30}
{"k": 6, "v5": 666}
{"k": 6, "v1": 123, "v3": 7890}
{"k": 6, "v3": 666, "v6": 20}
{"k": 6, "v2": 123}
{"k": 6, "v1": 123}
{"k": 6, "v3": 7890, "v6": 70}
{"k": 6, "v2": 123}
{"k": 8, "v1": 123, "v2":456}
{"k": 8, "v1": 999, "v3": 999, "v6": 50}
{"k": 8, "v2": 8888, "v6": 70}
{"k": 8, "v3": 23456, "v5": 999}
{"k": 9, "v1": 999, "v6": 10}
{"k": 9, "v2": 888, "v6": 30}
{"k": 9, "v3": 777, "v6": 60}
{"k": 9, "v1": 1234, "v6": 90}
{"k": 9, "v2": 1234, "v3": 7890}
{"k": 9, "v4": 5678}
{"k": 9, "v5": 1234, "v6": 100}
{"k": 9, "v1": 333, "v8": 80}
{"k": 9, "v1": 111222}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
3 3 3 3 3 3 30
4 4 4 4 4 4 40
5 5 5 5 5 5 50
6 123 123 8970 666 666 30 6
6 123 123 8970 666 666 70 6

-- !seq_type_col_multi_rows_3 --
0 0 0 0 0 0 0
Expand All @@ -77,7 +77,7 @@
3 777 123 123 123 3 53 5,6
4 123 123 123 987 123 40 6,9
5 5 5 5 5 5 50
6 123 123 8970 666 666 30 6
6 123 123 8970 666 666 70 6
7 123 123 7890 666 666 30 6

-- !seq_map_col_no_default_val_multi_rows_1 --
Expand All @@ -94,18 +94,22 @@
2 2 2 777 777 777 20 20 1,2,6,7,10
3 3 3 3 3 3 30 30
4 4 4 4 4 4 40 40
5 5 5 5 5 5 50 50
6 123 123 7890 666 666 30 30 7
5 111222 1234 7890 5 1234 100 100 4,7
6 123 123 7890 666 666 70 70 7
8 999 8888 23456 1234 999 70 70 4,7
9 111222 1234 7890 5678 1234 100 100 7

-- !seq_map_col_no_default_val_multi_rows_3 --
0 0 0 0 0 0 0
1 888 888 1 1 1 20 3,4,5,7
2 2 2 777 777 777 20 1,2,6,7,10
3 777 123 123 123 3 53 5,7
4 123 123 123 987 123 40 6,7,10
5 5 5 5 5 5 50
6 123 123 7890 666 666 30 7
5 111222 1234 7890 5 1234 100 4,7
6 123 123 7890 666 666 70 7
7 123 123 7890 666 666 70 7
8 999 8888 23456 1234 999 70 4,7
9 111222 1234 7890 5678 1234 100 7

-- !seq_map_col_has_default_val_multi_rows_1 --
0 0 0 0 0 0 0 0
Expand All @@ -121,209 +125,22 @@
2 2 2 777 777 777 20 20 1,2,6,7,10
3 3 3 3 3 3 30 30
4 4 4 4 4 4 40 40
5 5 5 5 5 5 50 50
6 123 123 7890 666 666 30 30 7
5 111222 1234 7890 5 1234 100 100 4,7
6 123 123 7890 666 666 70 70 7
8 123 456 23456 1234 999 80 80 4,6,7,10
9 111222 1234 7890 5678 1234 100 100 7

-- !seq_map_col_has_default_val_multi_rows_3 --
0 0 0 0 0 0 0
1 888 888 1 1 1 20 3,4,5,7
2 2 2 777 777 777 20 1,2,6,7,10
3 777 123 123 123 3 53 5,7
4 123 123 123 987 123 40 6,7,10
5 5 5 5 5 5 50
6 123 123 7890 666 666 30 7
7 123 123 7890 666 666 70 7

-- !seq1 --
1 256 1 1 256
2 255 2 2 255
3 3 3 3 3
4 4 4 4 4

-- !seq1 --
1 256 9999 1 256
2 256 9999 -1 256
3 3 9999 -1 3
4 4 9999 -1 4
5 255 9999 -1 255
6 266 9999 -1 266
7 \N 9999 -1 \N

-- !seq1 --
1 256 1 1 256
1 256 9999 1 256
2 255 2 2 255
2 256 9999 -1 256
3 3 3 3 3
3 3 9999 -1 3
4 4 4 4 4
4 4 9999 -1 4
5 255 9999 -1 255
6 266 9999 -1 266
7 \N 9999 -1 \N

-- !seq2 --
1 256 1 1 256
2 255 2 2 255
3 3 3 3 3
4 4 4 4 4

-- !seq2 --
1 256 9999 1 256
2 256 9999 -1 256
3 3 9999 -1 3
4 4 9999 -1 4
5 255 9999 -1 255
6 266 9999 -1 266
7 \N 9999 -1 \N

-- !seq2 --
1 256 1 1 256
1 256 9999 1 256
2 255 2 2 255
2 256 9999 -1 256
3 3 3 3 3
3 3 9999 -1 3
4 4 4 4 4
4 4 9999 -1 4
5 255 9999 -1 255
6 266 9999 -1 266
7 \N 9999 -1 \N

-- !seq_map_no_default_val1 --
0 0 0 0 0 0 0
1 1 1 1 1 10 10
2 2 2 2 2 20 20
3 3 3 3 3 30 30
4 4 4 4 4 40 40
5 5 5 5 5 50 50

-- !seq_map_no_default_val2 --
0 0 0 0 0 0 0
1 1 1 1 1 10 10
2 2 222 2 2 25 25 1,3,4,6
3 3 3 333 3 30 30 1,2,4,5,6,10
4 411 \N 433 444 50 50 6
5 5 5 5 5 50 50
6 611 9876 633 1234 \N \N 2,4,5,6,10
7 \N 9876 733 1234 300 300 1,2,4,6

-- !seq_map_has_default_val1 --
0 0 0 0 0 0 0
1 1 1 1 1 10 10
2 2 2 2 2 20 20
3 3 3 3 3 30 30
4 4 4 4 4 40 40
5 5 5 5 5 50 50

-- !seq_map_has_default_val2 --
0 0 0 0 0 0 0
1 1 1 1 1 10 10
2 2 222 2 2 25 25 1,3,4,6
3 3 3 333 3 30 30 1,2,4,5,6,10
4 411 \N 433 444 50 50 6
5 5 5 5 5 50 50
6 611 9876 633 1234 31 31 2,4,5,6,10
7 \N 9876 733 1234 300 300 1,2,4,6

-- !seq_type_col1 --
0 0 0 0 0 0 0
1 1 1 1 1 1 10
2 2 2 2 2 2 20
3 3 3 3 3 3 30
4 4 4 4 4 4 40
5 5 5 5 5 5 50

-- !seq_type_col2 --
0 0 0 0 0 0 0
1 1 1 1 1 1 10
2 2 222 2 2 25 25 1,3,4,6
3 3 3 333 3 3 30 1,2,4,5,6,10
4 411 \N 433 444 50 50 6
5 5 5 5 5 5 50
6 611 9876 633 1234 \N \N 2,4,5,6,10
7 \N 9876 733 1234 300 300 1,2,4,6

-- !seq_type_col_multi_rows_1 --
0 0 0 0 0 0 0
1 1 1 1 1 1 10
2 2 2 2 2 2 20
3 3 3 3 3 3 30
4 4 4 4 4 4 40
5 5 5 5 5 5 50

-- !seq_type_col_multi_rows_2 --
0 0 0 0 0 0 0
1 888 888 1 1 1 20 3,4,5,6
2 2 2 777 777 777 20 1,2,6,10
3 3 3 3 3 3 30
4 4 4 4 4 4 40
5 5 5 5 5 5 50
6 123 123 8970 666 666 30 6

-- !seq_type_col_multi_rows_3 --
0 0 0 0 0 0 0
1 888 888 1 1 1 20 3,4,5,6
2 2 2 777 777 777 20 1,2,6,10
3 777 123 123 123 3 53 5,6
4 123 123 123 987 123 40 6,10
5 5 5 5 5 5 50
6 123 123 8970 666 666 30 6
7 123 123 7890 666 666 30 6

-- !seq_map_col_no_default_val_multi_rows_1 --
0 0 0 0 0 0 0 0
1 1 1 1 1 1 10 10
2 2 2 2 2 2 20 20
3 3 3 3 3 3 30 30
4 4 4 4 4 4 40 40
5 5 5 5 5 5 50 50

-- !seq_map_col_no_default_val_multi_rows_2 --
0 0 0 0 0 0 0 0
1 888 888 1 1 1 20 20 3,4,5,7
2 2 2 777 777 777 20 20 1,2,6,7,11
3 3 3 3 3 3 30 30
4 4 4 4 4 4 40 40
5 5 5 5 5 5 50 50
6 123 123 7890 666 666 30 30 7

-- !seq_map_col_no_default_val_multi_rows_3 --
0 0 0 0 0 0 0
1 888 888 1 1 1 20 3,4,5,7
2 2 2 777 777 777 20 1,2,6,7,11
3 777 123 123 123 3 53 5,7
4 123 123 123 987 123 40 6,7,11
5 5 5 5 5 5 50
6 123 123 7890 666 666 30 7
7 123 123 7890 666 666 70 7

-- !seq_map_col_has_default_val_multi_rows_1 --
0 0 0 0 0 0 0 0
1 1 1 1 1 1 10 10
2 2 2 2 2 2 20 20
3 3 3 3 3 3 30 30
4 4 4 4 4 4 40 40
5 5 5 5 5 5 50 50

-- !seq_map_col_has_default_val_multi_rows_2 --
0 0 0 0 0 0 0 0
1 888 888 1 1 1 20 20 3,4,5,7
2 2 2 777 777 777 20 20 1,2,6,7,11
3 3 3 3 3 3 30 30
4 4 4 4 4 4 40 40
5 5 5 5 5 5 50 50
6 123 123 7890 666 666 30 30 7

-- !seq_map_col_has_default_val_multi_rows_3 --
0 0 0 0 0 0 0
1 888 888 1 1 1 20 3,4,5,7
2 2 2 777 777 777 20 1,2,6,7,11
3 777 123 123 123 3 53 5,7
4 123 123 123 987 123 40 6,7,11
5 5 5 5 5 5 50
6 123 123 7890 666 666 30 7
5 111222 1234 7890 5 1234 100 4,7
6 123 123 7890 666 666 70 7
7 123 123 7890 666 666 70 7
8 123 456 23456 1234 999 80 4,6,7,10
9 111222 1234 7890 5678 1234 100 7

-- !seq1 --
1 256 1 1 256
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

suite('test_flexible_partial_update_seq_col') {

for (def use_row_store : [false, true]) {
for (def use_row_store : [false]) {
logger.info("current params: use_row_store: ${use_row_store}")

// 1.1. sequence map col(without default value)
Expand Down Expand Up @@ -137,7 +137,8 @@ suite('test_flexible_partial_update_seq_col') {

// ==============================================================================================================================
// the below cases will have many rows with same keys in one load. Among rows with the same keys, some of them specify sequence col(sequence map col),
// some of them don't. Those
// some of them don't.
// The behavior should be the same as if these rows are inserted one by one

// 2.1. sequence type col
tableName = "test_flexible_partial_update_seq_type_col2_${use_row_store}"
Expand Down Expand Up @@ -236,7 +237,7 @@ suite('test_flexible_partial_update_seq_col') {
`v3` BIGINT NOT NULL,
`v4` BIGINT NOT NULL DEFAULT "1234",
`v5` BIGINT NULL,
`v6` BIGINT NULL default "60"
`v6` BIGINT NULL default "80"
) UNIQUE KEY(`k`) DISTRIBUTED BY HASH(`k`) BUCKETS 1
PROPERTIES(
"replication_num" = "1",
Expand Down

0 comments on commit b4386f1

Please sign in to comment.