cast IPv4 after Nullable is removed

This commit is contained in:
Yakov Olkhovskiy 2023-06-30 00:54:47 +00:00
parent fb6243ec9d
commit bd29c0d6a2

View File

@ -1919,25 +1919,6 @@ ColumnPtr executeStringInteger(const ColumnsWithTypeAndName & arguments, const A
return executeAggregateAddition(arguments, result_type, input_rows_count); return executeAggregateAddition(arguments, result_type, input_rows_count);
} }
/// Special case - one or both arguments are IPv4
if (isIPv4(arguments[0].type) || isIPv4(arguments[1].type))
{
ColumnsWithTypeAndName new_arguments {
{
isIPv4(arguments[0].type) ? castColumn(arguments[0], std::make_shared<DataTypeUInt32>()) : arguments[0].column,
isIPv4(arguments[0].type) ? std::make_shared<DataTypeUInt32>() : arguments[0].type,
arguments[0].name,
},
{
isIPv4(arguments[1].type) ? castColumn(arguments[1], std::make_shared<DataTypeUInt32>()) : arguments[1].column,
isIPv4(arguments[1].type) ? std::make_shared<DataTypeUInt32>() : arguments[1].type,
arguments[1].name
}
};
return executeImpl(new_arguments, result_type, input_rows_count);
}
/// Special case when the function is plus or minus, one of arguments is Date/DateTime and another is Interval. /// Special case when the function is plus or minus, one of arguments is Date/DateTime and another is Interval.
if (auto function_builder = getFunctionForIntervalArithmetic(arguments[0].type, arguments[1].type, context)) if (auto function_builder = getFunctionForIntervalArithmetic(arguments[0].type, arguments[1].type, context))
{ {
@ -1991,6 +1972,25 @@ ColumnPtr executeStringInteger(const ColumnsWithTypeAndName & arguments, const A
return wrapInNullable(res, arguments, result_type, input_rows_count); return wrapInNullable(res, arguments, result_type, input_rows_count);
} }
/// Special case - one or both arguments are IPv4
if (isIPv4(arguments[0].type) || isIPv4(arguments[1].type))
{
ColumnsWithTypeAndName new_arguments {
{
isIPv4(arguments[0].type) ? castColumn(arguments[0], std::make_shared<DataTypeUInt32>()) : arguments[0].column,
isIPv4(arguments[0].type) ? std::make_shared<DataTypeUInt32>() : arguments[0].type,
arguments[0].name,
},
{
isIPv4(arguments[1].type) ? castColumn(arguments[1], std::make_shared<DataTypeUInt32>()) : arguments[1].column,
isIPv4(arguments[1].type) ? std::make_shared<DataTypeUInt32>() : arguments[1].type,
arguments[1].name
}
};
return executeImpl2(new_arguments, result_type, input_rows_count, right_nullmap);
}
const auto * const left_generic = left_argument.type.get(); const auto * const left_generic = left_argument.type.get();
const auto * const right_generic = right_argument.type.get(); const auto * const right_generic = right_argument.type.get();
ColumnPtr res; ColumnPtr res;