提交 54ea7b0b 编写于 作者: A Alexey Milovidov

Fixed error [#CLICKHOUSE-2]

上级 163f9432
......@@ -37,7 +37,6 @@
#include <Interpreters/Context.h>
#include <Interpreters/Cluster.h>
#include <Interpreters/InterpreterFactory.h>
#include <Interpreters/InterpreterInsertQuery.h>
#include <Interpreters/InterpreterExistsQuery.h>
#include <Interpreters/InterpreterShowCreateQuery.h>
#include <Interpreters/InterpreterDropQuery.h>
......
......@@ -101,7 +101,7 @@ BlockIO InterpreterInsertQuery::execute()
/// Do not squash blocks if it is a sync INSERT into Distributed, since it lead to double bufferization on client and server side.
/// Client-side bufferization might cause excessive timeouts (especially in case of big blocks).
if (!(context.getSettingsRef().insert_distributed_sync && table->getName() == "Distributed"))
if (!(context.getSettingsRef().insert_distributed_sync && table->isRemote()))
{
out = std::make_shared<SquashingBlockOutputStream>(
out, context.getSettingsRef().min_insert_block_size_rows, context.getSettingsRef().min_insert_block_size_bytes);
......
......@@ -601,9 +601,13 @@ void StorageBuffer::writeBlockToDestination(const Block & block, StoragePtr tabl
InterpreterInsertQuery interpreter{insert, context, allow_materialized};
Block block_to_write;
for (const auto & name : columns_intersection)
block_to_write.insert(block.getByName(name));
auto block_io = interpreter.execute();
block_io.out->writePrefix();
block_io.out->write(block);
block_io.out->write(block_to_write);
block_io.out->writeSuffix();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册