Skip to content

Commit

Permalink
Add unit test for distributed tables
Browse files Browse the repository at this point in the history
This commit aims to add a unit test for executing queries on
distributed tables. Test aims to get the error message when
there are no shards created for the distributed tables.
  • Loading branch information
onderkalaci committed Jan 5, 2015
1 parent 07acc17 commit 6e690cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions expected/queries.out
Expand Up @@ -13,6 +13,11 @@ SELECT master_create_distributed_table('articles', 'author_id');

(1 row)

-- test when a table is distributed but no shards created yet
SELECT count(*) from articles;
ERROR: cannot plan SELECT query
DETAIL: There are no existing shards for the distributed table.
HINT: Run "master_create_worker_shards" to create shards for the distributed table.
\set VERBOSITY terse
SELECT master_create_worker_shards('articles', 2, 1);
WARNING: Connection failed to adeadhost:5432
Expand Down
3 changes: 3 additions & 0 deletions sql/queries.sql
Expand Up @@ -11,6 +11,9 @@ CREATE TABLE articles (

SELECT master_create_distributed_table('articles', 'author_id');

-- test when a table is distributed but no shards created yet
SELECT count(*) from articles;

\set VERBOSITY terse
SELECT master_create_worker_shards('articles', 2, 1);
\set VERBOSITY default
Expand Down

0 comments on commit 6e690cb

Please sign in to comment.