2023-08-09 11:25:32 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
# shellcheck source=../shell_config.sh
|
|
|
|
. "$CUR_DIR"/../shell_config.sh
|
|
|
|
|
|
|
|
FILE_DIR=$CLICKHOUSE_TEST_UNIQUE_NAME
|
|
|
|
mkdir -p $FILE_DIR
|
|
|
|
|
2023-08-09 13:05:52 +00:00
|
|
|
$CLICKHOUSE_LOCAL -q "select * from numbers(100000) format Native" > $FILE_DIR/data.native
|
2023-08-09 11:25:32 +00:00
|
|
|
$CLICKHOUSE_LOCAL -q "select * from numbers(100000) format CSV" > $FILE_DIR/data.csv
|
|
|
|
$CLICKHOUSE_LOCAL -q "select * from numbers(100000) format JSONEachRow" > $FILE_DIR/data.jsonl
|
|
|
|
|
|
|
|
$CLICKHOUSE_LOCAL -q "desc file('$FILE_DIR/*', One)"
|
|
|
|
$CLICKHOUSE_LOCAL -q "select * from file('$FILE_DIR/*', One)"
|
2023-08-09 13:06:22 +00:00
|
|
|
$CLICKHOUSE_LOCAL -q "select _file from file('$FILE_DIR/*', One) order by _file"
|
2023-08-09 11:25:32 +00:00
|
|
|
$CLICKHOUSE_LOCAL -q "select * from file('$FILE_DIR/*', One, 'x UInt8')"
|
|
|
|
$CLICKHOUSE_LOCAL -q "select * from file('$FILE_DIR/*', One, 'x UInt64')" 2>&1 | grep "BAD_ARGUMENTS" -c
|
|
|
|
$CLICKHOUSE_LOCAL -q "select * from file('$FILE_DIR/*', One, 'x UInt8, y UInt8')" 2>&1 | grep "BAD_ARGUMENTS" -c
|
|
|
|
|
|
|
|
rm -rf $FILE_DIR
|
|
|
|
|