Skip to content

Commit 8b9ecf8

Browse files
authored
Update lowcardinality.cpp
1 parent b7f654c commit 8b9ecf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clickhouse/columns/lowcardinality.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void ColumnLowCardinality::Reserve(size_t new_cap) {
179179
// Assumption is that dictionary must be smaller than index.
180180
// NOTE(vnemkov): Formula below (`ceil(sqrt(x))`) is a gut-feeling-good-enough estimation,
181181
// feel free to replace/adjust if you have better one suported by actual data.
182-
dictionary_column_->Reserve(static_cast<size_t>(ceil(sqrt(new_cap))));
182+
dictionary_column_->Reserve(static_cast<size_t>(ceil(sqrt(static_cast<double>(new_cap)))));
183183
index_column_->Reserve(new_cap + 2); // + 1 for null item (at pos 0), + 1 for default item (at pos 1)
184184
}
185185

0 commit comments

Comments
 (0)