github-actions[bot] commented on code in PR #64575:
URL: https://github.com/apache/doris/pull/64575#discussion_r3422396157


##########
be/test/exprs/function/cast/cast_to_date_test.cpp:
##########
@@ -85,6 +85,17 @@ TEST_F(FunctionCastTest, 
string_to_date_valid_case_strict_mode) {
     check_function_for_cast_strict_mode<DataTypeDateV2>(input_types, data_set);
 }
 
+TEST_F(FunctionCastTest, string_to_datev1_valid_case_strict_mode) {
+    InputTypeSet input_types = {PrimitiveType::TYPE_VARCHAR};
+    DataSet data_set = {
+            // Compact formats
+            {{std::string("20240501 01")}, std::string("2024-05-01")},
+            {{std::string("20230716 1920Z")}, std::string("2023-07-16")},
+            {{std::string("20240501T0000")}, std::string("2024-05-01")},

Review Comment:
   One of the two implementation changes is still untested. The new 
`cast_to_type` at `cast_to_date_or_datetime_impl.hpp:437` only runs for an 
exact 14-digit `YYYYMMDDHHMMSS` string where `ptr == end`; these three v1 DATE 
cases cover the hour-only return and suffix/final paths, but none enters that 
exact 14-digit early return. Please add a v1 DATE case such as `20120102030405 
-> 2012-01-02` so this branch cannot regress while the test still passes.
   
   ```suggestion
               {{std::string("20240501T0000")}, std::string("2024-05-01")},
               {{std::string("20120102030405")}, std::string("2012-01-02")},
   ```



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