forked from StarRocks/starrocks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_binary_type
More file actions
62 lines (62 loc) · 1.67 KB
/
Copy pathtest_binary_type
File metadata and controls
62 lines (62 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
-- name: test_binary_type
create database db_${uuid0};
-- result:
-- !result
use db_${uuid0};
-- result:
-- !result
create table t0(c0 INT, c1 binary(16), c2 binary, c3 varbinary, c4 varchar(16))
DUPLICATE KEY(c0)
DISTRIBUTED BY HASH(c0)
BUCKETS 1
PROPERTIES('replication_num'='1');
-- result:
-- !result
insert into t0 values (1, x'ab01', x'abab', x'abac','ab01');
-- result:
-- !result
select hex(c1), hex(c2), hex(c3), hex(c4) from t0 order by c0;
-- result:
AB01 ABAB ABAC 61623031
-- !result
insert into t0 values (2, x'ab01', x'abab', x'abac','ab01');
-- result:
-- !result
select hex(c1), hex(c2), hex(c3), hex(c4) from t0 order by c0;
-- result:
AB01 ABAB ABAC 61623031
AB01 ABAB ABAC 61623031
-- !result
create table t1(c0 INT, c1 binary(16), c2 binary, c3 varbinary, c4 varchar(16))
DUPLICATE KEY(c0)
DISTRIBUTED BY HASH(c0)
BUCKETS 1
PROPERTIES('replication_num'='1');
-- result:
-- !result
insert into t1 select * from t0;
-- result:
-- !result
select hex(c1), hex(c2), hex(c3), hex(c4) from t1 order by c0;
-- result:
AB01 ABAB ABAC 61623031
AB01 ABAB ABAC 61623031
-- !result
create table t2(c1 int, c2 varbinary) duplicate key(c1) properties("replication_num"="1");
-- result:
-- !result
shell: curl --location-trusted -u root: -T ${root_path}/common/data/stream_load/test_stream_load_binary_type.json -XPUT -H "strip_outer_array: true" -H "format:JSON" -H "Expect:100-continue" -H "jsonpaths: [\"$.c1\",\"$.c2\"]" -H "columns: c1,c2" ${url}/api/db_${uuid0}/t2/_stream_load
-- result:
0
{
"Status": "Success",
"Message": "OK"
}
-- !result
sync;
-- result:
-- !result
select * from t2;
-- result:
1 1234
-- !result