From b774036d6e19d01af094ef26d271bf03071eb2d4 Mon Sep 17 00:00:00 2001 From: hcz Date: Thu, 6 Aug 2020 16:57:50 +0800 Subject: [PATCH] Add test case --- .../01429_empty_arrow_and_parquet.reference | 6 +++++ .../01429_empty_arrow_and_parquet.sh | 23 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 tests/queries/0_stateless/01429_empty_arrow_and_parquet.reference create mode 100755 tests/queries/0_stateless/01429_empty_arrow_and_parquet.sh diff --git a/tests/queries/0_stateless/01429_empty_arrow_and_parquet.reference b/tests/queries/0_stateless/01429_empty_arrow_and_parquet.reference new file mode 100644 index 00000000000..167851e057b --- /dev/null +++ b/tests/queries/0_stateless/01429_empty_arrow_and_parquet.reference @@ -0,0 +1,6 @@ +1 +1 +2 +2 +3 +3 diff --git a/tests/queries/0_stateless/01429_empty_arrow_and_parquet.sh b/tests/queries/0_stateless/01429_empty_arrow_and_parquet.sh new file mode 100755 index 00000000000..893cadfe17c --- /dev/null +++ b/tests/queries/0_stateless/01429_empty_arrow_and_parquet.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -e + +CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. "$CUR_DIR"/../shell_config.sh + + +${CLICKHOUSE_CLIENT} --query="DROP TABLE IF EXISTS test_empty_data" +${CLICKHOUSE_CLIENT} --query="CREATE TABLE test_empty_data (x Int8) ENGINE = Memory" + +(echo "INSERT INTO test_empty_data FORMAT Arrow" && ${CLICKHOUSE_CLIENT} --query="SELECT 1 AS x FORMAT Arrow") | ${CLICKHOUSE_CLIENT} +${CLICKHOUSE_CLIENT} --query="SELECT count() FROM test_empty_data" +(echo "INSERT INTO test_empty_data FORMAT Arrow" && ${CLICKHOUSE_CLIENT} --query="SELECT 1 AS x LIMIT 0 FORMAT Arrow") | ${CLICKHOUSE_CLIENT} +${CLICKHOUSE_CLIENT} --query="SELECT count() FROM test_empty_data" +(echo "INSERT INTO test_empty_data FORMAT ArrowStream" && ${CLICKHOUSE_CLIENT} --query="SELECT 1 AS x FORMAT ArrowStream") | ${CLICKHOUSE_CLIENT} +${CLICKHOUSE_CLIENT} --query="SELECT count() FROM test_empty_data" +(echo "INSERT INTO test_empty_data FORMAT ArrowStream" && ${CLICKHOUSE_CLIENT} --query="SELECT 1 AS x LIMIT 0 FORMAT ArrowStream") | ${CLICKHOUSE_CLIENT} +${CLICKHOUSE_CLIENT} --query="SELECT count() FROM test_empty_data" +(echo "INSERT INTO test_empty_data FORMAT Parquet" && ${CLICKHOUSE_CLIENT} --query="SELECT 1 AS x FORMAT Parquet") | ${CLICKHOUSE_CLIENT} +${CLICKHOUSE_CLIENT} --query="SELECT count() FROM test_empty_data" +(echo "INSERT INTO test_empty_data FORMAT Parquet" && ${CLICKHOUSE_CLIENT} --query="SELECT 1 AS x LIMIT 0 FORMAT Parquet") | ${CLICKHOUSE_CLIENT} +${CLICKHOUSE_CLIENT} --query="SELECT count() FROM test_empty_data"