2020-12-21 21:33:01 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2020-12-28 11:46:53 +00:00
|
|
|
# shellcheck source=../shell_config.sh
|
2020-12-21 21:33:01 +00:00
|
|
|
. "$CURDIR"/../shell_config.sh
|
|
|
|
|
2024-07-29 20:06:55 +00:00
|
|
|
${CLICKHOUSE_CLIENT} --query "
|
2020-12-21 21:33:01 +00:00
|
|
|
DROP TABLE IF EXISTS test;
|
|
|
|
CREATE TABLE test (a Array(String)) ENGINE = Memory;
|
|
|
|
"
|
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} --query "INSERT INTO test FORMAT CSV" <<END
|
|
|
|
"['Hello', 'world', '42"" TV']"
|
|
|
|
END
|
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} --format_csv_allow_single_quotes 0 --query "INSERT INTO test FORMAT CSV" <<END
|
|
|
|
"'Hello', 'world', '42"" TV'"
|
|
|
|
END
|
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} --input_format_csv_arrays_as_nested_csv 1 --query "INSERT INTO test FORMAT CSV" <<END
|
|
|
|
"[""Hello"", ""world"", ""42"""" TV""]"
|
|
|
|
"""Hello"", ""world"", ""42"""" TV"""
|
|
|
|
END
|
|
|
|
|
2024-07-29 20:06:55 +00:00
|
|
|
${CLICKHOUSE_CLIENT} --query "
|
2020-12-21 21:33:01 +00:00
|
|
|
SELECT * FROM test;
|
|
|
|
DROP TABLE IF EXISTS test;
|
|
|
|
"
|