[fix](hive) Fix null timezone dereference in datetime cast with timezone info#60231
[fix](hive) Fix null timezone dereference in datetime cast with timezone info#60231suxiaogang223 wants to merge 2 commits intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
d439a83 to
0bc5924
Compare
|
run external |
d017160 to
e558531
Compare
|
run buildall |
TPC-H: Total hot run time: 30198 ms |
ClickBench: Total hot run time: 28.17 s |
|
run buildall |
TPC-H: Total hot run time: 30756 ms |
ClickBench: Total hot run time: 28.62 s |
|
PR approved by at least one committer and no changes requested. |
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: 30635 ms |
TPC-DS: Total hot run time: 189119 ms |
ClickBench: Total hot run time: 28.44 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
25be601 to
a3d8d1c
Compare
|
Verification update: I re-validated this with the dirty Hive text data. On current master, the behavior is:
So the rows are preserved and invalid datetime values are converted to NULL; no core dump is reproduced in this path. The null-timezone dereference risk is already guarded in PR #56646 (feature support timestamptz type), which added local_time_zone != nullptr checks in cast_to_datetimev2_impl.hpp. Given this validation, this PR is being closed as already fixed by #56646. |
|
Closing as already fixed by #56646 after re-validation on current master. |
What problem does this PR solve?
Summary
local_time_zonedereference when parsing timezone-suffixed datetime strings.datetimev2timezone parsing semantics (convert from parsed timezone to session local timezone), instead of rejecting timezone suffixes.Background / Root Cause
*local_time_zonewithout checking null.datetimev2, but that changed existing cast behavior.Changes
datetimev2parser behaviorbe/src/vec/functions/cast/cast_to_datetimev2_impl.hppDATE_TIME(datetimev2) with timezone suffix:TIMESTAMP_TZconversion behavior unchanged.datetimeparser null-guardbe/src/vec/functions/cast/cast_to_date_or_datetime_impl.hpplocal_time_zone != nullptrcheck before timezone conversion in both strict and non-strict parsing paths.regression-test/suites/external_table_p0/hive/ddl/test_hive_ddl_text_format.groovyCompatibility / Behavior
cast('...+08:00' as datetimev2)conversion behavior is preserved.Check List (For Author)
Test
Behavior changed:
datetimev2timezone conversion semantics are preserved.Does this need documentation?
Check List (For Reviewer who merge this PR)