mirror of https://github.com/citusdata/citus.git
Test invalid aggregate
parent
2aa6852dea
commit
ae1171a373
|
@ -544,7 +544,6 @@ COPY articles_single_shard TO stdout;
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
50 10 anjanette 19519
|
50 10 anjanette 19519
|
||||||
-- error out for queries with aggregates
|
|
||||||
SELECT avg(word_count)
|
SELECT avg(word_count)
|
||||||
FROM articles
|
FROM articles
|
||||||
WHERE author_id = 2;
|
WHERE author_id = 2;
|
||||||
|
@ -556,6 +555,16 @@ DETAIL: distribution column value: 2
|
||||||
12356.400000000000
|
12356.400000000000
|
||||||
(1 row)
|
(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
|
-- max, min, sum, count is somehow implemented
|
||||||
-- differently in distributed planning
|
-- differently in distributed planning
|
||||||
SELECT max(word_count) as max, min(word_count) as min,
|
SELECT max(word_count) as max, min(word_count) as min,
|
||||||
|
|
|
@ -488,7 +488,6 @@ COPY articles_single_shard TO stdout;
|
||||||
DEBUG: Creating router plan
|
DEBUG: Creating router plan
|
||||||
DEBUG: Plan is router executable
|
DEBUG: Plan is router executable
|
||||||
50 10 anjanette 19519
|
50 10 anjanette 19519
|
||||||
-- error out for queries with aggregates
|
|
||||||
SELECT avg(word_count)
|
SELECT avg(word_count)
|
||||||
FROM articles
|
FROM articles
|
||||||
WHERE author_id = 2;
|
WHERE author_id = 2;
|
||||||
|
@ -500,6 +499,16 @@ DETAIL: distribution column value: 2
|
||||||
12356.400000000000
|
12356.400000000000
|
||||||
(1 row)
|
(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
|
-- max, min, sum, count is somehow implemented
|
||||||
-- differently in distributed planning
|
-- differently in distributed planning
|
||||||
SELECT max(word_count) as max, min(word_count) as min,
|
SELECT max(word_count) as max, min(word_count) as min,
|
||||||
|
|
|
@ -271,11 +271,24 @@ SELECT id
|
||||||
-- copying from a single shard table does not require the master query
|
-- copying from a single shard table does not require the master query
|
||||||
COPY articles_single_shard TO stdout;
|
COPY articles_single_shard TO stdout;
|
||||||
|
|
||||||
-- error out for queries with aggregates
|
|
||||||
SELECT avg(word_count)
|
SELECT avg(word_count)
|
||||||
FROM articles
|
FROM articles
|
||||||
WHERE author_id = 2;
|
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
|
-- max, min, sum, count is somehow implemented
|
||||||
-- differently in distributed planning
|
-- differently in distributed planning
|
||||||
SELECT max(word_count) as max, min(word_count) as min,
|
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 SYSTEM (100) WHERE author_id = 1 ORDER BY id;
|
||||||
SELECT * FROM articles TABLESAMPLE BERNOULLI (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';
|
SET client_min_messages to 'NOTICE';
|
||||||
|
|
Loading…
Reference in New Issue