Fix deserialization indexes for additional keys in DataTypeWithDictionary.

This commit is contained in:
Nikolai Kochetov 2018-06-22 16:37:35 +03:00
parent f56d16769b
commit 9e9b33ebe5

View File

@ -354,12 +354,11 @@ namespace
MutableColumnPtr mapIndexWithOverflow(PaddedPODArray<T> & index, size_t max_val)
{
HashMap<T, T> hash_map;
HashMap<T, T> hash_map_with_overflow;
for (auto val : index)
{
auto & map = val < max_val ? hash_map : hash_map_with_overflow;
map.insert({val, map.size()});
if (val < max_val)
hash_map.insert({val, hash_map.size()});
}
auto index_map_col = ColumnVector<T>::create();
@ -371,7 +370,7 @@ namespace
for (auto & val : index)
val = val < max_val ? hash_map[val]
: hash_map_with_overflow[val] + hash_map.size();
: val - max_val + hash_map.size();
return index_map_col;
}