mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 02:30:51 +00:00
Remove extra columns from sample in StorageBuffer.
This commit is contained in:
parent
a93ae46ac1
commit
ed0826efa7
@ -229,6 +229,17 @@ Pipes StorageBuffer::read(
|
|||||||
for (auto & buf : buffers)
|
for (auto & buf : buffers)
|
||||||
pipes_from_buffers.emplace_back(std::make_shared<BufferSource>(column_names, buf, *this));
|
pipes_from_buffers.emplace_back(std::make_shared<BufferSource>(column_names, buf, *this));
|
||||||
|
|
||||||
|
/// Convert pipes from table to structure from buffer.
|
||||||
|
if (!pipes_from_buffers.empty() && !pipes_from_dst.empty()
|
||||||
|
&& !blocksHaveEqualStructure(pipes_from_buffers.front().getHeader(), pipes_from_dst.front().getHeader()))
|
||||||
|
{
|
||||||
|
for (auto & pipe : pipes_from_dst)
|
||||||
|
pipe.addSimpleTransform(std::make_shared<ConvertingTransform>(
|
||||||
|
pipe.getHeader(),
|
||||||
|
pipes_from_buffers.front().getHeader(),
|
||||||
|
ConvertingTransform::MatchColumnsMode::Name));
|
||||||
|
}
|
||||||
|
|
||||||
/** If the sources from the table were processed before some non-initial stage of query execution,
|
/** If the sources from the table were processed before some non-initial stage of query execution,
|
||||||
* then sources from the buffers must also be wrapped in the processing pipeline before the same stage.
|
* then sources from the buffers must also be wrapped in the processing pipeline before the same stage.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user