Style fix

This commit is contained in:
Dmitry Kardymon 2023-06-27 06:06:56 +00:00
parent 5521bf3f35
commit 5a4a774db7

View File

@ -60,13 +60,8 @@ private:
getName(), arguments.size()); getName(), arguments.size());
} }
for (size_t i = 0, size = arguments.size(); i < size; ++i) if (std::find_if (arguments.cbegin(), arguments.cend(), [](const auto & arg) { return arg->onlyNull(); }) != arguments.cend())
{
if (arguments[i]->onlyNull())
{
return makeNullable(std::make_shared<DataTypeNothing>()); return makeNullable(std::make_shared<DataTypeNothing>());
}
}
DataTypes arg_types; DataTypes arg_types;
for (size_t i = 0, size = arguments.size(); i < size; ++i) for (size_t i = 0, size = arguments.size(); i < size; ++i)
@ -393,9 +388,7 @@ private:
{ {
NullPresence null_presence = getNullPresense(arguments); NullPresence null_presence = getNullPresense(arguments);
if (null_presence.has_null_constant) if (null_presence.has_null_constant)
{
return result_type->createColumnConstWithDefaultValue(input_rows_count); return result_type->createColumnConstWithDefaultValue(input_rows_count);
}
DataTypePtr elem_type = checkAndGetDataType<DataTypeArray>(result_type.get())->getNestedType(); DataTypePtr elem_type = checkAndGetDataType<DataTypeArray>(result_type.get())->getNestedType();
WhichDataType which(elem_type); WhichDataType which(elem_type);
@ -410,15 +403,11 @@ private:
auto throwIfNullValue = [&](const ColumnWithTypeAndName & col) auto throwIfNullValue = [&](const ColumnWithTypeAndName & col)
{ {
if (!col.type->isNullable()) if (!col.type->isNullable())
{
return; return;
}
const auto & nullable_col = assert_cast<const ColumnNullable &>(*col.column); const auto & nullable_col = assert_cast<const ColumnNullable &>(*col.column);
const auto & null_map = nullable_col.getNullMapData(); const auto & null_map = nullable_col.getNullMapData();
if (!memoryIsZero(null_map.data(), 0, null_map.size())) if (!memoryIsZero(null_map.data(), 0, null_map.size()))
{
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Illegal (null) value column {} of argument of function {}", col.column->getName(), getName()); throw Exception(ErrorCodes::BAD_ARGUMENTS, "Illegal (null) value column {} of argument of function {}", col.column->getName(), getName());
}
}; };
ColumnPtr res; ColumnPtr res;