Error when passing aggregate to set-returning function
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
In a distributed query, we give an odd syntax error when passing an aggregate as a parameter to a set-returning function.
```
CREATE TABLE test (x int, y int);
INSERT INTO test VALUES (1,2);
SELECT generate_series(1,count(*)) FROM test;
generate_series
─────────────────
1
(1 row)
SELECT create_distributed_table('test', 'x');
SELECT generate_series(1,count(*)) FROM test;
ERROR: set-valued function called in context that cannot accept a set
LINE 1: SELECT generate_series(1,count(*)) FROM test;
^
```
This is a blocker for enabling `topn_union_agg`, since it usually gets passed to the `topn` set-returning function.
Contributor guide
Assessment
This issue has not been assessed yet.