Added test [#METR-25976].

This commit is contained in:
Alexey Milovidov 2017-08-01 20:26:36 +03:00
parent 1d7a91a544
commit 35ff7ab9f2
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,6 @@
{"s":"","x":"ABC"}
{"s":"","x":"DEF"}
{"s":"","x":"JKL"}
{"s":"","x":"MNO"}
{"s":"hello","x":"GHI"}
{"s":"hello","x":"PQR"}

View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
clickhouse-client --query="DROP TABLE IF EXISTS test.format"
clickhouse-client --query="CREATE TABLE test.format (s String, x FixedString(3)) ENGINE = Memory"
echo -ne '\tABC\n' | curl -sS "http://localhost:8123/?query=INSERT+INTO+test.format+FORMAT+TabSeparated" --data-binary @-
echo -ne 'INSERT INTO test.format FORMAT TabSeparated\n\tDEF\n' | curl -sS "http://localhost:8123/" --data-binary @-
echo -ne 'INSERT INTO test.format FORMAT TabSeparated hello\tGHI\n' | curl -sS "http://localhost:8123/" --data-binary @-
echo -ne 'INSERT INTO test.format FORMAT TabSeparated\r\n\tJKL\n' | curl -sS "http://localhost:8123/" --data-binary @-
echo -ne 'INSERT INTO test.format FORMAT TabSeparated \t\r\n\tMNO\n' | curl -sS "http://localhost:8123/" --data-binary @-
echo -ne 'INSERT INTO test.format FORMAT TabSeparated\t\t\thello\tPQR\n' | curl -sS "http://localhost:8123/" --data-binary @-
clickhouse-client --query="SELECT * FROM test.format ORDER BY s, x FORMAT JSONEachRow"
clickhouse-client --query="DROP TABLE test.format"