2017-08-01 17:26:36 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-12-15 19:34:19 +00:00
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
. $CURDIR/../shell_config.sh
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS format"
|
|
|
|
$CLICKHOUSE_CLIENT --query="CREATE TABLE format (s String, x FixedString(3)) ENGINE = Memory"
|
2017-12-15 19:34:19 +00:00
|
|
|
|
2019-10-11 13:34:26 +00:00
|
|
|
echo -ne '\tABC\n' | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}&query=INSERT+INTO+format+FORMAT+TabSeparated" --data-binary @-
|
|
|
|
echo -ne 'INSERT INTO format FORMAT TabSeparated\n\tDEF\n' | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" --data-binary @-
|
|
|
|
echo -ne 'INSERT INTO format FORMAT TabSeparated hello\tGHI\n' | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" --data-binary @-
|
|
|
|
echo -ne 'INSERT INTO format FORMAT TabSeparated\r\n\tJKL\n' | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" --data-binary @-
|
|
|
|
echo -ne 'INSERT INTO format FORMAT TabSeparated \t\r\n\tMNO\n' | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" --data-binary @-
|
|
|
|
echo -ne 'INSERT INTO format FORMAT TabSeparated\t\t\thello\tPQR\n' | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}" --data-binary @-
|
2017-12-15 19:34:19 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
$CLICKHOUSE_CLIENT --query="SELECT * FROM format ORDER BY s, x FORMAT JSONEachRow"
|
|
|
|
$CLICKHOUSE_CLIENT --query="DROP TABLE format"
|