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