mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
allow empty header in RemoteBlockOutputStream #3411
The bug with inserts to Distributed tables was introduced in https://github.com/yandex/ClickHouse/pull/3171 It added a workaround specifically for inserting in the Native format without specifying the list of columns. Native (as opposed to other formats) historically supports this. To signal that the input block structure shouldn't conform to any fixed header in this case, the remote server started sending empty header block. This commit adds support for empty headers to RemoteBlockOutputStream.
This commit is contained in:
parent
a54dff25aa
commit
e4e38f71e1
@ -33,9 +33,6 @@ RemoteBlockOutputStream::RemoteBlockOutputStream(Connection & connection_, const
|
||||
if (Protocol::Server::Data == packet.type)
|
||||
{
|
||||
header = packet.block;
|
||||
|
||||
if (!header)
|
||||
throw Exception("Logical error: empty block received as table structure", ErrorCodes::LOGICAL_ERROR);
|
||||
break;
|
||||
}
|
||||
else if (Protocol::Server::Exception == packet.type)
|
||||
@ -58,7 +55,8 @@ RemoteBlockOutputStream::RemoteBlockOutputStream(Connection & connection_, const
|
||||
|
||||
void RemoteBlockOutputStream::write(const Block & block)
|
||||
{
|
||||
assertBlocksHaveEqualStructure(block, header, "RemoteBlockOutputStream");
|
||||
if (header)
|
||||
assertBlocksHaveEqualStructure(block, header, "RemoteBlockOutputStream");
|
||||
|
||||
try
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user