提交 e43f49ed 编写于 作者: A Azat Khuzhin

Add a test for *WithNames* via clickhouse-local (corner cases)

- empty rows
- multiple runs to the same file (write header only once)
上级 8d5011a3
zero rows
TSVWithNames
TSVWithNamesAndTypes
CSVWithNames
multi clickhouse-local one file
TSVWithNames
0
0
0
TSVWithNamesAndTypes
0
0
0
CSVWithNames
0
0
0
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../shell_config.sh
# zero rows
echo 'zero rows'
for format in TSVWithNames TSVWithNamesAndTypes CSVWithNames; do
echo $format
${CLICKHOUSE_LOCAL} --query="
CREATE TABLE ${format}_01375 ENGINE File($format, '01375_$format.tsv') AS SELECT * FROM numbers(1) WHERE number < 0;
SELECT * FROM ${format}_01375;
DROP TABLE ${format}_01375;
"
rm 01375_$format.tsv
done
# run multiple times to the same file
echo 'multi clickhouse-local one file'
for format in TSVWithNames TSVWithNamesAndTypes CSVWithNames; do
echo $format
for _ in {1..2}; do
${CLICKHOUSE_LOCAL} --query="
CREATE TABLE ${format}_01375 ENGINE File($format, '01375_$format.tsv') AS SELECT * FROM numbers(1);
SELECT * FROM ${format}_01375;
DROP TABLE ${format}_01375;
"
done
rm 01375_$format.tsv
done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册