[vectorized](function) suppoort date_trunc function truncate week mode (#18334)

support date_trunc could truncate week eg:
select date_trunc('2023-4-3 19:28:30', 'week');
This commit is contained in:
zhangstar333
2023-04-04 10:24:26 +08:00
committed by GitHub
parent a724443eb9
commit 50e6c4216a
4 changed files with 33 additions and 7 deletions

View File

@ -290,6 +290,8 @@ struct DateTrunc {
null_map[i] = !dt.template datetime_trunc<MINUTE>();
} else if (std::strncmp("second", str_data, 6) == 0) {
null_map[i] = !dt.template datetime_trunc<SECOND>();
} else if (std::strncmp("week", str_data, 4) == 0) {
null_map[i] = !dt.template datetime_trunc<WEEK>();
} else {
null_map[i] = 1;
}