mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Fix insert for native format
This commit is contained in:
parent
dfa3e7e1cd
commit
0f12e028a5
@ -81,16 +81,14 @@ Block IProfilingBlockInputStream::read()
|
||||
|
||||
progress(Progress(res.rows(), res.bytes()));
|
||||
|
||||
/// This code commented, because some streams (for example Native) break this
|
||||
/// protocol. This must be fixed.
|
||||
//#ifndef NDEBUG
|
||||
// if (res)
|
||||
// {
|
||||
// Block header = getHeader();
|
||||
// if (header)
|
||||
// assertBlocksHaveEqualStructure(res, header, getName());
|
||||
// }
|
||||
//#endif
|
||||
#ifndef NDEBUG
|
||||
if (res)
|
||||
{
|
||||
Block header = getHeader();
|
||||
if (header)
|
||||
assertBlocksHaveEqualStructure(res, header, getName());
|
||||
}
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -54,13 +54,20 @@ StoragePtr InterpreterInsertQuery::getTable(const ASTInsertQuery & query)
|
||||
|
||||
Block InterpreterInsertQuery::getSampleBlock(const ASTInsertQuery & query, const StoragePtr & table)
|
||||
{
|
||||
Block table_sample = table->getSampleBlock();
|
||||
|
||||
/// If the query does not include information about columns
|
||||
if (!query.columns)
|
||||
return table_sample;
|
||||
|
||||
Block table_sample_non_materialized = table->getSampleBlockNonMaterialized();
|
||||
/// If the query does not include information about columns
|
||||
if (!query.columns)
|
||||
{
|
||||
/// Fromat Native ignores header and write blocks as is.
|
||||
if (query.format == "Native")
|
||||
return {};
|
||||
else
|
||||
return table_sample_non_materialized;
|
||||
}
|
||||
|
||||
Block table_sample = table->getSampleBlock();
|
||||
/// Form the block based on the column names from the query
|
||||
Block res;
|
||||
for (const auto & identifier : query.columns->children)
|
||||
|
Loading…
Reference in New Issue
Block a user