mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Added test for parsing NULLs in various formats [#METR-19266].
This commit is contained in:
parent
81a08bcd87
commit
9a17c907b0
11
dbms/tests/queries/0_stateless/00407_parsing_nulls.reference
Normal file
11
dbms/tests/queries/0_stateless/00407_parsing_nulls.reference
Normal file
@ -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
|
8
dbms/tests/queries/0_stateless/00407_parsing_nulls.sh
Executable file
8
dbms/tests/queries/0_stateless/00407_parsing_nulls.sh
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user