Merge pull request #3955 from yandex/low-cardinality-fix-clone-empty

Do not copy dictionary in ColumnLowCardinality::cloneEmpty
This commit is contained in:
alexey-milovidov 2018-12-29 01:23:07 +03:00 committed by GitHub
commit b8e847edfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,6 +236,9 @@ void ColumnLowCardinality::gather(ColumnGathererStream & gatherer)
MutableColumnPtr ColumnLowCardinality::cloneResized(size_t size) const
{
auto unique_ptr = dictionary.getColumnUniquePtr();
if (size == 0)
unique_ptr = unique_ptr->cloneEmpty();
return ColumnLowCardinality::create((*std::move(unique_ptr)).mutate(), getIndexes().cloneResized(size));
}