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

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: None
   
   A constant TIMESTAMPTZ SELECT can silently return UTC text when conversion 
to the session time zone overflows the supported local year, while reading the 
same value through BE fails. The FE formatter also falls back to UTC for 
historical second-resolution offsets. A shared literal range check misses 
negative years after time zone conversion, allowing invalid column defaults.
   
   Convert the stored UTC instant directly to the session time zone, validate 
both local year bounds before formatting, and preserve historical offset 
seconds. Keep stream-load values in canonical UTC so valid boundary instants 
remain writable. Reject negative years in the shared parser validation.
   
   ### Release note
   
   Make TIMESTAMPTZ constant-query output reject local years outside 0–9999 
consistently with BE output, preserve historical time zone offset seconds, and 
reject date defaults whose time zone conversion produces a negative year.
   
   ### Testing
   
   - Focused baseline checks reproduced the output-boundary, historical-offset 
and parser-underflow defects. The new regression also failed before the fix.
   - Repository FE UT entry point: 121 tests executed successfully, zero 
failures/errors; two existing disabled tests remain disabled.
   - Five local FE/BE regression suites passed in comparison mode: the new FE 
output suite and the existing output-boundary, historical-offset, complex-type 
and cast suites. The new expected output was generated by the regression runner.
   - Coverage includes precision 0/3/6, both year boundaries, positive/negative 
session offsets, both BE constant-fold settings and cast modes, nested 
ARRAY/MAP/STRUCT values, NULL masking, invalid default DDL, and valid 
CTAS/INSERT with UTC readback.
   - `build.sh --fe` passed with optional UI and BE Java-extension builds 
disabled. FE core and catalog Checkstyle both passed with zero violations.
   
   ### Check List (For Author)
   
   - Test
     - [x] Regression test
     - [x] Unit Test
     - [x] Manual test: isolated local FE/BE validation described above.
   - Behavior changed:
     - [x] Yes. Constant-query timestamp output now follows the existing 
local-range contract; invalid negative-year defaults are rejected.
   - Does this need documentation?
     - [x] No. This fixes implementation differences from the documented 
timestamp behavior.
   
   ### 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