fix SimpleSquashingChunksTransform

This commit is contained in:
vdimir 2024-07-06 16:02:01 +00:00
parent 9dc52217f4
commit f1f5dfc83a
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
2 changed files with 4 additions and 6 deletions

View File

@ -58,14 +58,13 @@ void SquashingTransform::work()
SimpleSquashingChunksTransform::SimpleSquashingChunksTransform(
const Block & header, size_t min_block_size_rows, size_t min_block_size_bytes)
: IInflatingTransform(header, header), squashing(min_block_size_rows, min_block_size_bytes)
: IInflatingTransform(header, header), squashing(header, min_block_size_rows, min_block_size_bytes)
{
}
void SimpleSquashingChunksTransform::consume(Chunk chunk)
{
Block current_block = squashing.add(getInputPort().getHeader().cloneWithColumns(chunk.detachColumns()));
squashed_chunk.setColumns(current_block.getColumns(), current_block.rows());
squashed_chunk = squashing.add(std::move(chunk));
}
Chunk SimpleSquashingChunksTransform::generate()
@ -83,8 +82,7 @@ bool SimpleSquashingChunksTransform::canGenerate()
Chunk SimpleSquashingChunksTransform::getRemaining()
{
Block current_block = squashing.add({});
squashed_chunk.setColumns(current_block.getColumns(), current_block.rows());
squashed_chunk = squashing.flush();
return std::move(squashed_chunk);
}

View File

@ -44,7 +44,7 @@ protected:
Chunk getRemaining() override;
private:
SquashingTransform squashing;
Squashing squashing;
Chunk squashed_chunk;
};