提交 d23fcc62 编写于 作者: R Richard Guo 提交者: GitHub

Make resource group test cases pass when number of segments is not three

In some resource group test cases, the result will depend on the
number of segments, and current test cases are based on three
segments. This commit is to fix this issue.

In addition, in isolation2, gpdiff needs at least 3 dashes to identify 
the result of 'select' statement. Change the elements to be above 
100 in test case 'resgroup_memory_materialize_spill' to meet this 
requirement.
上级 138cc119
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema hashagg_spill;
CREATE
set search_path to hashagg_spill;
......@@ -22,7 +26,7 @@ INSERT 51000
DROP ROLE IF EXISTS role1_memory_test;
DROP
DROP RESOURCE GROUP rg1_memory_test;
DROP
ERROR: resource group "rg1_memory_test" does not exist
-- end_ignore
CREATE ROLE role1_memory_test SUPERUSER;
CREATE
......
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema hashjoin_spill;
CREATE
set search_path to hashjoin_spill;
......@@ -28,7 +32,7 @@ SET
CREATE TABLE test_hj_spill (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8 int);
CREATE
insert into test_hj_spill SELECT i,i,i%1000,i,i,i,i,i from (select generate_series(1, nsegments * 15000) as i from (select count(*) as nsegments from gp_segment_configuration where role='p' and content >= 0) foo) bar;
INSERT 45000
INSERT 30000
SET statement_mem=1024;
SET
set gp_resgroup_print_operator_memory_limits=on;
......
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema materialize_spill;
CREATE
set search_path to materialize_spill;
......@@ -5,7 +9,7 @@ SET
-- start_ignore
create language plpythonu;
ERROR: language "plpythonu" already exists
CREATE
-- end_ignore
-- Helper function to verify that a plan spilled to disk. For each node
......@@ -33,7 +37,7 @@ CREATE
--
CREATE TABLE test_mat_small (i1 int);
CREATE
INSERT INTO test_mat_small SELECT i from generate_series(1, 5) i;
INSERT INTO test_mat_small SELECT i from generate_series(101, 105) i;
INSERT 5
-- Scale the larger table's size with the number of segments, so that there is enough
......@@ -71,13 +75,13 @@ SET
-- This is the actual test query.
select * FROM test_mat_small as t1 left outer join test_mat_large AS t2 on t1.i1=t2.i2;
i1|i1|i2|i3|i4|i5|i6|i7|i8
--+--+--+--+--+--+--+--+--
1 |1 |1 |1 |1 |1 |1 |1 |1
2 |2 |2 |2 |2 |2 |2 |2 |2
3 |3 |3 |3 |3 |3 |3 |3 |3
4 |4 |4 |4 |4 |4 |4 |4 |4
5 |5 |5 |5 |5 |5 |5 |5 |5
i1 |i1 |i2 |i3 |i4 |i5 |i6 |i7 |i8
---+---+---+---+---+---+---+---+---
101|101|101|101|101|101|101|101|101
102|102|102|102|102|102|102|102|102
103|103|103|103|103|103|103|103|103
104|104|104|104|104|104|104|104|104
105|105|105|105|105|105|105|105|105
(5 rows)
-- Check that the Materialize node spilled to disk, to make sure we're testing spilling
......@@ -93,13 +97,13 @@ difference
-- Repeat, with a LIMIT. This causes the underlying scan to finish earlier.
select * FROM test_mat_small as t1 left outer join test_mat_large AS t2 on t1.i1=t2.i2 limit 10;
i1|i1|i2|i3|i4|i5|i6|i7|i8
--+--+--+--+--+--+--+--+--
1 |1 |1 |1 |1 |1 |1 |1 |1
2 |2 |2 |2 |2 |2 |2 |2 |2
3 |3 |3 |3 |3 |3 |3 |3 |3
4 |4 |4 |4 |4 |4 |4 |4 |4
5 |5 |5 |5 |5 |5 |5 |5 |5
i1 |i1 |i2 |i3 |i4 |i5 |i6 |i7 |i8
---+---+---+---+---+---+---+---+---
101|101|101|101|101|101|101|101|101
102|102|102|102|102|102|102|102|102
103|103|103|103|103|103|103|103|103
104|104|104|104|104|104|104|104|104
105|105|105|105|105|105|105|105|105
(5 rows)
select n - (select count (distinct gp_segment_id) from test_mat_small) as difference from num_workfiles_created($$ explain analyze select * FROM test_mat_small as t1 left outer join test_mat_large AS t2 on t1.i1=t2.i2 limit 10 $$) as n;
difference
......
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema sisc_mat_sort;
CREATE
set search_path to sisc_mat_sort;
......@@ -15,7 +19,7 @@ CREATE
create table testsiscm (i1 int, i2 int, i3 int, i4 int);
CREATE
insert into testsiscm select i, i % 1000, i % 100000, i % 75 from (select generate_series(1, nsegments * 150000) as i from (select count(*) as nsegments from gp_segment_configuration where role='p' and content >= 0) foo) bar;
INSERT 450000
INSERT 300000
-- start_ignore
DROP ROLE IF EXISTS role1_memory_test;
......
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema sisc_sort_spill;
CREATE
set search_path to sisc_sort_spill;
......@@ -15,7 +19,7 @@ CREATE
create table testsisc (i1 int, i2 int, i3 int, i4 int);
CREATE
insert into testsisc select i, i % 1000, i % 100000, i % 75 from (select generate_series(1, nsegments * 50000) as i from (select count(*) as nsegments from gp_segment_configuration where role='p' and content >= 0) foo) bar;
INSERT 150000
INSERT 100000
-- start_ignore
DROP ROLE IF EXISTS role1_memory_test;
......
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema sort_spill;
CREATE
set search_path to sort_spill;
......@@ -16,7 +20,7 @@ CREATE
create table testsort (i1 int, i2 int, i3 int, i4 int);
CREATE
insert into testsort select i, i % 1000, i % 100000, i % 75 from (select generate_series(1, nsegments * 50000) as i from (select count(*) as nsegments from gp_segment_configuration where role='p' and content >= 0) foo) bar;
INSERT 150000
INSERT 100000
-- start_ignore
DROP ROLE IF EXISTS role1_memory_test;
......
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema hashagg_spill;
set search_path to hashagg_spill;
......
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema hashjoin_spill;
set search_path to hashjoin_spill;
......
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema materialize_spill;
set search_path to materialize_spill;
......@@ -44,7 +48,7 @@ language plpythonu;
-- in memory, the Materialize will spill to disk.
--
CREATE TABLE test_mat_small (i1 int);
INSERT INTO test_mat_small SELECT i from generate_series(1, 5) i;
INSERT INTO test_mat_small SELECT i from generate_series(101, 105) i;
-- Scale the larger table's size with the number of segments, so that there is enough
-- data on every segment to cause spilling.
......
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema sisc_mat_sort;
set search_path to sisc_mat_sort;
......
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema sisc_sort_spill;
set search_path to sisc_sort_spill;
......
-- start_matchsubs
-- m/INSERT \d+/
-- s/INSERT \d+/INSERT/
-- end_matchsubs
create schema sort_spill;
set search_path to sort_spill;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册