mirror of
				https://github.com/cldellow/sqlite-parquet-vtable.git
				synced 2025-11-04 02:39:56 +00:00 
			
		
		
		
	`./make-linux` clones and builds: - arrow - brotli - lz4 - parquet - snappy - zlib - zstd - this project as a statically linked binary. Two Boost libs are still pulled in as shared libs, should probably fix that, too, for ultimate portability.
		
			
				
	
	
		
			38 lines
		
	
	
		
			994 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			994 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/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 <<EOF
 | 
						|
.echo on
 | 
						|
.load build/linux/libparquet
 | 
						|
.testcase $basename
 | 
						|
.bail on
 | 
						|
CREATE VIRTUAL TABLE test USING parquet('$file');
 | 
						|
SELECT 123;
 | 
						|
EOF
 | 
						|
}
 | 
						|
 | 
						|
main() {
 | 
						|
  root=$(dirname "${BASH_SOURCE[0]}")/..
 | 
						|
  root=$(readlink -f "$root")
 | 
						|
  cd "$root"
 | 
						|
 | 
						|
  unsupported_files=$(find . -type f -name 'unsupported*.parquet')
 | 
						|
  while read -r unsupported; do
 | 
						|
    echo "Testing: $unsupported"
 | 
						|
    "$root"/sqlite/sqlite3 -init <(load_unsupported "$unsupported") < /dev/null > /dev/null 2> testcase-stderr.txt
 | 
						|
    # We expect the 'SELECT 123' command to NOT have been run
 | 
						|
    if grep -q 123 testcase-out.txt; then
 | 
						|
      echo "...FAILED; expected an error message. Check testcase-{out,err}.txt" >&2
 | 
						|
      exit 1
 | 
						|
    fi
 | 
						|
  done < <(echo "$unsupported_files")
 | 
						|
}
 | 
						|
 | 
						|
main "$@"
 |