Copilot commented on code in PR #63077:
URL: https://github.com/apache/doris/pull/63077#discussion_r3207556162


##########
be/test/olap/olap_type_test.cpp:
##########
@@ -39,6 +43,16 @@ class OlapTypeTest : public testing::Test {
     }
 };
 
+static void expect_from_olap_string_default(const vectorized::DataTypePtr& 
data_type,
+                                            const std::string& input,
+                                            const vectorized::Field& 
expected_field) {
+    vectorized::Field field;
+    vectorized::DataTypeSerDe::FormatOptions options;

Review Comment:
   `DataTypeSerDe::FormatOptions options;` default-initializes the struct, but 
some members (e.g. `nested_string_wrapper`) have no in-class initializer and 
will be left indeterminate. Prefer `auto options = 
vectorized::DataTypeSerDe::get_default_format_options();` or value-initialize 
(`FormatOptions options{};`) to avoid propagating uninitialized state into 
`from_olap_string()`.
   



##########
be/src/vec/data_types/serde/data_type_date_or_datetime_serde.cpp:
##########
@@ -408,7 +408,15 @@ Status DataTypeDateSerDe<T>::from_olap_string(const 
std::string& str, Field& fie
     // Exception!
     if (!CastToDateOrDatetime::from_string_non_strict_mode<IsDatetime>(

Review Comment:
   The comment block above this parse attempt still says the return value 
represents OK/InvalidArgument and that other errors "MUST throw Exception!", 
but this code path now intentionally swallows parse failure and falls back to 
`FIRST_DAY`. Please update/remove the outdated "Exception!"/return-value 
comment here so it matches the new behavior of `from_olap_string()`.



-- 
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]

Reply via email to