diff --git a/dbms/tests/queries/0_stateless/00407_parsing_nulls.reference b/dbms/tests/queries/0_stateless/00407_parsing_nulls.reference new file mode 100644 index 00000000000..fbd206f4c00 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00407_parsing_nulls.reference @@ -0,0 +1,11 @@ +\tHello 123 \N +\N 0 2000-01-01 00:00:00 +Hello 123 \N +\N 0 2000-01-01 00:00:00 +\\Hello 123 \N +\\N 0 2000-01-01 00:00:00 +\N 123 \N +N \N 2000-01-01 00:00:00 +\N 111 2000-01-01 00:00:00 + \N \N +ab \N \N diff --git a/dbms/tests/queries/0_stateless/00407_parsing_nulls.sh b/dbms/tests/queries/0_stateless/00407_parsing_nulls.sh new file mode 100755 index 00000000000..a044db5a1a3 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00407_parsing_nulls.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e + +echo -ne '\\tHello\t123\t\\N\n\\N\t\t2000-01-01 00:00:00\n' | clickhouse-local --format=TabSeparated --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table" 2>/dev/null +echo -ne 'Hello,123,\\N\n\\N,0,"2000-01-01 00:00:00"' | clickhouse-local --input-format=CSV --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table" 2>/dev/null +echo -ne '"\\Hello",123,\\N\n"\\N",0,"2000-01-01 00:00:00"' | clickhouse-local --input-format=CSV --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table" 2>/dev/null +echo -ne '{"s" : null, "x" : 123}, {"s" : "\N", "t":"2000-01-01 00:00:00"}' | clickhouse-local --input-format=JSONEachRow --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table" 2>/dev/null +echo "(NULL, 111, '2000-01-01 00:00:00'), ('\N', NULL, NULL), ('a\Nb', NULL, NULL)" | clickhouse-local --input-format=Values --structure='s Nullable(String), x Nullable(UInt64), t Nullable(DateTime)' --query="SELECT * FROM table" 2>/dev/null