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


##########
be/src/exprs/function/cast/cast_to_datetimev2_impl.hpp:
##########
@@ -705,24 +706,47 @@ inline bool 
CastToDatetimeV2::from_string_strict_mode_internal(
                 SET_PARAMS_RET_FALSE_IFN((consume_digit<UInt32, 2>(ptr, end, 
part[0])),
                                          "invalid hour offset '{}'", 
std::string {ptr, end});
             }
-            SET_PARAMS_RET_FALSE_IFN(part[0] <= 14, "invalid hour offset 
'{}'", part[0]);
+            SET_PARAMS_RET_FALSE_IFN(
+                    part[0] < (type == DataTimeCastEnumType::TIMESTAMP_TZ ? 
24U : 15U),

Review Comment:
   [P1] Update the existing `+15:00` regression expectation. This widened range 
now accepts `+15:00` in both parsers (and the new unit test explicitly treats 
it as valid), but `test_cast_timestamptz.groovy` still includes `+15:00` in its 
non-strict invalid row with a checked-in NULL in `test_cast_timestamptz.out`. 
Because that suite disables constant folding, it reaches this BE branch and 
will return a value instead of NULL. Move `+15:00` to the valid cases (retain 
`+24:00` as the rejection boundary) and regenerate the golden output.



##########
be/src/core/value/timestamptz_value.cpp:
##########
@@ -65,6 +73,14 @@ std::string TimestampTzValue::to_string(const 
cctz::time_zone& tz, int scale) co
     buffer[len++] = ':';
     buffer[len++] = static_cast<char>('0' + offset_mins / 10);
     buffer[len++] = '0' + offset_mins % 10;
+    // Historical zones can have sub-minute offsets. Dropping their seconds 
changes the
+    // instant represented by the client-visible wall clock and offset when 
read back.
+    const int offset_seconds = abs_offset % 60;

Review Comment:
   [P2] Keep MySQL column metadata wide enough for the new format. With scale 
6, appending `:SS` produces a 35-byte value (`YYYY-MM-DD 
HH:MM:SS.ffffff+HH:MM:SS`), and both text and prepared-result paths send that 
full string. `MysqlSerializer.getMysqlTypeLength(TIMESTAMPTZ)`, however, still 
advertises 32 bytes based on `+HH:mm`, so clients see a display width smaller 
than rows this formatter now emits. Please raise the TIMESTAMPTZ metadata width 
to 35 and cover the serialized Column Definition value.



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