mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-19 15:01:03 +00:00
22 lines
1.0 KiB
Bash
22 lines
1.0 KiB
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||
|
. $CURDIR/../shell_config.sh
|
||
|
|
||
|
|
||
|
$CLICKHOUSE_CLIENT --query="drop table if exists tab_str";
|
||
|
$CLICKHOUSE_CLIENT --query="drop table if exists tab_str_lc";
|
||
|
|
||
|
$CLICKHOUSE_CLIENT --query="create table tab_str (x String) engine = MergeTree order by tuple()";
|
||
|
$CLICKHOUSE_CLIENT --query="create table tab_str_lc (x LowCardinality(String)) engine = MergeTree order by tuple()";
|
||
|
$CLICKHOUSE_CLIENT --query="insert into tab_str values ('abc')";
|
||
|
|
||
|
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL_PARAMS}&query=select+x+from+tab_str+format+Native" | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL_PARAMS}&query=INSERT+INTO+tab_str_lc+FORMAT+Native" --data-binary @-
|
||
|
|
||
|
$CLICKHOUSE_CLIENT --query="select x from tab_str_lc";
|
||
|
|
||
|
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL_PARAMS}&query=select+x+from+tab_str_lc+format+Native" | ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL_PARAMS}&query=INSERT+INTO+tab_str+FORMAT+Native" --data-binary @-
|
||
|
|
||
|
$CLICKHOUSE_CLIENT --query="select '----'";
|
||
|
$CLICKHOUSE_CLIENT --query="select x from tab_str";
|