-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Fix](timezone) Fix incorrect DST handling #51454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
run buildall |
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run performance |
|
run buildall |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
TPC-H: Total hot run time: 33743 ms |
TPC-H: Total hot run time: 34422 ms |
TPC-DS: Total hot run time: 186236 ms |
ClickBench: Total hot run time: 29.98 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
1 similar comment
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the incorrect handling of daylight saving time in datetime conversions by updating conversion logic, expected outputs, and regression tests. Key changes include adding new test cases for DST and non-DST scenarios, updating expected outputs in several test files, and refactoring the datetime conversion implementation for more reliable DST handling.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| regression-test/suites/datatype_p0/datetimev2/test_timezone.groovy | Added regression tests for DST and non-DST timezone conversions. |
| regression-test/data/datatype_p0/datetimev2/test_tz_streamload.out | Updated expected output timestamp for streamload tests. |
| regression-test/data/datatype_p0/datetimev2/test_timezone.out | Modified expected output for timezone tests to reflect DST adjustments. |
| regression-test/data/cast_p0/cast_to_datetime.out | Adjusted expected output timestamps in datetime cast tests. |
| be/test/vec/function/function_test_util.h | Enhanced error output for function result mismatches. |
| be/test/vec/function/cast/cast_to_datetime_test.cpp | Updated test expectations to match new timezone handling. |
| be/test/vec/function/cast/cast_to_date_test.cpp | Revised expected outputs in date cast tests to align with new timezone logic. |
| be/src/vec/runtime/vdatetime_value.h | Fixed uninitialized variable issues in datetime comparison operators. |
| be/src/vec/runtime/vdatetime_value.cpp | Refactored DST conversion logic and updated type handling for timezone offsets. |
| be/src/olap/rowset/segment_v2/inverted_index/util/priority_queue.h | Cleaned up redundant max_size validation for the priority queue. |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
Problem Summary:
before:
```sql
mysql> select/*+SET_VAR(debug_skip_fold_constant=true)*/ cast('2010-01-05 08:15:30Europe/London' as datetime);
+------------------------------------------------------+
| cast('2010-01-05 08:15:30Europe/London' as datetime) |
+------------------------------------------------------+
| 2010-01-05 15:15:30 |
+------------------------------------------------------+
1 row in set (0.19 sec)
```
now:
```sql
mysql> select/*+SET_VAR(debug_skip_fold_constant=true)*/ cast('2010-01-05 08:15:30Europe/London' as datetime);
+------------------------------------------------------+
| cast('2010-01-05 08:15:30Europe/London' as datetime) |
+------------------------------------------------------+
| 2010-01-05 16:15:30 |
+------------------------------------------------------+
1 row in set (0.12 sec)
```
Problem Summary:
before:
```sql
mysql> select/*+SET_VAR(debug_skip_fold_constant=true)*/ cast('2010-01-05 08:15:30Europe/London' as datetime);
+------------------------------------------------------+
| cast('2010-01-05 08:15:30Europe/London' as datetime) |
+------------------------------------------------------+
| 2010-01-05 15:15:30 |
+------------------------------------------------------+
1 row in set (0.19 sec)
```
now:
```sql
mysql> select/*+SET_VAR(debug_skip_fold_constant=true)*/ cast('2010-01-05 08:15:30Europe/London' as datetime);
+------------------------------------------------------+
| cast('2010-01-05 08:15:30Europe/London' as datetime) |
+------------------------------------------------------+
| 2010-01-05 16:15:30 |
+------------------------------------------------------+
1 row in set (0.12 sec)
```
Problem Summary:
before:
```sql
mysql> select/*+SET_VAR(debug_skip_fold_constant=true)*/ cast('2010-01-05 08:15:30Europe/London' as datetime);
+------------------------------------------------------+
| cast('2010-01-05 08:15:30Europe/London' as datetime) |
+------------------------------------------------------+
| 2010-01-05 15:15:30 |
+------------------------------------------------------+
1 row in set (0.19 sec)
```
now:
```sql
mysql> select/*+SET_VAR(debug_skip_fold_constant=true)*/ cast('2010-01-05 08:15:30Europe/London' as datetime);
+------------------------------------------------------+
| cast('2010-01-05 08:15:30Europe/London' as datetime) |
+------------------------------------------------------+
| 2010-01-05 16:15:30 |
+------------------------------------------------------+
1 row in set (0.12 sec)
```
Problem Summary:
before:
```sql
mysql> select/*+SET_VAR(debug_skip_fold_constant=true)*/ cast('2010-01-05 08:15:30Europe/London' as datetime);
+------------------------------------------------------+
| cast('2010-01-05 08:15:30Europe/London' as datetime) |
+------------------------------------------------------+
| 2010-01-05 15:15:30 |
+------------------------------------------------------+
1 row in set (0.19 sec)
```
now:
```sql
mysql> select/*+SET_VAR(debug_skip_fold_constant=true)*/ cast('2010-01-05 08:15:30Europe/London' as datetime);
+------------------------------------------------------+
| cast('2010-01-05 08:15:30Europe/London' as datetime) |
+------------------------------------------------------+
| 2010-01-05 16:15:30 |
+------------------------------------------------------+
1 row in set (0.12 sec)
```
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
before:
now:
Release note
Fix incorrect daylight saving time handling
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)