ClickHouse/dbms/tests/queries/0_stateless/00485_http_insert_format.sh
2017-08-01 20:26:36 +03:00

15 lines
1.0 KiB
Bash
Executable File

#!/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"