From 3aba406f47e2a01e1a27fa59519b8b0f9c0c18c2 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Thu, 6 Aug 2020 01:43:23 +0300 Subject: [PATCH] Add a test for PrettyCompactMonoBlock via clickhouse-local --- .../00405_PrettyCompactMonoBlock.reference | 32 +++++++++++++++++++ .../00405_PrettyCompactMonoBlock.sh | 13 ++++++++ 2 files changed, 45 insertions(+) create mode 100644 tests/queries/0_stateless/00405_PrettyCompactMonoBlock.reference create mode 100755 tests/queries/0_stateless/00405_PrettyCompactMonoBlock.sh diff --git a/tests/queries/0_stateless/00405_PrettyCompactMonoBlock.reference b/tests/queries/0_stateless/00405_PrettyCompactMonoBlock.reference new file mode 100644 index 00000000000..94d3efa6e0a --- /dev/null +++ b/tests/queries/0_stateless/00405_PrettyCompactMonoBlock.reference @@ -0,0 +1,32 @@ +one block +┌─number─┐ +│ 0 │ +│ 1 │ +└────────┘ +two blocks +┌─number─┐ +│ 0 │ +│ 0 │ +└────────┘ +extremes +┌─number─┐ +│ 0 │ +│ 1 │ +│ 2 │ +└────────┘ + +Extremes: +┌─number─┐ +│ 0 │ +│ 2 │ +└────────┘ +totals +┌─sum(number)─┐ +│ 2 │ +│ 1 │ +└─────────────┘ + +Totals: +┌─sum(number)─┐ +│ 3 │ +└─────────────┘ diff --git a/tests/queries/0_stateless/00405_PrettyCompactMonoBlock.sh b/tests/queries/0_stateless/00405_PrettyCompactMonoBlock.sh new file mode 100755 index 00000000000..a353ce5ea5c --- /dev/null +++ b/tests/queries/0_stateless/00405_PrettyCompactMonoBlock.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. "$CURDIR"/../shell_config.sh + +echo 'one block' +${CLICKHOUSE_LOCAL} --query="SELECT * FROM numbers(2)" --format PrettyCompactMonoBlock +echo 'two blocks' +${CLICKHOUSE_LOCAL} --query="SELECT * FROM numbers(1) UNION ALL SELECT * FROM numbers(1)" --format PrettyCompactMonoBlock +echo 'extremes' +${CLICKHOUSE_LOCAL} --query="SELECT * FROM numbers(3)" --format PrettyCompactMonoBlock --extremes=1 +echo 'totals' +${CLICKHOUSE_LOCAL} --query="SELECT sum(number) FROM numbers(3) GROUP BY number%2 WITH TOTALS" --format PrettyCompactMonoBlock