[fix](function) fix str_to_date default return type scale for nereids (#24932)

fix str_to_date default return type scale for nereids
This commit is contained in:
zclllyybb
2023-10-20 12:55:49 +08:00
committed by GitHub
parent 0510d548c6
commit dc47087560
8 changed files with 40 additions and 11 deletions

View File

@ -72,6 +72,7 @@ struct StrToDate {
static DataTypes get_variadic_argument_types() { return {}; }
static DataTypePtr get_return_type_impl(const DataTypes& arguments) {
//TODO: it doesn't matter now. maybe sometime we should find the function signature with return_type together
return make_nullable(std::make_shared<DataTypeDateTime>());
}
@ -115,6 +116,8 @@ struct StrToDate {
auto& rdata = specific_char_column->get_chars();
auto& roffsets = specific_char_column->get_offsets();
// Because of we cant distinguish by return_type when we find function. so the return_type may NOT be same with real return type
// which decided by FE. that's found by which.
ColumnPtr res = nullptr;
WhichDataType which(remove_nullable(block.get_by_position(result).type));
if (which.is_date_time_v2()) {