Set return type to Date32 for toLastDayOfMonth function

This commit is contained in:
Roman Vasin 2022-08-17 08:51:14 +00:00
parent 47bdd8a3e2
commit be3151937c
2 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ struct ToLastDayOfMonthImpl
{
static constexpr auto name = "toLastDayOfMonth";
static inline UInt16 execute(Int64 t, const DateLUTImpl & time_zone)
static inline Int64 execute(Int64 t, const DateLUTImpl & time_zone)
{
return time_zone.toLastDayNumOfMonth(time_zone.toDayNum(t));
}
@ -191,7 +191,7 @@ struct ToLastDayOfMonthImpl
{
return time_zone.toLastDayNumOfMonth(time_zone.toDayNum(t));
}
static inline UInt16 execute(Int32 d, const DateLUTImpl & time_zone)
static inline Int32 execute(Int32 d, const DateLUTImpl & time_zone)
{
return time_zone.toLastDayNumOfMonth(ExtendedDayNum(d));
}

View File

@ -6,7 +6,7 @@
namespace DB
{
using FunctionToLastDayOfMonth = FunctionDateOrDateTimeToSomething<DataTypeDate, ToLastDayOfMonthImpl>;
using FunctionToLastDayOfMonth = FunctionDateOrDateTimeToSomething<DataTypeDate32, ToLastDayOfMonthImpl>;
REGISTER_FUNCTION(ToLastDayOfMonth)
{