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


##########
be/src/exprs/function/cast/cast_to_date_or_datetime_impl.hpp:
##########
@@ -701,7 +701,6 @@ inline bool 
CastToDateOrDatetime::from_string_strict_mode(const StringRef& str,
             res.template 
unchecked_set_time_unit<TimeUnit::SECOND>((uint32_t)local.second());
         }
 
-        static_cast<void>(skip_any_whitespace(ptr, end));

Review Comment:
   [P1] Preserve the non-strict parser's permissive forms
   
   This body is also the first branch of `from_string_non_strict_mode()` via 
`DatelikeParseMode::NON_STRICT`. With this unconditional deletion, 
`20230716192030+08:00 ` parses the zone here, fails on the trailing space, and 
then the fallback cannot pass its mandatory date-separator check, so a formerly 
valid non-strict cast becomes NULL. Worse, `2023-07-16T19+08:00 ` falls back 
and consumes `+`/`:` as generic time separators, yielding local `19:08:00` 
without the prior timezone conversion. The new positive control only covers the 
full `HH:MM:SS` form that the fallback happens to support. Please retain the 
post-zone whitespace skip when `!IsStrict` in all three mirrored parsers and 
add compact/partial non-strict controls.



##########
be/src/exprs/function/cast/cast_to_datetimev2_impl.hpp:
##########
@@ -710,7 +710,6 @@ inline bool 
CastToDatetimeV2::from_string_strict_mode_internal(
         }
         SET_PARAMS_RET_FALSE_IFN(res.year() <= 9999, "datetime year {} out of 
range [0, 9999]",
                                  res.year());
-        static_cast<void>(skip_any_whitespace(ptr, end));

Review Comment:
   [P1] Keep strict TIMESTAMP_TZ folding aligned with runtime
   
   This internal parser is also instantiated for 
`DataTimeCastEnumType::TIMESTAMP_TZ`, so BE runtime now rejects a zone followed 
by whitespace. FE folding still accepts the identical strict cast: 
`StringLikeLiteral` sends explicit-zone TIMESTAMP_TZ values directly to 
`TimestampTzLiteral` without consulting `strictCast`, while both 
`DateTimeChecker.hasTimeZone()` and `DateLiteral.parseDateTime()` trim the 
input. Consequently `CAST('2023-07-16T19:20:30.123+08:00 ' AS TIMESTAMPTZ)` 
succeeds or fails depending on `debug_skip_fold_constant` or whether the value 
is a column. Please enforce the same strict boundary in the FE TIMESTAMP_TZ 
path while preserving non-strict behavior, and add paired folded/runtime 
coverage.



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