mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
revert unneeded changes
This commit is contained in:
parent
c8f71cb539
commit
4e0d9aa8d4
@ -936,18 +936,16 @@ private:
|
||||
void sendDataFrom(ReadBuffer & buf, Block & sample, const TableMetadata & table_meta)
|
||||
{
|
||||
String current_format = insert_format;
|
||||
const ColumnDefaults & column_defaults = table_meta.column_defaults;
|
||||
|
||||
/// Data format can be specified in the INSERT query.
|
||||
if (ASTInsertQuery * insert = typeid_cast<ASTInsertQuery *>(&*parsed_query))
|
||||
{
|
||||
if (!insert->format.empty())
|
||||
current_format = insert->format;
|
||||
}
|
||||
|
||||
BlockInputStreamPtr block_input = context.getInputFormat(
|
||||
current_format, buf, sample, insert_format_max_block_size);
|
||||
|
||||
const ColumnDefaults & column_defaults = table_meta.column_defaults;
|
||||
if (!column_defaults.empty())
|
||||
block_input = std::make_shared<AddingDefaultsBlockInputStream>(block_input, column_defaults, context);
|
||||
BlockInputStreamPtr async_block_input = std::make_shared<AsynchronousBlockInputStream>(block_input);
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <Columns/ColumnArray.h>
|
||||
#include <Interpreters/evaluateMissingDefaults.h>
|
||||
#include <Core/Block.h>
|
||||
#include <Interpreters/evaluateMissingDefaults.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
|
@ -44,12 +44,11 @@ InputStreamFromASTInsertQuery::InputStreamFromASTInsertQuery(
|
||||
|
||||
input_buffer_contacenated = std::make_unique<ConcatReadBuffer>(buffers);
|
||||
|
||||
res_stream = context.getInputFormat(format, *input_buffer_contacenated, streams.out->getHeader(), context.getSettings().max_insert_block_size);
|
||||
|
||||
TableMetadata table_meta(ast_insert_query->database, ast_insert_query->table);
|
||||
table_meta.loadFromContext(context);
|
||||
|
||||
res_stream = context.getInputFormat(
|
||||
format, *input_buffer_contacenated, streams.out->getHeader(), context.getSettings().max_insert_block_size);
|
||||
|
||||
if (!table_meta.column_defaults.empty())
|
||||
res_stream = std::make_shared<AddingDefaultsBlockInputStream>(res_stream, table_meta.column_defaults, context);
|
||||
}
|
||||
|
@ -33,17 +33,13 @@ RemoteBlockOutputStream::RemoteBlockOutputStream(Connection & connection_, const
|
||||
if (!header)
|
||||
throw Exception("Logical error: empty block received as table structure", ErrorCodes::LOGICAL_ERROR);
|
||||
}
|
||||
else if (Protocol::Server::CapnProto == packet.type)
|
||||
{
|
||||
metadata = packet.block;
|
||||
}
|
||||
else if (Protocol::Server::Exception == packet.type)
|
||||
{
|
||||
packet.exception->rethrow();
|
||||
return;
|
||||
}
|
||||
else
|
||||
throw NetException("Unexpected packet from server (expected Data, CapnProto or Exception, got "
|
||||
throw NetException("Unexpected packet from server (expected Data or Exception, got "
|
||||
+ String(Protocol::Server::toString(packet.type)) + ")", ErrorCodes::UNEXPECTED_PACKET_FROM_SERVER);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,6 @@ private:
|
||||
String query;
|
||||
const Settings * settings;
|
||||
Block header;
|
||||
Block metadata;
|
||||
bool finished = false;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user