From d33c22b3e37f9e7afded3add4577b27d0e069541 Mon Sep 17 00:00:00 2001 From: Sema Checherinda Date: Wed, 4 Dec 2024 18:11:54 +0100 Subject: [PATCH] fix test --- .../0_stateless/03277_async_insert.reference | 2 ++ .../queries/0_stateless/03277_async_insert.sh | 19 +++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/queries/0_stateless/03277_async_insert.reference b/tests/queries/0_stateless/03277_async_insert.reference index e69de29bb2d..6ed281c757a 100644 --- a/tests/queries/0_stateless/03277_async_insert.reference +++ b/tests/queries/0_stateless/03277_async_insert.reference @@ -0,0 +1,2 @@ +1 +1 diff --git a/tests/queries/0_stateless/03277_async_insert.sh b/tests/queries/0_stateless/03277_async_insert.sh index 46cfcc38e6a..4b059643a4e 100755 --- a/tests/queries/0_stateless/03277_async_insert.sh +++ b/tests/queries/0_stateless/03277_async_insert.sh @@ -7,18 +7,21 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) set -e +FILE_PREFIX="${CLICKHOUSE_USER_FILES_UNIQUE:?}_test_03277" -mkdir -p "${CLICKHOUSE_USER_FILES_UNIQUE:?}" -rm -rf "${CLICKHOUSE_USER_FILES_UNIQUE:?}"/* +function cleanup() +{ + rm "${FILE_PREFIX}"* +} +trap cleanup EXIT -FILE_CSV="${CLICKHOUSE_USER_FILES_UNIQUE:?}/03277.csv" -FILE_ARROW="${CLICKHOUSE_USER_FILES_UNIQUE:?}/03277.arrow" +FILE_CSV="${FILE_PREFIX}.csv" +FILE_ARROW="${FILE_PREFIX}.arrow" $CLICKHOUSE_CLIENT -q " SET async_insert = 1; - SELECT '${FILE_CSV}'; CREATE TABLE t0 (c0 Int) ENGINE = File(CSV); INSERT INTO TABLE t0 (c0) VALUES (1); INSERT INTO TABLE FUNCTION file('$FILE_CSV', 'CSV', 'c0 Int') SELECT c0 FROM t0; @@ -30,13 +33,9 @@ $CLICKHOUSE_CLIENT -q "DROP TABLE t0" $CLICKHOUSE_CLIENT -q " SET async_insert = 1; - SELECT '${FILE_ARROW}'; CREATE TABLE t0 (c0 Int) ENGINE = Join(ANY, INNER, c0); INSERT INTO TABLE FUNCTION file('$FILE_ARROW', 'Arrow', 'c0 Int') SELECT c0 FROM t0; INSERT INTO TABLE t0 (c0) FROM INFILE '$FILE_ARROW' FORMAT Arrow; " $CLICKHOUSE_CLIENT -q "SELECT * from t0" -$CLICKHOUSE_CLIENT -q "DROP TABLE t0" - - -rm -rf "${CLICKHOUSE_USER_FILES_UNIQUE:?}"/* \ No newline at end of file +$CLICKHOUSE_CLIENT -q "DROP TABLE t0" \ No newline at end of file