Merge pull request #70575 from ClickHouse/backport/24.8/70530

Backport #70530 to 24.8: Make async insert print nothing
This commit is contained in:
Konstantin Bogdanov 2024-10-10 19:31:47 +03:00 committed by GitHub
commit b26faaea99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#include <QueryPipeline/BlockIO.h>
#include <Processors/Transforms/CountingTransform.h>
#include <Processors/Transforms/getSourceFromASTInsertQuery.h>
#include <Processors/Formats/Impl/NullFormat.h>
#include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTInsertQuery.h>
@ -1080,6 +1081,7 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
auto timeout = settings.wait_for_async_insert_timeout.totalMilliseconds();
auto source = std::make_shared<WaitForAsyncInsertSource>(std::move(result.future), timeout);
res.pipeline = QueryPipeline(Pipe(std::move(source)));
res.pipeline.complete(std::make_shared<NullOutputFormat>(Block()));
}
const auto & table_id = insert_query->table_id;

View File

@ -10,3 +10,4 @@
10 j
11 k
12 l
13 m

View File

@ -32,6 +32,8 @@ ${CLICKHOUSE_CURL} -sS "$url" -d 'INSERT INTO async_inserts FORMAT CSVWithNames
12,"l"
' &
${CLICKHOUSE_CURL} -sS "$url" -H 'X-Clickhouse-Format: XML' -d 'INSERT INTO async_inserts FORMAT JSONEachRow {"id": 13, "s": "m"}' &
wait
${CLICKHOUSE_CLIENT} -q "SELECT * FROM async_inserts ORDER BY id"