2022-08-12 18:56:21 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-08-14 10:40:32 +00:00
|
|
|
# Tags: no-fasttest
|
2022-08-12 18:56:21 +00:00
|
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
# shellcheck source=../shell_config.sh
|
|
|
|
. "$CURDIR"/../shell_config.sh
|
|
|
|
|
|
|
|
USER_FILES_PATH=$(clickhouse-client --query "select _path,_file from file('nonexist.txt', 'CSV', 'val1 char')" 2>&1 | grep Exception | awk '{gsub("/nonexist.txt","",$9); print $9}')
|
2023-04-09 19:55:45 +00:00
|
|
|
UNIQ_DEST_PATH=$USER_FILES_PATH/test-02383-$RANDOM-$RANDOM
|
|
|
|
mkdir -p $UNIQ_DEST_PATH
|
2022-08-12 18:56:21 +00:00
|
|
|
|
2023-04-09 19:55:45 +00:00
|
|
|
cp $CURDIR/data_arrow/dictionary*.arrow $UNIQ_DEST_PATH/
|
|
|
|
cp $CURDIR/data_arrow/corrupted.arrow $UNIQ_DEST_PATH/
|
|
|
|
cp $CURDIR/data_arrow/dict_with_nulls.arrow $UNIQ_DEST_PATH/
|
2022-08-12 18:56:21 +00:00
|
|
|
|
2023-04-09 19:55:45 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "desc file('$UNIQ_DEST_PATH/dictionary1.arrow')"
|
|
|
|
$CLICKHOUSE_CLIENT -q "select * from file('$UNIQ_DEST_PATH/dictionary1.arrow') settings max_threads=1"
|
|
|
|
$CLICKHOUSE_CLIENT -q "desc file('$UNIQ_DEST_PATH/dictionary2.arrow')"
|
|
|
|
$CLICKHOUSE_CLIENT -q "select * from file('$UNIQ_DEST_PATH/dictionary2.arrow') settings max_threads=1"
|
|
|
|
$CLICKHOUSE_CLIENT -q "desc file('$UNIQ_DEST_PATH/dictionary3.arrow')"
|
|
|
|
$CLICKHOUSE_CLIENT -q "select * from file('$UNIQ_DEST_PATH/dictionary3.arrow') settings max_threads=1"
|
2022-08-12 18:56:21 +00:00
|
|
|
|
2023-04-09 19:55:45 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "desc file('$UNIQ_DEST_PATH/corrupted.arrow')"
|
|
|
|
$CLICKHOUSE_CLIENT -q "select * from file('$UNIQ_DEST_PATH/corrupted.arrow')" 2>&1 | grep -F -q "INCORRECT_DATA" && echo OK || echo FAIL
|
2022-08-12 18:56:21 +00:00
|
|
|
|
2023-04-09 19:55:45 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "desc file('$UNIQ_DEST_PATH/dict_with_nulls.arrow')"
|
|
|
|
$CLICKHOUSE_CLIENT -q "select * from file('$UNIQ_DEST_PATH/dict_with_nulls.arrow') settings max_threads=1"
|
2022-08-16 12:56:51 +00:00
|
|
|
|
2023-04-09 19:55:45 +00:00
|
|
|
rm -rf $UNIQ_DEST_PATH
|