Skip to content

Commit

Permalink
Refactor test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
kainwen committed Jan 25, 2024
1 parent 2f303b5 commit 4e90faa
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 52 deletions.
35 changes: 0 additions & 35 deletions src/test/regress/expected/aggregate_with_sort_distinct.out

This file was deleted.

13 changes: 13 additions & 0 deletions src/test/regress/expected/bfv_aggregate.out
Original file line number Diff line number Diff line change
Expand Up @@ -1744,6 +1744,19 @@ select count(distinct(b)), gp_segment_id from t group by gp_segment_id;

set optimizer_force_multistage_agg to off;
drop table t;
-- test Github Issue 17028
create table t_17028(a int, b int);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
insert into t_17028 values (1, 1), (1, null), (null, 1);
set gp_enable_sort_distinct to on;
select string_agg(a::text, ',' order by b), string_agg(distinct b::text, ',') from t_17028;
string_agg | string_agg
------------+------------
1,1 | 1
(1 row)

reset gp_enable_sort_distinct;
-- CLEANUP
set client_min_messages='warning';
drop schema bfv_aggregate cascade;
13 changes: 13 additions & 0 deletions src/test/regress/expected/bfv_aggregate_optimizer.out
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,19 @@ select count(distinct(b)), gp_segment_id from t group by gp_segment_id;

set optimizer_force_multistage_agg to off;
drop table t;
-- test Github Issue 17028
create table t_17028(a int, b int);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
insert into t_17028 values (1, 1), (1, null), (null, 1);
set gp_enable_sort_distinct to on;
select string_agg(a::text, ',' order by b), string_agg(distinct b::text, ',') from t_17028;
string_agg | string_agg
------------+------------
1,1 | 1
(1 row)

reset gp_enable_sort_distinct;
-- CLEANUP
set client_min_messages='warning';
drop schema bfv_aggregate cascade;
1 change: 0 additions & 1 deletion src/test/regress/greenplum_schedule
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ test: bfv_catalog bfv_index bfv_olap bfv_aggregate bfv_partition bfv_partition_p
# NOTE: gporca_faults uses gp_fault_injector - so do not add to a parallel group
test: gporca_faults

test: aggregate_with_sort_distinct
test: aggregate_with_groupingsets

test: nested_case_null sort bb_mpph
Expand Down
16 changes: 0 additions & 16 deletions src/test/regress/sql/aggregate_with_sort_distinct.sql

This file was deleted.

7 changes: 7 additions & 0 deletions src/test/regress/sql/bfv_aggregate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,13 @@ select count(distinct(b)), gp_segment_id from t group by gp_segment_id;
set optimizer_force_multistage_agg to off;
drop table t;

-- test Github Issue 17028
create table t_17028(a int, b int);
insert into t_17028 values (1, 1), (1, null), (null, 1);
set gp_enable_sort_distinct to on;
select string_agg(a::text, ',' order by b), string_agg(distinct b::text, ',') from t_17028;
reset gp_enable_sort_distinct;

-- CLEANUP
set client_min_messages='warning';
drop schema bfv_aggregate cascade;

0 comments on commit 4e90faa

Please sign in to comment.