From 273267ca8b0cdb8d0d38e9deac24ebc2aabeb0f3 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 14 May 2020 20:36:59 +0300 Subject: [PATCH] Added a test for empty external data --- .../01279_empty_external_table.reference | 3 +++ .../0_stateless/01279_empty_external_table.sh | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/queries/0_stateless/01279_empty_external_table.reference create mode 100755 tests/queries/0_stateless/01279_empty_external_table.sh diff --git a/tests/queries/0_stateless/01279_empty_external_table.reference b/tests/queries/0_stateless/01279_empty_external_table.reference new file mode 100644 index 00000000000..bb5ee5c21eb --- /dev/null +++ b/tests/queries/0_stateless/01279_empty_external_table.reference @@ -0,0 +1,3 @@ +0 +0 +1 diff --git a/tests/queries/0_stateless/01279_empty_external_table.sh b/tests/queries/0_stateless/01279_empty_external_table.sh new file mode 100755 index 00000000000..62bcf4bb703 --- /dev/null +++ b/tests/queries/0_stateless/01279_empty_external_table.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +set -e + +touch ${CLICKHOUSE_TMP}/empty.tsv +clickhouse-client --query="SELECT count() FROM data" --external --file=${CLICKHOUSE_TMP}/empty.tsv --name=data --types=UInt32 +rm ${CLICKHOUSE_TMP}/empty.tsv + +echo -n | clickhouse-client --query="SELECT count() FROM data" --external --file=- --name=data --types=UInt32 +echo | clickhouse-client --query="SELECT count() FROM data" --external --file=- --name=data --types=String