Mryange opened a new pull request, #68979:
URL: https://github.com/apache/doris/pull/68979

   ### What problem does this PR solve?
   
   Issue Number: N/A
   
   Related PR: #68865
   
   Problem Summary:
   
   Timezone offsets can be accepted or rejected differently by FE constant 
folding and BE runtime CAST. For example, a DATETIME suffix of `-14:00` is 
valid under the literal policy but is rejected by the BE session-zone resolver. 
Session offsets such as `+14:30` and `-12:30` can bypass validation through the 
preloaded BE cache, while FE CONVERT_TZ applies different minute restrictions 
to bare and UTC/GMT-prefixed offsets.
   
   Root cause: these entry points duplicate offset validation and mix session 
and literal policies. Introduce a shared FE parser using the existing timezone 
aliases and upstream canonicalization helper, retain separate 
session/DATETIME/TIMESTAMPTZ policies, validate BE cache endpoints, and 
construct parsed literal offsets through TimezoneUtils. Strict and non-strict 
BE CAST use the same checks. Numeric TIMESTAMPTZ offsets are limited to Java's 
`[-18:00, +18:00]`, retaining historical minute and second offsets within that 
range. Explicit named and compact suffix recognition is also corrected.
   
   This does not add a BE Java alias table. Session alias dispatch is already 
fixed by #68865. System timezone database differences, ignored external lookup 
return values and DST rounding order are outside this change.
   
   ### Release note
   
   Fix inconsistent timezone offset validation in CAST and CONVERT_TZ, reject 
out-of-range cached session offsets, and correctly recognize explicit timezone 
suffixes. Numeric TIMESTAMPTZ offsets beyond +/-18:00 are now rejected.
   
   ### Check List (For Author)
   
   - Test
       - [x] Regression test
           - `test_timezone_parser_contract`: generated output through the 
runner and replayed successfully (1 suite, 0 failures). Compared 55 inputs 
across DATETIME/TIMESTAMPTZ and five execution paths: 550 results without 
semantic differences, allowing UTC display-format differences.
           - Upstream `test_session_time_zone_short_ids`: passed after rebase, 
covering scans, point queries and stream load.
       - [x] Unit Test
           - Earlier focused FE tests: 76 tests, 0 failures/errors, 4 existing 
skips; BE TimezoneUtilsTest: 5/5 passed.
           - After rebase: TimeUtilsTest, CoordinatorContextTest and 
TimeZoneParserTest: 18 tests passed.
       - [x] Manual test
           - Rebuilt BE and FE after rebase to master `2d053c83252`; both 
services report the matching version and Alive=true. ACT session FROM_UNIXTIME 
on a stored column matches Australia/Darwin without a BE alias table.
           - Validation limit: the final FE cleanup removing redundant 
normalization/default arguments and reusing getCanonicalTimeZone has not been 
rebuilt. The latest regression ran on the preceding build; CI must validate the 
final source.
           - clang-format, git diff --check and BE build hygiene passed. The 
earlier clang-tidy run reported pre-existing modernization diagnostics; it was 
not a clean clang-tidy pass.
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. Offset boundaries and explicit suffix parsing are consistent 
across the scoped FE/BE paths; invalid endpoints are rejected.
   
   - Does this need documentation?
       - [x] No. This aligns existing offset policies and documents the 
TIMESTAMPTZ boundary change in the release note.
       - [ ] Yes.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label
   


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