2020-10-29 18:02:48 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-11-21 10:58:26 +00:00
|
|
|
# Tags: no-fasttest, no-parallel
|
2020-10-29 18:02:48 +00:00
|
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2020-12-28 11:46:53 +00:00
|
|
|
# shellcheck source=../shell_config.sh
|
2020-10-29 18:02:48 +00:00
|
|
|
. "$CURDIR"/../shell_config.sh
|
|
|
|
|
2021-09-17 13:11:44 +00:00
|
|
|
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}')
|
|
|
|
|
|
|
|
$CLICKHOUSE_CLIENT --multiquery --query "
|
|
|
|
SET allow_suspicious_low_cardinality_types=1;
|
|
|
|
CREATE TABLE IF NOT EXISTS test_01543 (value LowCardinality(String), value2 LowCardinality(UInt64)) ENGINE=Memory();
|
|
|
|
"
|
|
|
|
|
2021-09-17 13:14:33 +00:00
|
|
|
$CLICKHOUSE_CLIENT --query "INSERT INTO test_01543 SELECT toString(number), number FROM numbers(10)"
|
2020-10-29 18:02:48 +00:00
|
|
|
|
|
|
|
$CLICKHOUSE_CLIENT -q "SELECT * FROM test_01543 FORMAT Avro" |
|
|
|
|
$CLICKHOUSE_CLIENT -q "INSERT INTO test_01543 FORMAT Avro";
|
|
|
|
|
2021-09-17 13:11:44 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "SELECT * FROM test_01543";
|
|
|
|
|
2020-10-29 18:02:48 +00:00
|
|
|
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS test_01543"
|
2021-09-17 13:11:44 +00:00
|
|
|
|
|
|
|
$CLICKHOUSE_CLIENT --query "SELECT number % 2 ? number: NULL as x from numbers(10) FORMAT Avro" > $USER_FILES_PATH/test_01543.avro
|
|
|
|
|
2022-12-27 19:34:09 +00:00
|
|
|
$CLICKHOUSE_CLIENT --query "SELECT * FROM file('test_01543.avro', 'Avro', 'x LowCardinality(Nullable(UInt64))')" --allow_suspicious_low_cardinality_types 1
|
2021-09-17 13:11:44 +00:00
|
|
|
|
|
|
|
rm $USER_FILES_PATH/test_01543.avro
|