Fix tests

This commit is contained in:
Pavel Kruglov 2021-06-08 16:55:07 +03:00
parent 76b3ae4301
commit e701903ba6
3 changed files with 15 additions and 11 deletions

View File

@ -33,6 +33,8 @@ void expandDataByMask(PaddedPODArray<T> & data, const PaddedPODArray<UInt8> & ma
data[index] = data[from];
--from;
}
else
data[index] = T();
--index;
}

View File

@ -9,7 +9,7 @@ namespace DB
{
/// Expand data by mask. After expanding data will satisfy the following: if we filter data
/// by given mask, we get initial data. In places where mask[i] = 0 we insert given default_value.
/// by given mask, we get initial data. In places where mask[i] = 0 we insert default value.
/// If inverted is true, we will work with inverted mask. This function is used in implementations of
/// expand() method in IColumn interface.
template <typename T>

View File

@ -909,16 +909,6 @@ private:
{
if (cond_col)
{
size_t size = input_rows_count;
const auto & null_map_data = cond_col->getData();
auto negated_null_map = ColumnUInt8::create();
auto & negated_null_map_data = negated_null_map->getData();
negated_null_map_data.resize(size);
for (size_t i = 0; i < size; ++i)
negated_null_map_data[i] = !null_map_data[i];
auto arg_then_column = arg_then.column;
auto result_column = IColumn::mutate(std::move(arg_then_column));
if (then_is_short)
@ -930,7 +920,19 @@ private:
return result_column;
}
else
{
size_t size = input_rows_count;
const auto & null_map_data = cond_col->getData();
auto negated_null_map = ColumnUInt8::create();
auto & negated_null_map_data = negated_null_map->getData();
negated_null_map_data.resize(size);
for (size_t i = 0; i < size; ++i)
negated_null_map_data[i] = !null_map_data[i];
return ColumnNullable::create(materializeColumnIfConst(result_column), std::move(negated_null_map));
}
}
else if (cond_const_col)
{