Merge pull request #3447 from citusdata/fix-group-by-distribution-no-group-by

Intermediate row pull up should be false whenever we can fully push down grouping
pull/3448/head
Philip Dubé 2020-01-30 21:31:34 +00:00 committed by GitHub
commit 461facb149
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 1 deletions

View File

@ -76,7 +76,8 @@ BuildExtendedOpNodeProperties(MultiExtendedOp *extendedOpNode, bool
hasNonPartitionColumnDistinctAgg;
extendedOpNodeProperties.pullDistinctColumns = pullDistinctColumns;
extendedOpNodeProperties.pushDownWindowFunctions = pushDownWindowFunctions;
extendedOpNodeProperties.pullUpIntermediateRows = pullUpIntermediateRows;
extendedOpNodeProperties.pullUpIntermediateRows =
!groupedByDisjointPartitionColumn && pullUpIntermediateRows;
return extendedOpNodeProperties;
}

View File

@ -127,6 +127,25 @@ select key, stddev(valf) from aggdata group by key having stddev(val::float8) >
2 | 1.01500410508201
(1 row)
-- Test https://github.com/citusdata/citus/issues/3446
set citus.coordinator_aggregation_strategy to 'row-gather';
select id, stddev(val) from aggdata group by id order by 1;
id | stddev
---------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
(11 rows)
set citus.coordinator_aggregation_strategy to 'disabled';
-- test polymorphic aggregates from https://github.com/citusdata/citus/issues/2397
-- we do not currently support pseudotypes for transition types, so this errors for now
CREATE OR REPLACE FUNCTION first_agg(anyelement, anyelement)

View File

@ -68,6 +68,10 @@ select sum2(val), sum2_strict(val) from aggdata where valf = 0;
select key, stddev(valf) from aggdata group by key having stddev(valf) > 2 order by key;
select key, stddev(valf) from aggdata group by key having stddev(val::float8) > 1 order by key;
-- Test https://github.com/citusdata/citus/issues/3446
set citus.coordinator_aggregation_strategy to 'row-gather';
select id, stddev(val) from aggdata group by id order by 1;
set citus.coordinator_aggregation_strategy to 'disabled';
-- test polymorphic aggregates from https://github.com/citusdata/citus/issues/2397
-- we do not currently support pseudotypes for transition types, so this errors for now