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 <