2017-10-12 19:46:40 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-12-15 19:34:19 +00:00
|
|
|
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
|
2017-12-15 19:34:19 +00:00
|
|
|
|
2019-09-23 16:18:19 +00:00
|
|
|
# https://github.com/ClickHouse/ClickHouse/issues/1300
|
2017-10-12 19:46:40 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS advertiser";
|
|
|
|
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS advertiser_test";
|
|
|
|
$CLICKHOUSE_CLIENT -q "CREATE TABLE advertiser ( action_date Date, adblock UInt8, imps Int64 ) Engine = SummingMergeTree( action_date, ( adblock ), 8192, ( imps ) )";
|
|
|
|
$CLICKHOUSE_CLIENT -q "CREATE TABLE advertiser_test ( action_date Date, adblock UInt8, imps Int64, Hash UInt64 ) Engine = SummingMergeTree( action_date, ( adblock, Hash ), 8192, ( imps ) )";
|
2017-10-12 19:46:40 +00:00
|
|
|
|
|
|
|
# This test will fail. It's ok.
|
2019-04-16 14:13:13 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "INSERT INTO advertiser_test SELECT *, sipHash64( CAST(adblock AS String) ), CAST(1 AS Int8) FROM advertiser;" 2>/dev/null
|
|
|
|
$CLICKHOUSE_CLIENT -q "DROP TABLE advertiser";
|
|
|
|
$CLICKHOUSE_CLIENT -q "DROP TABLE advertiser_test";
|
2017-12-15 19:34:19 +00:00
|
|
|
$CLICKHOUSE_CLIENT -q "SELECT 'Still alive'";
|