From 6e0d2a427c4e1a3145d2ac33d6cc94040ffd95dc Mon Sep 17 00:00:00 2001 From: nikitamikhaylov Date: Thu, 10 Sep 2020 19:30:11 +0300 Subject: [PATCH] add another test --- .../01460_line_as_string_format.reference | 2 ++ .../01460_line_as_string_format.sh | 24 ++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/queries/0_stateless/01460_line_as_string_format.reference b/tests/queries/0_stateless/01460_line_as_string_format.reference index dec67eb2e0a..c795fba4309 100644 --- a/tests/queries/0_stateless/01460_line_as_string_format.reference +++ b/tests/queries/0_stateless/01460_line_as_string_format.reference @@ -4,3 +4,5 @@ "array" : [1, 2, 3], Finally implement this new feature. +42 ClickHouse +42 ClickHouse is a `fast` #open-source# (OLAP) database "management" :system: diff --git a/tests/queries/0_stateless/01460_line_as_string_format.sh b/tests/queries/0_stateless/01460_line_as_string_format.sh index a985bc207a8..60a960d2bf8 100755 --- a/tests/queries/0_stateless/01460_line_as_string_format.sh +++ b/tests/queries/0_stateless/01460_line_as_string_format.sh @@ -3,17 +3,29 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) . "$CURDIR"/../shell_config.sh -$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS line_as_string"; - -$CLICKHOUSE_CLIENT --query="CREATE TABLE line_as_string(field String) ENGINE = Memory"; +$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS line_as_string1"; +$CLICKHOUSE_CLIENT --query="CREATE TABLE line_as_string1(field String) ENGINE = Memory"; echo '"id" : 1, "date" : "01.01.2020", "string" : "123{{{\"\\", "array" : [1, 2, 3], -Finally implement this new feature.' | $CLICKHOUSE_CLIENT --query="INSERT INTO line_as_string FORMAT LineAsString"; +Finally implement this new feature.' | $CLICKHOUSE_CLIENT --query="INSERT INTO line_as_string1 FORMAT LineAsString"; -$CLICKHOUSE_CLIENT --query="SELECT * FROM line_as_string"; -$CLICKHOUSE_CLIENT --query="DROP TABLE line_as_string" +$CLICKHOUSE_CLIENT --query="SELECT * FROM line_as_string1"; +$CLICKHOUSE_CLIENT --query="DROP TABLE line_as_string1" +$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS line_as_string2"; +$CLICKHOUSE_CLIENT --query="create table line_as_string2( + a UInt64 default 42, + b String materialized toString(a), + c String +) engine=MergeTree() order by tuple();"; + +$CLICKHOUSE_CLIENT --query="INSERT INTO line_as_string2(c) values ('ClickHouse')"; + +echo 'ClickHouse is a `fast` #open-source# (OLAP) 'database' "management" :system:' | $CLICKHOUSE_CLIENT --query="INSERT INTO line_as_string2(c) FORMAT LineAsString"; + +$CLICKHOUSE_CLIENT --query="SELECT * FROM line_as_string2 order by c"; +$CLICKHOUSE_CLIENT --query="DROP TABLE line_as_string2"