Skip to content

Commit 9a2056d

Browse files
committed
Add more aggregate test cases for ColumnarIndexScan
Cover query shapes that were missing from the test suite: - DISTINCT on a segmentby column (Agg without Aggrefs) - count(*) without GROUP BY - aggregate only in HAVING (not in SELECT) - GROUP BY ordinal position - GROUP BY () empty grouping - aggregate wrapped in COALESCE - aggregate above a JOIN - ordered-set aggregate (percentile_cont) - bool_and / bool_or - partition-wise aggregate - Aggref inside a SubLink in the outer tlist (inner aggregate belongs to a separate Agg and must not be touched by the outer rewrite) - HAVING with non-pushable expression on grouping columns (qual stays with the Agg instead of being pushed to the scan) - same Aggref node referenced from multiple tlist positions - GROUP BY column not in SELECT (appears only as resjunk in Agg tlist) - WHERE mixing segmentby and non-segmentby columns - HAVING NOT (Aggref ...) and HAVING Aggref IS NULL (mutator must recurse through BoolExpr and NullTest) - GROUP BY with explicit collation (grouping expression is a CollateExpr, not a bare Var) - self-join on the same hypertable (Agg sits over a Join, not over a ColumnarScan)
1 parent 1dc630f commit 9a2056d

6 files changed

Lines changed: 3523 additions & 163 deletions

File tree

tsl/src/nodes/columnar_index_scan/columnar_index_scan.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,7 @@ insert_columnar_index_scan(Plan *plan, void *context)
739739
}
740740

741741
/*
742-
* GROUPING SETS / ROLLUP / CUBE produce an Agg with a non-empty chain of
743-
* additional Aggs (and Sorts) that share the same input. The rewrite below
744-
* remaps only this Agg's targetlist and grpColIdx, so chained Aggs would
745-
* end up referencing the pre-rewrite column layout. Refuse the rewrite in
746-
* that case.
742+
* GROUPING SETS / ROLLUP / CUBE currently not supported.
747743
*/
748744
if (agg->groupingSets != NIL || agg->chain != NIL)
749745
{

0 commit comments

Comments
 (0)