Test invalid aggregate

pull/2957/head
Philip Dubé 2019-09-11 22:06:28 +00:00
parent 2aa6852dea
commit ae1171a373
3 changed files with 34 additions and 4 deletions

View File

@ -544,7 +544,6 @@ COPY articles_single_shard TO stdout;
DEBUG: Creating router plan
DEBUG: Plan is router executable
50 10 anjanette 19519
-- error out for queries with aggregates
SELECT avg(word_count)
FROM articles
WHERE author_id = 2;
@ -556,6 +555,16 @@ DETAIL: distribution column value: 2
12356.400000000000
(1 row)
-- error out on unsupported aggregate
SET client_min_messages to 'NOTICE';
CREATE AGGREGATE public.invalid(int) (
sfunc = int4pl,
stype = int
);
SELECT invalid(word_count) FROM articles;
ERROR: unsupported aggregate function invalid
DROP AGGREGATE invalid(int);
SET client_min_messages to 'DEBUG2';
-- max, min, sum, count is somehow implemented
-- differently in distributed planning
SELECT max(word_count) as max, min(word_count) as min,

View File

@ -488,7 +488,6 @@ COPY articles_single_shard TO stdout;
DEBUG: Creating router plan
DEBUG: Plan is router executable
50 10 anjanette 19519
-- error out for queries with aggregates
SELECT avg(word_count)
FROM articles
WHERE author_id = 2;
@ -500,6 +499,16 @@ DETAIL: distribution column value: 2
12356.400000000000
(1 row)
-- error out on unsupported aggregate
SET client_min_messages to 'NOTICE';
CREATE AGGREGATE public.invalid(int) (
sfunc = int4pl,
stype = int
);
SELECT invalid(word_count) FROM articles;
ERROR: unsupported aggregate function invalid
DROP AGGREGATE invalid(int);
SET client_min_messages to 'DEBUG2';
-- max, min, sum, count is somehow implemented
-- differently in distributed planning
SELECT max(word_count) as max, min(word_count) as min,

View File

@ -271,11 +271,24 @@ SELECT id
-- copying from a single shard table does not require the master query
COPY articles_single_shard TO stdout;
-- error out for queries with aggregates
SELECT avg(word_count)
FROM articles
WHERE author_id = 2;
-- error out on unsupported aggregate
SET client_min_messages to 'NOTICE';
CREATE AGGREGATE public.invalid(int) (
sfunc = int4pl,
stype = int
);
SELECT invalid(word_count) FROM articles;
DROP AGGREGATE invalid(int);
SET client_min_messages to 'DEBUG2';
-- max, min, sum, count is somehow implemented
-- differently in distributed planning
SELECT max(word_count) as max, min(word_count) as min,
@ -313,5 +326,4 @@ SELECT * FROM articles TABLESAMPLE BERNOULLI (0) WHERE author_id = 1;
SELECT * FROM articles TABLESAMPLE SYSTEM (100) WHERE author_id = 1 ORDER BY id;
SELECT * FROM articles TABLESAMPLE BERNOULLI (100) WHERE author_id = 1 ORDER BY id;
SET client_min_messages to 'NOTICE';