Skip to content

Commit 8cac6b5

Browse files
committed
CI: add binary swap CI for REL_2_STABLE
1. Use test_binary_swap.sh for testing 2. Integrate with parallel builds in workflow 3. Update terminology (Master -> Coordinator) 4. Add build script injection for compatibility
1 parent 8178d4f commit 8cac6b5

File tree

19 files changed

+15157
-11
lines changed

19 files changed

+15157
-11
lines changed

.github/workflows/binary-swap-check.yml

Lines changed: 679 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
DROP TABLE IF EXISTS sales_heap;
2+
DROP TABLE
3+
CREATE TABLE IF NOT EXISTS sales_heap
4+
(
5+
product_id INT,
6+
is_audited BOOLEAN DEFAULT FALSE,
7+
quantity SMALLINT,
8+
total_sales BIGINT,
9+
unit_price REAL,
10+
discount DOUBLE PRECISION,
11+
description TEXT,
12+
sale_date TIMESTAMP,
13+
order_date DATE,
14+
status CHAR(10),
15+
customer_name VARCHAR(20),
16+
price DECIMAL(20, 10)
17+
) DISTRIBUTED BY (product_id);
18+
CREATE TABLE
19+
---
20+
DROP TABLE IF EXISTS sales_partition_heap;
21+
DROP TABLE
22+
CREATE TABLE IF NOT EXISTS sales_partition_heap
23+
(
24+
product_id INT,
25+
is_audited BOOLEAN DEFAULT FALSE,
26+
quantity SMALLINT,
27+
total_sales BIGINT,
28+
unit_price REAL,
29+
discount DOUBLE PRECISION,
30+
description TEXT,
31+
sale_date TIMESTAMP,
32+
order_date DATE,
33+
status CHAR(10),
34+
customer_name VARCHAR(20),
35+
price DECIMAL(20, 10)
36+
) DISTRIBUTED BY (product_id)
37+
PARTITION BY LIST (status);
38+
CREATE TABLE
39+
CREATE TABLE sales_partition_heap_part1
40+
PARTITION OF sales_partition_heap
41+
FOR VALUES IN ('Cancelled');
42+
CREATE TABLE
43+
CREATE TABLE sales_partition_heap_part2
44+
PARTITION OF sales_partition_heap
45+
FOR VALUES IN ('Closed');
46+
CREATE TABLE
47+
CREATE TABLE sales_partition_heap_part3
48+
PARTITION OF sales_partition_heap
49+
FOR VALUES IN ('Processing');
50+
CREATE TABLE
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
DELETE FROM sales_heap WHERE product_id > 1000000;
2+
DELETE FROM sales_partition_heap WHERE product_id > 1000000;
3+
SELECT COUNT(*) FROM sales_heap;
4+
count
5+
-------
6+
10000
7+
(1 row)
8+
9+
SELECT COUNT(*) FROM sales_partition_heap;
10+
count
11+
-------
12+
10000
13+
(1 row)
14+
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
INSERT INTO sales_heap (
2+
product_id,
3+
is_audited,
4+
quantity,
5+
total_sales,
6+
unit_price,
7+
discount,
8+
description,
9+
sale_date,
10+
order_date,
11+
status,
12+
customer_name,
13+
price
14+
)
15+
SELECT
16+
x.id, -- product_id
17+
CASE
18+
WHEN random() < 0.5 THEN TRUE
19+
ELSE FALSE
20+
END AS is_audited, -- is_audited
21+
(random() * 100)::smallint, -- quantity
22+
(random() * 1000000)::bigint, -- total_sales
23+
(random() * 100)::real, -- unit_price
24+
(random() * 1)::double precision, -- discount
25+
'Product description ' || x.id, -- description
26+
now() - INTERVAL '1 day' * floor(random() * 365 * 3), -- sale_date
27+
'2023-01-01'::DATE + INTERVAL '1 day' * floor(random() * 365 * 3), -- order_date
28+
CASE
29+
WHEN random() < 0.05 THEN 'Cancelled'
30+
WHEN random() < 0.5 THEN 'Closed'
31+
ELSE 'Processing'
32+
END AS status, -- status
33+
'Customer ' || x.id, -- customer_name
34+
(random() * 1000000)::decimal(20, 10) -- price
35+
FROM (
36+
SELECT * FROM generate_series(1000001, 1010000) AS id
37+
) AS x;
38+
INSERT INTO sales_partition_heap (
39+
product_id,
40+
is_audited,
41+
quantity,
42+
total_sales,
43+
unit_price,
44+
discount,
45+
description,
46+
sale_date,
47+
order_date,
48+
status,
49+
customer_name,
50+
price
51+
)
52+
SELECT
53+
x.id, -- product_id
54+
CASE
55+
WHEN random() < 0.5 THEN TRUE
56+
ELSE FALSE
57+
END AS is_audited, -- is_audited
58+
(random() * 100)::smallint, -- quantity
59+
(random() * 1000000)::bigint, -- total_sales
60+
(random() * 100)::real, -- unit_price
61+
(random() * 1)::double precision, -- discount
62+
'Product description ' || x.id, -- description
63+
now() - INTERVAL '1 day' * floor(random() * 365 * 3), -- sale_date
64+
'2023-01-01'::DATE + INTERVAL '1 day' * floor(random() * 365 * 3), -- order_date
65+
CASE
66+
WHEN random() < 0.05 THEN 'Cancelled'
67+
WHEN random() < 0.5 THEN 'Closed'
68+
ELSE 'Processing'
69+
END AS status, -- status
70+
'Customer ' || x.id, -- customer_name
71+
(random() * 1000000)::decimal(20, 10) -- price
72+
FROM (
73+
SELECT * FROM generate_series(1000001, 1010000) AS id
74+
) AS x;
75+
SELECT COUNT(*) FROM sales_heap;
76+
count
77+
-------
78+
20000
79+
(1 row)
80+
81+
SELECT COUNT(*) FROM sales_partition_heap;
82+
count
83+
-------
84+
20000
85+
(1 row)
86+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
COPY public.sales_heap (product_id, is_audited, quantity, total_sales, unit_price, discount, description, sale_date, order_date, status, customer_name, price) FROM stdin;
2+
INSERT INTO sales_partition_heap SELECT * FROM sales_heap;
3+
INSERT 0 10000
4+
ANALYZE sales_heap;
5+
ANALYZE
6+
ANALYZE rootpartition sales_partition_heap;
7+
ANALYZE

0 commit comments

Comments
 (0)