Skip to content

branch-4.0: [fix](point-query) Fix point query ignoring session timezone for functions like from_unixtime #60913#60991

Merged
yiguolei merged 1 commit intobranch-4.0from
auto-pick-60913-branch-4.0
Mar 3, 2026
Merged

branch-4.0: [fix](point-query) Fix point query ignoring session timezone for functions like from_unixtime #60913#60991
yiguolei merged 1 commit intobranch-4.0from
auto-pick-60913-branch-4.0

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 3, 2026

Cherry-picked from #60913

…tions like from_unixtime (#60913)

Point queries on unique key tables with row store incorrectly used the
default timezone (Asia/Shanghai) instead of the session timezone when
evaluating timezone-sensitive functions like from_unixtime(). This was
because PTabletKeyLookupRequest did not carry timezone information, and
the RuntimeState created in Reusable::init() always used the default
timezone.

The fix adds a time_zone field to PTabletKeyLookupRequest, sets it from
the session variable in FE PointQueryExecutor, and applies it to the
RuntimeState in BE PointQueryExecutor::init().

Changes:
- gensrc/proto: Add time_zone field to PTabletKeyLookupRequest
- FE: Send session timezone in PointQueryExecutor.getNextInternal()
- BE: Add RuntimeState::set_timezone() and use it in
PointQueryExecutor::init()
- Add regression test for point query timezone handling
@github-actions github-actions bot requested a review from yiguolei as a code owner March 3, 2026 10:14
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring closed this Mar 3, 2026
@dataroaring dataroaring reopened this Mar 3, 2026
@hello-stephen
Copy link
Contributor

run buildall

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.14% (1787/2258)
Line Coverage 64.70% (31743/49065)
Region Coverage 65.35% (15843/24245)
Branch Coverage 55.87% (8411/15054)

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/7) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.99% (19138/36119)
Line Coverage 36.18% (178233/492563)
Region Coverage 32.78% (138145/421413)
Branch Coverage 33.76% (59988/177708)

@yiguolei yiguolei merged commit acc85ec into branch-4.0 Mar 3, 2026
25 of 29 checks passed
@github-actions github-actions bot deleted the auto-pick-60913-branch-4.0 branch March 3, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants