[fix](point-query) Fix point query ignoring session timezone for functions like from_unixtime#60913
[fix](point-query) Fix point query ignoring session timezone for functions like from_unixtime#60913eldenmoon wants to merge 1 commit intoapache:masterfrom
Conversation
…tions like from_unixtime 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
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
run buildall |
There was a problem hiding this comment.
Pull request overview
Fixes point-query execution so timezone-sensitive functions (e.g., from_unixtime) respect the session timezone instead of the BE default timezone during short-circuit lookups on unique-key row-store tables.
Changes:
- Adds
time_zonetoPTabletKeyLookupRequestand sends it from FE point-query execution. - Applies the request timezone to the BE
RuntimeStateduring point-query initialization. - Adds a regression test verifying full-scan vs point-query timezone consistency.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| regression-test/suites/point_query_p0/test_point_query_timezone.groovy | New regression suite covering point-query timezone behavior. |
| regression-test/data/point_query_p0/test_point_query_timezone.out | Golden output for the new timezone regression test. |
| gensrc/proto/internal_service.proto | Extends point-query request proto with time_zone. |
| fe/fe-core/src/main/java/org/apache/doris/qe/PointQueryExecutor.java | Populates time_zone from session variables in point-query RPC. |
| be/src/service/point_query_executor.cpp | Applies request timezone to the cached/reused runtime state. |
| be/src/runtime/runtime_state.h | Adds RuntimeState::set_timezone() helper to update timezone state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
FE UT Coverage ReportIncrement line coverage |
1 similar comment
FE UT Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 29428 ms |
TPC-DS: Total hot run time: 185088 ms |
| // serilized from TQueryOptions | ||
| optional bytes query_options = 8; | ||
| // timezone string, e.g. "America/Mexico_City" | ||
| optional string time_zone = 9; |
There was a problem hiding this comment.
should we directly pass a whole TQueryGlobals?
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
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: