ClickHouse/tests/queries/0_stateless/02931_file_cluster.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
593 B
Bash
Raw Normal View History

2023-11-28 14:56:04 +00:00
#!/usr/bin/env bash
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}')
for i in {1..10}
do
echo \"file$i\",$i > $USER_FILES_PATH/file$i.csv
done
$CLICKHOUSE_CLIENT --query "SELECT * FROM fileCluster('test_cluster_two_shards_localhost', 'file{1..10}.csv', 'CSV', 's String, i UInt32') ORDER BY (i, s)"
rm $USER_FILES_PATH/file*.csv