mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-22 17:50:47 +00:00
sqxxl: Shards supports writing to one replica instead of all replicas. [#METR-10202]
This commit is contained in:
parent
50d37fc80e
commit
ac06ebccf6
@ -31,7 +31,7 @@ public:
|
||||
Connection::Packet packet = connection.receivePacket();
|
||||
|
||||
if (Protocol::Server::Data == packet.type)
|
||||
return packet.block;
|
||||
return sample_block = packet.block;
|
||||
else if (Protocol::Server::Exception == packet.type)
|
||||
{
|
||||
packet.exception->rethrow();
|
||||
@ -48,6 +48,15 @@ public:
|
||||
if (!sent_query)
|
||||
sendQueryAndGetSampleBlock();
|
||||
|
||||
if (!blocksHaveEqualStructure(block, sample_block))
|
||||
{
|
||||
std::stringstream message;
|
||||
message << "Block structure different from table structure.\n"
|
||||
<< "\nTable structure:\n(" << sample_block.dumpStructure() << ")\nBlock structure:\n(" << block.dumpStructure() << ")\n";
|
||||
|
||||
throw DB::Exception(message.str());
|
||||
}
|
||||
|
||||
connection.sendData(block);
|
||||
}
|
||||
|
||||
@ -74,6 +83,7 @@ public:
|
||||
private:
|
||||
Connection & connection;
|
||||
String query;
|
||||
Block sample_block;
|
||||
|
||||
bool sent_query;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user