Skip to content

Commit

Permalink
add case
Browse files Browse the repository at this point in the history
  • Loading branch information
bobhan1 committed Oct 28, 2024
1 parent f66533b commit c537653
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 16 deletions.
1 change: 1 addition & 0 deletions be/src/olap/tablet_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ void TabletColumn::to_schema_pb(ColumnPB* column) const {
column->set_type(get_string_by_field_type(_type));
column->set_is_key(_is_key);
column->set_is_nullable(_is_nullable);
column->set_is_auto_increment(_is_auto_increment);
if (_has_default_value) {
column->set_default_value(_default_value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
11

-- !autoinc_key_3 --
\N 111 111 1234 \N 1,4,5,6
\N 9876 666 1234 \N 1,2,4,6
\N 9876 888 222 \N 1,2,5,6
43 9876 99 20 \N 2,5,6
999 9876 777 1234 \N 2,4,5,6
\N 111 111 1234 \N 0,1,4,5,6
\N 9876 666 1234 \N 0,1,2,4,6
\N 9876 888 222 \N 0,1,2,5,6
43 9876 99 20 \N 0,2,5,6
999 9876 777 1234 \N 0,2,4,5,6

-- !autoinc_key_4 --
1000 10 0 0 0 0 2,3,4,5,6
Expand All @@ -35,16 +35,16 @@

-- !autoinc_val_2 --
0 0 0 0 0 0
1 10 1 1 1 1 2,4,5,6
1 10 1 1 1 1 2,3,4,5,6
2 2 20 20 2 25 1,4,6
3 3 3 30 3 3 1,2,4,5,6
4 4 4 4 4 4
5 5 5 5 5 5
9 \N 99 77 1234 \N 1,4,5,6

-- !autoinc_val_3 --
8 \N 88 1234 \N 1,4,5,6
10 \N 9876 666 555 1,2,6
8 \N 88 1234 \N 1,3,4,5,6
10 \N 9876 666 555 1,2,3,6

-- !autoinc_val_4 --
2
Expand All @@ -61,11 +61,11 @@
11

-- !autoinc_key_3 --
\N 111 111 1234 \N 1,4,5,6
\N 9876 666 1234 \N 1,2,4,6
\N 9876 888 222 \N 1,2,5,6
43 9876 99 20 \N 2,5,6
999 9876 777 1234 \N 2,4,5,6
\N 111 111 1234 \N 0,1,4,5,6
\N 9876 666 1234 \N 0,1,2,4,6
\N 9876 888 222 \N 0,1,2,5,6
43 9876 99 20 \N 0,2,5,6
999 9876 777 1234 \N 0,2,4,5,6

-- !autoinc_key_4 --
1000 10 0 0 0 0 2,3,4,5,6
Expand All @@ -85,16 +85,16 @@

-- !autoinc_val_2 --
0 0 0 0 0 0
1 10 1 1 1 1 2,4,5,6
1 10 1 1 1 1 2,3,4,5,6
2 2 20 20 2 25 1,4,6
3 3 3 30 3 3 1,2,4,5,6
4 4 4 4 4 4
5 5 5 5 5 5
9 \N 99 77 1234 \N 1,4,5,6

-- !autoinc_val_3 --
8 \N 88 1234 \N 1,4,5,6
10 \N 9876 666 555 1,2,6
8 \N 88 1234 \N 1,3,4,5,6
10 \N 9876 666 555 1,2,3,6

-- !autoinc_val_4 --
2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,30 @@ suite('test_flexible_partial_update_auto_inc') {
qt_autoinc_val_2 "select k,v1,v2,v3,v4,v5,BITMAP_TO_STRING(__DORIS_SKIP_BITMAP_COL__) from ${tableName} where k not in (8,10) order by k;"
qt_autoinc_val_3 "select k,v1,v2,v4,v5,BITMAP_TO_STRING(__DORIS_SKIP_BITMAP_COL__) from ${tableName} where k in (8,10) order by k;"
qt_autoinc_val_4 "select count(distinct v3) from ${tableName} where k in (8,10);"

def originAutoIncVals = []
def res1 = sql_return_maparray "select k,v1,v2,v3,v4,v5 from ${tableName} where k in (8,10)";
for (def row : res1) {
originAutoIncVals << row.v3
}
Collections.sort(originAutoIncVals)
logger.info("originAutoIncVals; ${originAutoIncVals}")
streamLoad {
table "${tableName}"
set 'format', 'json'
set 'read_json_by_line', 'true'
set 'strict_mode', 'false'
set 'unique_key_update_mode', 'UPDATE_FLEXIBLE_COLUMNS'
file "autoinc2.json"
time 20000
}
def autoIncVals = []
def res2 = sql_return_maparray "select k,v1,v2,v3,v4,v5 from ${tableName} where k in (8,10)";
for (def row : res1) {
autoIncVals << row.v3
}
Collections.sort(autoIncVals)
logger.info("autoIncVals: ${autoIncVals}")
assertEquals(originAutoIncVals, autoIncVals)
}
}

0 comments on commit c537653

Please sign in to comment.