Skip to content

Commit e3ef12e

Browse files
committed
add run83.hpl
1 parent 3d6b675 commit e3ef12e

File tree

1 file changed

+147
-0
lines changed
  • docker/thirdparties/docker-compose/hive/scripts/create_preinstalled_scripts

1 file changed

+147
-0
lines changed
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
create database if not exists test_varbinary;
2+
use test_varbinary;
3+
4+
SET hive.merge.mapfiles=false;
5+
SET hive.merge.mapredfiles=false;
6+
7+
DROP TABLE IF EXISTS test_hive_binary_orc;
8+
DROP TABLE IF EXISTS test_hive_binary_parquet;
9+
10+
11+
CREATE TABLE test_hive_binary_orc (
12+
id INT COMMENT 'Primary key',
13+
col1 BINARY COMMENT 'UUID stored as 16-byte binary',
14+
col2 BINARY COMMENT 'Variable length binary data'
15+
)
16+
COMMENT 'Test table for BINARY type in ORC format'
17+
STORED AS ORC;
18+
19+
20+
INSERT INTO test_hive_binary_orc
21+
SELECT 1, unhex('550e8400e29b41d4a716446655440000'), unhex('0123456789ABCDEF');
22+
23+
INSERT INTO test_hive_binary_orc
24+
SELECT 2, unhex('123e4567e89b12d3a456426614174000'), unhex('FEDCBA9876543210');
25+
26+
INSERT INTO test_hive_binary_orc
27+
SELECT 3, unhex('00000000000000000000000000000000'), unhex('00');
28+
29+
30+
INSERT INTO test_hive_binary_orc SELECT 4, NULL, NULL;
31+
32+
33+
INSERT INTO test_hive_binary_orc
34+
SELECT 5, unhex('ABCDEF1234567890'), unhex('FFFF');
35+
36+
37+
CREATE TABLE test_hive_binary_parquet (
38+
id INT COMMENT 'Primary key',
39+
col1 BINARY COMMENT 'UUID stored as 16-byte binary',
40+
col2 BINARY COMMENT 'Variable length binary data'
41+
)
42+
COMMENT 'Test table for BINARY type in Parquet format'
43+
STORED AS PARQUET;
44+
45+
46+
INSERT INTO test_hive_binary_parquet
47+
SELECT 1, unhex('550e8400e29b41d4a716446655440000'), unhex('0123456789ABCDEF');
48+
49+
INSERT INTO test_hive_binary_parquet
50+
SELECT 2, unhex('123e4567e89b12d3a456426614174000'), unhex('FEDCBA9876543210');
51+
52+
INSERT INTO test_hive_binary_parquet
53+
SELECT 3, unhex('00000000000000000000000000000000'), unhex('00');
54+
55+
56+
INSERT INTO test_hive_binary_parquet SELECT 4, NULL, NULL;
57+
58+
59+
INSERT INTO test_hive_binary_parquet
60+
SELECT 5, unhex('ABCDEF1234567890'), unhex('FFFF');
61+
62+
63+
DROP TABLE IF EXISTS test_hive_binary_orc_write_no_mapping;
64+
CREATE TABLE test_hive_binary_orc_write_no_mapping (
65+
id INT,
66+
col1 BINARY,
67+
col2 BINARY
68+
)
69+
STORED AS ORC;
70+
71+
72+
DROP TABLE IF EXISTS test_hive_binary_parquet_write_no_mapping;
73+
CREATE TABLE test_hive_binary_parquet_write_no_mapping (
74+
id INT,
75+
col1 BINARY,
76+
col2 BINARY
77+
)
78+
STORED AS PARQUET;
79+
80+
81+
DROP TABLE IF EXISTS test_hive_binary_orc_write_with_mapping;
82+
CREATE TABLE test_hive_binary_orc_write_with_mapping (
83+
id INT,
84+
col1 BINARY,
85+
col2 BINARY
86+
)
87+
STORED AS ORC;
88+
89+
90+
DROP TABLE IF EXISTS test_hive_binary_parquet_write_with_mapping;
91+
CREATE TABLE test_hive_binary_parquet_write_with_mapping (
92+
id INT,
93+
col1 BINARY,
94+
col2 BINARY
95+
)
96+
STORED AS PARQUET;
97+
98+
99+
DROP TABLE IF EXISTS test_hive_uuid_fixed_orc;
100+
CREATE TABLE test_hive_uuid_fixed_orc (
101+
id INT,
102+
uuid_col BINARY COMMENT '16-byte UUID',
103+
created_at STRING
104+
)
105+
STORED AS ORC;
106+
107+
INSERT INTO test_hive_uuid_fixed_orc
108+
SELECT 1, unhex('550e8400e29b41d4a716446655440000'), '2024-01-01';
109+
INSERT INTO test_hive_uuid_fixed_orc
110+
SELECT 2, unhex('123e4567e89b12d3a456426614174000'), '2024-01-02';
111+
INSERT INTO test_hive_uuid_fixed_orc
112+
SELECT 3, unhex('deadbeefcafebabeabcdef0123456789'), '2024-01-03';
113+
114+
DROP TABLE IF EXISTS test_hive_uuid_fixed_parquet;
115+
CREATE TABLE test_hive_uuid_fixed_parquet (
116+
id INT,
117+
uuid_col BINARY COMMENT '16-byte UUID',
118+
created_at STRING
119+
)
120+
STORED AS PARQUET;
121+
122+
INSERT INTO test_hive_uuid_fixed_parquet
123+
SELECT 1, unhex('550e8400e29b41d4a716446655440000'), '2024-01-01';
124+
INSERT INTO test_hive_uuid_fixed_parquet
125+
SELECT 2, unhex('123e4567e89b12d3a456426614174000'), '2024-01-02';
126+
INSERT INTO test_hive_uuid_fixed_parquet
127+
SELECT 3, unhex('deadbeefcafebabeabcdef0123456789'), '2024-01-03';
128+
129+
130+
DROP TABLE IF EXISTS test_hive_binary_edge_cases;
131+
CREATE TABLE test_hive_binary_edge_cases (
132+
id INT,
133+
empty_binary BINARY,
134+
single_byte BINARY,
135+
max_length BINARY
136+
)
137+
STORED AS PARQUET;
138+
139+
140+
INSERT INTO test_hive_binary_edge_cases
141+
SELECT 1, unhex(''), unhex('FF'), unhex('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF');
142+
143+
INSERT INTO test_hive_binary_edge_cases
144+
SELECT 2, NULL, unhex('00'), unhex('00000000000000000000000000000000');
145+
146+
INSERT INTO test_hive_binary_edge_cases
147+
SELECT 3, unhex(''), unhex('AB'), unhex('0123456789ABCDEF0123456789ABCDEF');

0 commit comments

Comments
 (0)