mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Make the fix more minimal
This commit is contained in:
parent
a1c131c0da
commit
a9f1393862
@ -233,6 +233,7 @@ void QueryCache::Writer::buffer(Chunk && chunk, ChunkType chunk_type)
|
||||
auto & buffered_chunk = (chunk_type == ChunkType::Totals) ? query_result->totals : query_result->extremes;
|
||||
|
||||
convertToFullIfSparse(chunk);
|
||||
convertToFullIfConst(chunk);
|
||||
|
||||
if (!buffered_chunk.has_value())
|
||||
buffered_chunk = std::move(chunk);
|
||||
@ -279,7 +280,8 @@ void QueryCache::Writer::finalizeWrite()
|
||||
|
||||
for (auto & chunk : query_result->chunks)
|
||||
{
|
||||
convertToFullIfNeeded(chunk);
|
||||
convertToFullIfSparse(chunk);
|
||||
convertToFullIfConst(chunk);
|
||||
|
||||
const size_t rows_chunk = chunk.getNumRows();
|
||||
if (rows_chunk == 0)
|
||||
|
@ -212,30 +212,13 @@ void convertToFullIfConst(Chunk & chunk)
|
||||
chunk.setColumns(std::move(columns), num_rows);
|
||||
}
|
||||
|
||||
void convertToFullIfLowCardinality(Chunk & chunk)
|
||||
{
|
||||
size_t num_rows = chunk.getNumRows();
|
||||
auto columns = chunk.detachColumns();
|
||||
for (auto & column : columns)
|
||||
column = recursiveRemoveLowCardinality(column);
|
||||
chunk.setColumns(std::move(columns), num_rows);
|
||||
}
|
||||
|
||||
void convertToFullIfSparse(Chunk & chunk)
|
||||
{
|
||||
size_t num_rows = chunk.getNumRows();
|
||||
auto columns = chunk.detachColumns();
|
||||
for (auto & column : columns)
|
||||
column = recursiveRemoveSparse(column);
|
||||
|
||||
chunk.setColumns(std::move(columns), num_rows);
|
||||
}
|
||||
|
||||
void convertToFullIfNeeded(Chunk & chunk)
|
||||
{
|
||||
convertToFullIfSparse(chunk);
|
||||
convertToFullIfConst(chunk);
|
||||
convertToFullIfLowCardinality(chunk);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -150,8 +150,6 @@ private:
|
||||
/// or when you need to perform operation with two columns
|
||||
/// and their structure must be equal (e.g. compareAt).
|
||||
void convertToFullIfConst(Chunk & chunk);
|
||||
void convertToFullIfLowCardinality(Chunk & chunk);
|
||||
void convertToFullIfSparse(Chunk & chunk);
|
||||
void convertToFullIfNeeded(Chunk & chunk);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user