mirror of
https://github.com/cldellow/sqlite-parquet-vtable.git
synced 2025-09-12 22:29:58 +00:00
Support BLOBs
This commit is contained in:
41
tests/test-supported
Executable file
41
tests/test-supported
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Verify that all the non-unsupported.*parquet files can be loaded and 'SELECT * FROM x LIMIT 1'ed
|
||||
# without segfaulting.
|
||||
|
||||
load_supported() {
|
||||
file=${1:?must provide file to load}
|
||||
basename=$(basename "$file")
|
||||
cat <<EOF
|
||||
.echo on
|
||||
.load parquet/libparquet
|
||||
.testcase $basename
|
||||
.bail on
|
||||
CREATE VIRTUAL TABLE test USING parquet('$file');
|
||||
SELECT * FROM test LIMIT 1;
|
||||
SELECT 123;
|
||||
EOF
|
||||
}
|
||||
|
||||
main() {
|
||||
root=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
root=$(readlink -f "$root")
|
||||
cd "$root"
|
||||
|
||||
supported_files=$(find . -type f -name '*.parquet' -not -name 'unsupported*.parquet')
|
||||
while read -r supported; do
|
||||
echo "Testing: $supported"
|
||||
if ! "$root"/sqlite/sqlite3 -init <(load_supported "$supported") < /dev/null > /dev/null 2> testcase-err.txt; then
|
||||
echo "...FAILED; check testcase-{out,err}.txt" >&2
|
||||
exit 1
|
||||
fi
|
||||
# We expect the 'SELECT 123' command to have been run
|
||||
if ! grep -q 123 testcase-out.txt; then
|
||||
echo "...FAILED; check testcase-{out,err}.txt" >&2
|
||||
exit 1
|
||||
fi
|
||||
done < <(echo "$supported_files")
|
||||
}
|
||||
|
||||
main "$@"
|
Reference in New Issue
Block a user