2018-09-19 12:18:10 +00:00
#!/usr/bin/env bash
set -e
CURDIR = $( cd " $( dirname " ${ BASH_SOURCE [0] } " ) " && pwd )
2020-12-28 11:46:53 +00:00
# shellcheck source=../shell_config.sh
2020-08-01 00:51:12 +00:00
. " $CURDIR " /../shell_config.sh
2018-09-19 12:18:10 +00:00
2020-08-01 00:56:32 +00:00
[ -e " ${ CLICKHOUSE_TMP } " /test_squashing_block_without_column.out ] && rm " ${ CLICKHOUSE_TMP } " /test_squashing_block_without_column.out
2018-09-20 11:16:15 +00:00
2018-09-19 12:18:10 +00:00
${ CLICKHOUSE_CLIENT } --query " select number as SomeID, number+1 as OtherID from system.numbers limit 1000 into outfile ' ${ CLICKHOUSE_TMP } /test_squashing_block_without_column.out' format Native "
2019-04-16 14:13:13 +00:00
${ CLICKHOUSE_CLIENT } --query "drop table if exists squashed_numbers"
${ CLICKHOUSE_CLIENT } --query "create table squashed_numbers (SomeID UInt64, DifferentID UInt64, OtherID UInt64) engine Memory"
2018-09-19 12:18:10 +00:00
2019-04-16 14:13:13 +00:00
#address=${CLICKHOUSE_HOST}
#port=${CLICKHOUSE_PORT_HTTP}
#url="${CLICKHOUSE_PORT_HTTP_PROTO}://$address:$port/"
2018-09-20 11:16:15 +00:00
2019-10-11 13:34:26 +00:00
${ CLICKHOUSE_CURL } -sS --data-binary " @ ${ CLICKHOUSE_TMP } /test_squashing_block_without_column.out " " ${ CLICKHOUSE_URL } &query=insert%20into%20squashed_numbers%20format%20Native "
2018-09-19 12:18:10 +00:00
${ CLICKHOUSE_CLIENT } --query "select 'Still alive'"
2020-11-11 15:29:36 +00:00
${ CLICKHOUSE_CLIENT } --query "drop table squashed_numbers"