mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Allow to insert from any format
This commit is contained in:
parent
48bd750856
commit
b0a77ff3f7
@ -146,7 +146,11 @@ BlockIO InterpreterInsertQuery::execute()
|
||||
else if (query.data)
|
||||
{
|
||||
auto data_in = std::make_unique<ReadBufferFromMemory>(query.data, query.end - query.data);
|
||||
res.in = context.getInputFormat("Values", *data_in, table->getSampleBlock(), context.getSettingsRef().max_insert_block_size);
|
||||
std::string format = "Values";
|
||||
if (!query.format.empty())
|
||||
format = query.format;
|
||||
|
||||
res.in = context.getInputFormat(format, *data_in, table->getSampleBlock(), context.getSettingsRef().max_insert_block_size);
|
||||
res.in = std::make_shared<OwningBlockInputStream<ReadBufferFromMemory>>(res.in, std::move(data_in));
|
||||
res.in = std::make_shared<NullAndDoCopyBlockInputStream>(res.in, res.out);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user