citusdata / citusdata/citus

Error when passing aggregate to set-returning function

Open
#2,076 1 comment 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.