From 2d616c54fb89fe9e17f4bcb4f79b22d9fcb4dc26 Mon Sep 17 00:00:00 2001 From: Colin Dellow Date: Wed, 7 Mar 2018 20:30:25 -0500 Subject: [PATCH] More tests --- parquet-generator/create-pg-db | 2 +- tests/create-query | 10 ++ tests/queries/009-rowid-group-by.sql | 11 +++ tests/queries/010-order-by-string7.sql | 101 +++++++++++++++++++++ tests/queries/011-order-by-string8.sql | 101 +++++++++++++++++++++ tests/queries/012-string-7-is-null.sql | 51 +++++++++++ tests/queries/013-string-7-is-not-null.sql | 51 +++++++++++ 7 files changed, 326 insertions(+), 1 deletion(-) create mode 100755 tests/create-query create mode 100644 tests/queries/009-rowid-group-by.sql create mode 100644 tests/queries/010-order-by-string7.sql create mode 100644 tests/queries/011-order-by-string8.sql create mode 100644 tests/queries/012-string-7-is-null.sql create mode 100644 tests/queries/013-string-7-is-not-null.sql diff --git a/parquet-generator/create-pg-db b/parquet-generator/create-pg-db index 48f476a..05e23df 100755 --- a/parquet-generator/create-pg-db +++ b/parquet-generator/create-pg-db @@ -34,7 +34,7 @@ COPY nulls FROM '$here/nulls.csv'; CREATE OR REPLACE FUNCTION quote(TEXT) RETURNS TEXT AS \$\$ BEGIN - RETURN \$1; + RETURN CASE WHEN \$1 IS NULL THEN 'NULL' ELSE \$1 END; END; \$\$ LANGUAGE 'plpgsql' IMMUTABLE; diff --git a/tests/create-query b/tests/create-query new file mode 100755 index 0000000..40b49cb --- /dev/null +++ b/tests/create-query @@ -0,0 +1,10 @@ +#!/bin/bash + +set -euo pipefail + +query=${1:?must provide query} + +echo "$query" +psql parquet postgres <