mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Cover clickhouse-compressor in tests
This commit is contained in:
parent
30508c1b50
commit
e8aae12984
31
tests/queries/0_stateless/01621_clickhouse_compressor.sh
Executable file
31
tests/queries/0_stateless/01621_clickhouse_compressor.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
set -e
|
||||
|
||||
TEMP_DIR="$(mktemp -d /tmp/clickhouse.test..XXXXXX)"
|
||||
cd "${TEMP_DIR:?}"
|
||||
|
||||
function cleanup()
|
||||
{
|
||||
rm -fr "${TEMP_DIR:?}"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# This is random garbage, so compression ratio will be very low.
|
||||
tr -cd 'a-z0-9' < /dev/urandom | head -c1M > input
|
||||
|
||||
# stdin/stdout streams
|
||||
$CLICKHOUSE_COMPRESSOR < input > output
|
||||
diff -q <($CLICKHOUSE_COMPRESSOR --decompress < output) input
|
||||
|
||||
# positional arguments, and that fact that input/output will be overwritten
|
||||
$CLICKHOUSE_COMPRESSOR input output
|
||||
diff -q <($CLICKHOUSE_COMPRESSOR --decompress output) input
|
||||
|
||||
# --offset-in-decompressed-block
|
||||
diff -q <($CLICKHOUSE_COMPRESSOR --decompress --offset-in-decompressed-block 10 output) <(tail -c+$((10+1)) input)
|
||||
|
||||
# TODO: --offset-in-compressed-file using some .bin file (via clickhouse-local + check-marks)
|
@ -22,6 +22,7 @@ export CLICKHOUSE_CLIENT=${CLICKHOUSE_CLIENT:="$CLICKHOUSE_CLIENT_BINARY ${CLICK
|
||||
[ -x "${CLICKHOUSE_BINARY}" ] && CLICKHOUSE_LOCAL=${CLICKHOUSE_LOCAL:="${CLICKHOUSE_BINARY} local"}
|
||||
export CLICKHOUSE_LOCAL=${CLICKHOUSE_LOCAL:="${CLICKHOUSE_BINARY}-local"}
|
||||
export CLICKHOUSE_OBFUSCATOR=${CLICKHOUSE_OBFUSCATOR:="${CLICKHOUSE_BINARY}-obfuscator"}
|
||||
export CLICKHOUSE_COMPRESSOR=${CLICKHOUSE_COMPRESSOR:="${CLICKHOUSE_BINARY}-compressor"}
|
||||
export CLICKHOUSE_BENCHMARK=${CLICKHOUSE_BENCHMARK:="${CLICKHOUSE_BINARY}-benchmark ${CLICKHOUSE_BENCHMARK_OPT0:-}"}
|
||||
export CLICKHOUSE_GIT_IMPORT=${CLICKHOUSE_GIT_IMPORT="${CLICKHOUSE_BINARY}-git-import"}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user