From a4f368af9c487066c264bfe6f8fe3716583de448 Mon Sep 17 00:00:00 2001 From: Colin Dellow Date: Sun, 4 Mar 2018 13:02:42 -0500 Subject: [PATCH] Add tests for unsupported types --- .gitignore | 2 + parquet-generator/parquets.py | 4 +- parquet-generator/unsupported-uint32.parquet | Bin 87 -> 0 bytes tests/test-unsupported | 37 +++++++++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) delete mode 100644 parquet-generator/unsupported-uint32.parquet create mode 100755 tests/test-unsupported diff --git a/.gitignore b/.gitignore index 79de523..935812d 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,5 @@ /sqlite-autoconf* /cmds.txt /sqlite-with-parquet +/testcase-out.txt +/testcase-err.txt diff --git a/parquet-generator/parquets.py b/parquet-generator/parquets.py index b164e4e..af12105 100644 --- a/parquet-generator/parquets.py +++ b/parquet-generator/parquets.py @@ -79,7 +79,9 @@ def write_unsupported_parquets(): pa.null(), pa.uint8(), pa.uint16(), - pa.uint32(), + # per https://issues.apache.org/jira/browse/ARROW-436, I think + # Parquet v1.0 can't serialize UINT32 + #pa.uint32(), pa.uint64(), # pa.float16() <-- not supported by us, but also not by pyarrow # TODO: list_, struct, dict diff --git a/parquet-generator/unsupported-uint32.parquet b/parquet-generator/unsupported-uint32.parquet deleted file mode 100644 index b9dc0b10899ae1f2083f7e491b75630adfb27f2c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87 zcmWG=3^EjDlGHI}kYFoL&PdHo6lG!%Wl?34;3&<^D={{THxOlD5Mz+!(NHQ#EGjHb pEzwObC{QR%Eh^5;&r>keGuAWG4fb;k2=?#~Ven>PU@FE6rcbA diff --git a/tests/test-unsupported b/tests/test-unsupported new file mode 100755 index 0000000..1e538df --- /dev/null +++ b/tests/test-unsupported @@ -0,0 +1,37 @@ +#!/bin/bash +set -euo pipefail + +# Verify that all the unsupported.*parquet files result in an error when creating the virtual table, +# but don't segfault. + +load_unsupported() { + file=${1:?must provide file to load} + basename=$(basename "$file") + cat < /dev/null 2> testcase-err.txt + # We expect the 'SELECT 123' command to NOT have been run + if grep -q 123 testcase-out.txt; then + echo "...FAILED" >&2 + exit 1 + fi + done < <(echo "$unsupported_files") +} + +main "$@"