gavinchou commented on code in PR #53524:
URL: https://github.com/apache/doris/pull/53524#discussion_r2215367981
##########
be/src/vec/common/schema_util.cpp:
##########
@@ -224,7 +224,8 @@ void get_column_by_type(const vectorized::DataTypePtr&
data_type, const std::str
if (is_int_or_bool(data_type->get_primitive_type()) ||
is_string_type(data_type->get_primitive_type()) ||
is_float_or_double(data_type->get_primitive_type())) {
- column.set_length(data_type->get_size_of_value_in_memory());
+ DCHECK(data_type->get_size_of_value_in_memory() <=
std::numeric_limits<int32_t>::max());
+
column.set_length(static_cast<int32_t>(data_type->get_size_of_value_in_memory()));
Review Comment:
cast_set<>() 可以自动做边界检测
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]