From 72967dc9489492d9aa3faea3c8cc190ce86f5f21 Mon Sep 17 00:00:00 2001 From: zhaochangle Date: Fri, 8 May 2026 11:59:40 +0800 Subject: [PATCH] 1 --- .../exprs/function/function_date_or_datetime_to_something.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/be/src/exprs/function/function_date_or_datetime_to_something.h b/be/src/exprs/function/function_date_or_datetime_to_something.h index 7ea3c29c2a9acf..6f0ee6fca269d9 100644 --- a/be/src/exprs/function/function_date_or_datetime_to_something.h +++ b/be/src/exprs/function/function_date_or_datetime_to_something.h @@ -37,13 +37,17 @@ struct Transformer { vec_to.resize(size); for (size_t i = 0; i < size; ++i) { - //FIXME: seems external table still generates invalid date/datetime. but where? + // Only check in debug mode. for external table there's risk to write an invalid datetime. use this to find it. + // Not checked in RELEASE mode for performance considerations +#ifndef NDEBUG if (!vec_from[i].is_valid_date()) [[unlikely]] { char buf[64]; vec_from[i].to_string(buf); throw Exception(ErrorCode::INVALID_ARGUMENT, "Operation {} meets invalid data: {}", Transform::name, buf); } +#endif + auto res = Transform::execute(vec_from[i]); if constexpr (is_date_type(ToPType) || ToPType == TYPE_TIMESTAMPTZ) { vec_to[i] = res;