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

   ### What problem does this PR solve?
   
   Issue Number: #69041 (closed by the master test PR #70749)
   
   Related PR: #69668, #70749
   
   Problem Summary:
   
   Stream Load with `format=arrow` ignored the load's `timezone` / `time_zone`
   header when it turned time-zone-aware Arrow timestamps into DATETIME.
   `ArrowStreamReader` resolved its cctz zone once, in its constructor, from
   `TimezoneUtils::default_time_zone` (`+08:00`) and passed it to every column's
   `read_column_from_arrow`. A `timestamp[us, tz=UTC]` value of
   2026-10-13 16:37:00 loaded with `timezone: UTC` was stored as
   2026-10-14 00:37:00, whatever the header or the session time zone said. The
   Parquet reader already uses `RuntimeState::timezone_obj()`, which carries the
   load's time zone.
   
   The reader now takes its zone from `RuntimeState::timezone_obj()`. Its only
   constructor caller, `FileScanner`, always passes its runtime state, so the
   constructor asserts it instead of falling back to the default zone.
   
   Naive Arrow timestamps are unaffected: the DATETIMEV2 SerDe already decodes a
   timestamp without an Arrow time zone in UTC, so its wall-clock fields are 
kept
   under any load time zone.
   
   master and branch-4.2 already behave correctly: #69668 moved Arrow loads to
   FileScannerV2, whose Arrow reader passes `_state->timezone_obj()`. This fix 
is
   for branch-4.1, which still uses the legacy reader.
   
   ### Release note
   
   Stream Load with `format=arrow` now converts time-zone-aware Arrow timestamps
   into DATETIME in the load's time zone (the `timezone` header, else the 
session
   time zone) instead of always in UTC+8. Loads that relied on the old +8h shift
   must now send `timezone: Asia/Shanghai`. Data loaded before the fix is not
   changed.
   
   ### Check List (For Author)
   
   - Test: Unit Test (`ArrowStreamReaderTest`, run on an ASAN UT build: passes 
with the fix; with only the reader change reverted, 
`ZonedTimestampUsesLoadTimezone` fails with `2026-10-14 00:37:00` under UTC. 
Cases: zoned timestamps under UTC,
     Asia/Shanghai and America/Los_Angeles load zones; naive timestamps keep 
their
     wall clock)
   - Behavior changed: Yes. Time-zone-aware Arrow timestamps are stored in the
     load's time zone instead of UTC+8.
   - Does this need documentation: No
   
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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