2016-12-30 06:18:57 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-12-15 19:34:19 +00:00
|
|
|
|
2016-12-30 06:18:57 +00:00
|
|
|
set -e
|
|
|
|
|
2017-11-01 11:46:58 +00:00
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2020-12-28 11:46:53 +00:00
|
|
|
# shellcheck source=../shell_config.sh
|
2020-08-01 00:51:12 +00:00
|
|
|
. "$CURDIR"/../shell_config.sh
|
2016-12-30 06:23:30 +00:00
|
|
|
|
2018-08-23 00:14:26 +00:00
|
|
|
echo -ne '\\tHello\t123\t\\N\n\\N\t\t2000-01-01 00:00:00\n' | ${CLICKHOUSE_LOCAL} --input-format=TabSeparated --output-format=TabSeparated --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne 'Hello,123,\\N\n\\N,0,"2000-01-01 00:00:00"' | ${CLICKHOUSE_LOCAL} --input-format=CSV --output-format=TabSeparated --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne '"\\Hello",123,\\N\n"\\N",0,"2000-01-01 00:00:00"' | ${CLICKHOUSE_LOCAL} --input-format=CSV --output-format=TabSeparated --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne '{"s" : null, "x" : 123}, {"s" : "\N", "t":"2000-01-01 00:00:00"}' | ${CLICKHOUSE_LOCAL} --input-format=JSONEachRow --output-format=TabSeparated --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo "(NULL, 111, '2000-01-01 00:00:00'), ('\N', NULL, NULL), ('a\Nb', NULL, NULL)" | ${CLICKHOUSE_LOCAL} --input-format=Values --output-format=TabSeparated --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
2016-12-30 06:23:30 +00:00
|
|
|
|
2018-08-23 00:14:26 +00:00
|
|
|
echo -ne '\\tHello\t123\t\\N\n\\N\t\t2000-01-01 00:00:00\n' | ${CLICKHOUSE_LOCAL} --input-format=TabSeparated --output-format=CSV --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne 'Hello,123,\\N\n\\N,0,"2000-01-01 00:00:00"' | ${CLICKHOUSE_LOCAL} --input-format=CSV --output-format=CSV --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne '"\\Hello",123,\\N\n"\\N",0,"2000-01-01 00:00:00"' | ${CLICKHOUSE_LOCAL} --input-format=CSV --output-format=CSV --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne '{"s" : null, "x" : 123}, {"s" : "\N", "t":"2000-01-01 00:00:00"}' | ${CLICKHOUSE_LOCAL} --input-format=JSONEachRow --output-format=CSV --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo "(NULL, 111, '2000-01-01 00:00:00'), ('\N', NULL, NULL), ('a\Nb', NULL, NULL)" | ${CLICKHOUSE_LOCAL} --input-format=Values --output-format=CSV --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
2016-12-30 06:23:30 +00:00
|
|
|
|
2018-08-23 00:14:26 +00:00
|
|
|
echo -ne '\\tHello\t123\t\\N\n\\N\t\t2000-01-01 00:00:00\n' | ${CLICKHOUSE_LOCAL} --input-format=TabSeparated --output-format=JSONEachRow --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne 'Hello,123,\\N\n\\N,0,"2000-01-01 00:00:00"' | ${CLICKHOUSE_LOCAL} --input-format=CSV --output-format=JSONEachRow --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne '"\\Hello",123,\\N\n"\\N",0,"2000-01-01 00:00:00"' | ${CLICKHOUSE_LOCAL} --input-format=CSV --output-format=JSONEachRow --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne '{"s" : null, "x" : 123}, {"s" : "\N", "t":"2000-01-01 00:00:00"}' | ${CLICKHOUSE_LOCAL} --input-format=JSONEachRow --output-format=JSONEachRow --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo "(NULL, 111, '2000-01-01 00:00:00'), ('\N', NULL, NULL), ('a\Nb', NULL, NULL)" | ${CLICKHOUSE_LOCAL} --input-format=Values --output-format=JSONEachRow --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
2017-11-01 11:46:58 +00:00
|
|
|
|
2018-08-23 00:14:26 +00:00
|
|
|
echo -ne '\\tHello\t123\t\\N\n\\N\t\t2000-01-01 00:00:00\n' | ${CLICKHOUSE_LOCAL} --input-format=TabSeparated --output-format=Values --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne 'Hello,123,\\N\n\\N,0,"2000-01-01 00:00:00"' | ${CLICKHOUSE_LOCAL} --input-format=CSV --output-format=Values --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne '"\\Hello",123,\\N\n"\\N",0,"2000-01-01 00:00:00"' | ${CLICKHOUSE_LOCAL} --input-format=CSV --output-format=Values --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo -ne '{"s" : null, "x" : 123}, {"s" : "\N", "t":"2000-01-01 00:00:00"}' | ${CLICKHOUSE_LOCAL} --input-format=JSONEachRow --output-format=Values --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|
|
|
|
echo "(NULL, 111, '2000-01-01 00:00:00'), ('\N', NULL, NULL), ('a\Nb', NULL, NULL)" | ${CLICKHOUSE_LOCAL} --input-format=Values --output-format=Values --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table"
|