Fix tests.

This commit is contained in:
Nikolai Kochetov 2021-02-26 13:17:00 +03:00
parent ce365e2c19
commit 545528917f
3 changed files with 32 additions and 14 deletions

View File

@ -508,7 +508,15 @@ struct HashMethodKeysFixed
}
if constexpr (!has_low_cardinality && !has_nullable_keys && sizeof(Key) <= 16)
packFixedBatch(keys_size, Base::getActualColumns(), key_sizes, prepared_keys);
{
bool has_unsupported_sizes = false;
for (auto size : key_sizes)
if (size != 1 && size != 2 && size != 4 && size != 8 && size != 16)
has_unsupported_sizes = true;
if (!has_unsupported_sizes)
packFixedBatch(keys_size, Base::getActualColumns(), key_sizes, prepared_keys);
}
#if defined(__SSSE3__) && !defined(MEMORY_SANITIZER)
if constexpr (!has_low_cardinality && !has_nullable_keys && sizeof(Key) <= 16)

View File

@ -104,6 +104,7 @@ template <typename T>
void packFixedBatch(size_t keys_size, const ColumnRawPtrs & key_columns, const Sizes & key_sizes, PaddedPODArray<T> & out)
{
size_t offset = 0;
fillFixedBatch<UInt128>(keys_size, key_columns, key_sizes, out, offset);
fillFixedBatch<UInt64>(keys_size, key_columns, key_sizes, out, offset);
fillFixedBatch<UInt32>(keys_size, key_columns, key_sizes, out, offset);
fillFixedBatch<UInt16>(keys_size, key_columns, key_sizes, out, offset);

View File

@ -389,25 +389,34 @@ struct AggregationMethodKeysFixed
if constexpr (!has_low_cardinality && !has_nullable_keys && sizeof(Key) <= 16)
{
Sizes new_sizes;
auto fill_size = [&](size_t size)
bool has_unsupported_sizes = false;
for (auto size : key_sizes)
if (size != 1 && size != 2 && size != 4 && size != 8 && size != 16)
has_unsupported_sizes = true;
if (!has_unsupported_sizes)
{
for (size_t i = 0; i < key_sizes.size(); ++i)
Sizes new_sizes;
auto fill_size = [&](size_t size)
{
if (key_sizes[i] == size)
for (size_t i = 0; i < key_sizes.size(); ++i)
{
new_columns.push_back(key_columns[i].get());
new_sizes.push_back(size);
if (key_sizes[i] == size)
{
new_columns.push_back(key_columns[i].get());
new_sizes.push_back(size);
}
}
}
};
};
fill_size(8);
fill_size(4);
fill_size(2);
fill_size(1);
fill_size(16);
fill_size(8);
fill_size(4);
fill_size(2);
fill_size(1);
return {new_columns, new_sizes};
return {new_columns, new_sizes};
}
}
for (auto & column : key_columns)