This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new f5c993f2c94 [fix](be) Check timezone resolver results (#69985)
f5c993f2c94 is described below
commit f5c993f2c94acc5937a8e67c9659151251bdc941
Author: Mryange <[email protected]>
AuthorDate: Fri Nov 6 15:24:45 2026 +0800
[fix](be) Check timezone resolver results (#69985)
### What problem does this PR solve?
Related PR: #67174
Some BE callers ignore `TimezoneUtils::find_cctz_time_zone()` failures
and continue with an unresolved timezone. Mark the resolver
`[[nodiscard]]`, reject invalid external timezone values, and check
internal timezone invariants.
### Release note
Invalid timezone values in affected BE conversion paths now return an
error.
### Check List (For Author)
- Test: clang-format 16, `git diff --check`, and `bash
build-support/check-build-hygiene.sh` passed. Build, unit tests, and
regression tests have not been run.
- Behavior changed: Yes. Previously ignored timezone resolution failures
now return errors or fail invariant checks.
- Does this need documentation: No.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
---
be/src/exec/common/arrow_column_to_doris_column.cpp | 4 +++-
.../exprs/aggregate/aggregate_function_python_udaf.cpp | 6 +++---
be/src/exprs/table_function/python_udtf_function.cpp | 4 +++-
be/src/format/table/es/es_scroll_parser.cpp | 9 +++------
be/src/format_v2/orc/orc_reader.cpp | 2 +-
be/src/format_v2/table/adbc_reader.cpp | 3 ++-
be/src/format_v2/table/remote_doris_reader.cpp | 3 ++-
be/src/runtime/runtime_state.cpp | 18 ++++++++++--------
be/src/runtime/runtime_state.h | 3 ++-
.../service/arrow_flight/arrow_flight_batch_reader.cpp | 7 ++++++-
.../service/arrow_flight/arrow_flight_batch_reader.h | 1 +
be/src/util/timezone_utils.h | 3 ++-
be/test/core/data_type/data_type_struct_test.cpp | 2 +-
.../data_type_serde/data_type_jsonb_serde_test.cpp | 2 +-
.../data_type_serde/data_type_serde_arrow_test.cpp | 3 ++-
.../data_type_serde_timestamptz_test.cpp | 4 ++--
.../data_type_serde/data_type_serde_varbinary_test.cpp | 4 ++--
be/test/exprs/vexpr_test.cpp | 2 +-
be/test/testutil/run_all_tests.cpp | 2 ++
19 files changed, 49 insertions(+), 33 deletions(-)
diff --git a/be/src/exec/common/arrow_column_to_doris_column.cpp
b/be/src/exec/common/arrow_column_to_doris_column.cpp
index 645376ee12d..5a3bf140e22 100644
--- a/be/src/exec/common/arrow_column_to_doris_column.cpp
+++ b/be/src/exec/common/arrow_column_to_doris_column.cpp
@@ -92,7 +92,9 @@ Status arrow_column_to_doris_column(const arrow::Array*
arrow_column, size_t arr
ColumnPtr& doris_column, const
DataTypePtr& type,
size_t num_elements, const std::string&
timezone) {
cctz::time_zone ctz;
- TimezoneUtils::find_cctz_time_zone(timezone, ctz);
+ if (!TimezoneUtils::find_cctz_time_zone(timezone, ctz)) {
+ return Status::InvalidArgument("Invalid timezone: {}", timezone);
+ }
return arrow_column_to_doris_column(arrow_column, arrow_batch_cur_idx,
doris_column, type,
num_elements, ctz);
}
diff --git a/be/src/exprs/aggregate/aggregate_function_python_udaf.cpp
b/be/src/exprs/aggregate/aggregate_function_python_udaf.cpp
index ab6000783ad..256b6c97e91 100644
--- a/be/src/exprs/aggregate/aggregate_function_python_udaf.cpp
+++ b/be/src/exprs/aggregate/aggregate_function_python_udaf.cpp
@@ -60,7 +60,7 @@ Status AggregatePythonUDAFData::add(int64_t place_id, const
IColumn** columns,
}
cctz::time_zone timezone_obj;
- TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone,
timezone_obj);
+
DORIS_CHECK(TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone,
timezone_obj));
PythonArrowBlockConvertor converter(input_block,
TimezoneUtils::default_time_zone,
timezone_obj);
@@ -105,7 +105,7 @@ Status AggregatePythonUDAFData::add_batch(AggregateDataPtr*
places, size_t place
input_block.insert(ColumnWithTypeAndName(std::move(places_col),
places_type, "places"));
cctz::time_zone timezone_obj;
- TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone,
timezone_obj);
+
DORIS_CHECK(TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone,
timezone_obj));
PythonArrowBlockConvertor converter(input_block,
TimezoneUtils::default_time_zone,
timezone_obj);
@@ -174,7 +174,7 @@ Status AggregatePythonUDAFData::get(IColumn& to, const
DataTypePtr& result_type,
Block result_block;
DataTypes types = {result_type};
cctz::time_zone timezone_obj;
- TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone,
timezone_obj);
+
DORIS_CHECK(TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone,
timezone_obj));
RETURN_IF_ERROR(PythonArrowBlockConvertor(result->schema(), timezone_obj)
.convert_from_arrow(result, types, &result_block));
diff --git a/be/src/exprs/table_function/python_udtf_function.cpp
b/be/src/exprs/table_function/python_udtf_function.cpp
index a45a0f95f15..42fc4131c96 100644
--- a/be/src/exprs/table_function/python_udtf_function.cpp
+++ b/be/src/exprs/table_function/python_udtf_function.cpp
@@ -23,6 +23,7 @@
#include <arrow/type_fwd.h>
#include <glog/logging.h>
+#include "common/logging.h"
#include "core/assert_cast.h"
#include "core/block/block.h"
#include "core/block/column_numbers.h"
@@ -50,7 +51,8 @@ namespace doris {
PythonUDTFFunction::PythonUDTFFunction(const TFunction& t_fn) :
TableFunction(), _t_fn(t_fn) {
_fn_name = _t_fn.name.function_name;
- TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone,
_timezone_obj);
+ DORIS_CHECK(
+
TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone,
_timezone_obj));
// Like Java UDTF, FE passes the element type T, and we wrap it into
array<T> here
// This makes the behavior consistent with Java UDTF
diff --git a/be/src/format/table/es/es_scroll_parser.cpp
b/be/src/format/table/es/es_scroll_parser.cpp
index 82d84eb6c96..a4475b09783 100644
--- a/be/src/format/table/es/es_scroll_parser.cpp
+++ b/be/src/format/table/es/es_scroll_parser.cpp
@@ -454,16 +454,13 @@ Status get_date_value_int(const rapidjson::Value& col,
PrimitiveType type, bool
RE2 time_zone_pattern(R"([+-]\d{2}:?\d{2}|Z)");
bool ok = false;
std::string fmt;
- re2::StringPiece value;
- if (time_zone_pattern.Match(str_date, 0, str_date.size(),
RE2::UNANCHORED, &value, 1)) {
+ if (time_zone_pattern.Match(str_date, 0, str_date.size(),
RE2::UNANCHORED, nullptr,
+ 0)) {
// with time_zone info
// YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS+08:00
// or 2022-08-08T12:10:10.000Z or YYYY-MM-DDTHH:MM:SS-08:00
fmt = "%Y-%m-%dT%H:%M:%E*S%Ez";
- cctz::time_zone ctz;
- // find time_zone by time_zone suffix string
- TimezoneUtils::find_cctz_time_zone(value.as_string(), ctz);
- ok = cctz::parse(fmt, str_date, ctz, &tp);
+ ok = cctz::parse(fmt, str_date, cctz::utc_time_zone(), &tp);
} else {
// without time_zone info
// 2022-08-08T12:10:10.000
diff --git a/be/src/format_v2/orc/orc_reader.cpp
b/be/src/format_v2/orc/orc_reader.cpp
index 2a1720a97c8..5534d415068 100644
--- a/be/src/format_v2/orc/orc_reader.cpp
+++ b/be/src/format_v2/orc/orc_reader.cpp
@@ -1287,7 +1287,7 @@ Status OrcReader::init(RuntimeState* state) {
_batch_size = std::max(1, state->batch_size());
}
_state = std::make_unique<OrcReaderScanState>();
- TimezoneUtils::find_cctz_time_zone(_state->timezone, _state->timezone_obj);
+ DORIS_CHECK(TimezoneUtils::find_cctz_time_zone(_state->timezone,
_state->timezone_obj));
if (state != nullptr) {
_state->enable_lazy_materialization =
state->query_options().enable_orc_lazy_mat;
_state->enable_filter_by_min_max =
state->query_options().enable_orc_filter_by_min_max;
diff --git a/be/src/format_v2/table/adbc_reader.cpp
b/be/src/format_v2/table/adbc_reader.cpp
index 9d518081898..14dea9bbb0f 100644
--- a/be/src/format_v2/table/adbc_reader.cpp
+++ b/be/src/format_v2/table/adbc_reader.cpp
@@ -33,6 +33,7 @@
#include "common/cast_set.h"
#include "common/check.h"
+#include "common/logging.h"
#include "core/assert_cast.h"
#include "core/block/block.h"
#include "core/data_type/data_type.h"
@@ -586,7 +587,7 @@
AdbcFileReader::AdbcFileReader(std::shared_ptr<io::FileSystemProperties>& system
_range(range),
_file_slot_descs(file_slot_descs),
_stream_factory(std::move(stream_factory)) {
- TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone, _ctz);
+
DORIS_CHECK(TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone,
_ctz));
}
AdbcFileReader::~AdbcFileReader() {
diff --git a/be/src/format_v2/table/remote_doris_reader.cpp
b/be/src/format_v2/table/remote_doris_reader.cpp
index 1803f9cfe01..6a35a22f9a5 100644
--- a/be/src/format_v2/table/remote_doris_reader.cpp
+++ b/be/src/format_v2/table/remote_doris_reader.cpp
@@ -31,6 +31,7 @@
#include <vector>
#include "common/cast_set.h"
+#include "common/logging.h"
#include "core/assert_cast.h"
#include "core/block/block.h"
#include "core/data_type/data_type.h"
@@ -303,7 +304,7 @@ RemoteDorisFileReader::RemoteDorisFileReader(
_range(range),
_file_slot_descs(file_slot_descs),
_stream_factory(std::move(stream_factory)) {
- TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone, _ctz);
+
DORIS_CHECK(TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone,
_ctz));
}
RemoteDorisFileReader::~RemoteDorisFileReader() {
diff --git a/be/src/runtime/runtime_state.cpp b/be/src/runtime/runtime_state.cpp
index 1822fd836ca..027039016cc 100644
--- a/be/src/runtime/runtime_state.cpp
+++ b/be/src/runtime/runtime_state.cpp
@@ -239,7 +239,7 @@ RuntimeState::RuntimeState(const TPlanFragmentExecParams&
fragment_exec_params,
_query_ctx(ctx) {
Status status =
init(fragment_exec_params.fragment_instance_id, query_options,
query_globals, exec_env);
- DCHECK(status.ok());
+ DORIS_CHECK(status.ok()) << status;
_query_mem_tracker = query_mem_tracker;
DCHECK(_query_mem_tracker != nullptr);
}
@@ -262,8 +262,8 @@ RuntimeState::RuntimeState(const TUniqueId& instance_id,
const TUniqueId& query_
_num_bytes_load_total(0),
_num_finished_scan_range(0),
_query_ctx(ctx) {
- [[maybe_unused]] auto status = init(instance_id, query_options,
query_globals, exec_env);
- DCHECK(status.ok());
+ Status status = init(instance_id, query_options, query_globals, exec_env);
+ DORIS_CHECK(status.ok()) << status;
_query_mem_tracker = ctx->query_mem_tracker();
}
@@ -287,7 +287,7 @@ RuntimeState::RuntimeState(const TUniqueId& query_id,
int32_t fragment_id,
_query_ctx(ctx) {
// TODO: do we really need instance id?
Status status = init(TUniqueId(), query_options, query_globals, exec_env);
- DCHECK(status.ok());
+ DORIS_CHECK(status.ok()) << status;
_query_mem_tracker = ctx->query_mem_tracker();
}
@@ -310,7 +310,7 @@ RuntimeState::RuntimeState(const TUniqueId& query_id,
int32_t fragment_id,
_num_bytes_load_total(0),
_num_finished_scan_range(0) {
Status status = init(TUniqueId(), query_options, query_globals, exec_env);
- DCHECK(status.ok());
+ DORIS_CHECK(status.ok()) << status;
_query_mem_tracker = query_mem_tracker;
DCHECK(_query_mem_tracker != nullptr);
}
@@ -324,7 +324,7 @@ RuntimeState::RuntimeState(const TQueryOptions&
query_options, const TQueryGloba
Status status = init(TUniqueId(), query_options, query_globals, nullptr);
_exec_env = ExecEnv::GetInstance();
init_mem_trackers("<unnamed>");
- DCHECK(status.ok());
+ DORIS_CHECK(status.ok()) << status;
}
RuntimeState::RuntimeState()
@@ -338,7 +338,7 @@ RuntimeState::RuntimeState()
_timezone = TimezoneUtils::default_time_zone;
_timestamp_ms = 0;
_nano_seconds = 0;
- TimezoneUtils::find_cctz_time_zone(_timezone, _timezone_obj);
+ DORIS_CHECK(TimezoneUtils::find_cctz_time_zone(_timezone, _timezone_obj));
_exec_env = ExecEnv::GetInstance();
init_mem_trackers("<unnamed>");
}
@@ -396,7 +396,9 @@ Status RuntimeState::init(const TUniqueId&
fragment_instance_id, const TQueryOpt
_timestamp_ms = 0;
_nano_seconds = 0;
}
- TimezoneUtils::find_cctz_time_zone(_timezone, _timezone_obj);
+ if (!TimezoneUtils::find_cctz_time_zone(_timezone, _timezone_obj)) {
+ return Status::InvalidArgument("Invalid timezone: {}", _timezone);
+ }
if (query_globals.__isset.load_zero_tolerance) {
_load_zero_tolerance = query_globals.load_zero_tolerance;
diff --git a/be/src/runtime/runtime_state.h b/be/src/runtime/runtime_state.h
index 02c47c235ed..3beb678d55b 100644
--- a/be/src/runtime/runtime_state.h
+++ b/be/src/runtime/runtime_state.h
@@ -37,6 +37,7 @@
#include "agent/be_exec_version_manager.h"
#include "cctz/time_zone.h"
#include "common/be_mock_util.h"
+#include "common/check.h"
#include "common/compiler_util.h" // IWYU pragma: keep
#include "common/config.h"
#include "common/factory_creator.h"
@@ -247,7 +248,7 @@ public:
const cctz::time_zone& timezone_obj() const { return _timezone_obj; }
void set_timezone(const std::string& timezone) {
_timezone = timezone;
- TimezoneUtils::find_cctz_time_zone(_timezone, _timezone_obj);
+ DORIS_CHECK(TimezoneUtils::find_cctz_time_zone(_timezone,
_timezone_obj));
}
const std::string& lc_time_names() const { return _lc_time_names; }
const TUniqueId& query_id() const { return _query_id; }
diff --git a/be/src/service/arrow_flight/arrow_flight_batch_reader.cpp
b/be/src/service/arrow_flight/arrow_flight_batch_reader.cpp
index 6fba86b7366..fee9b80ce3f 100644
--- a/be/src/service/arrow_flight/arrow_flight_batch_reader.cpp
+++ b/be/src/service/arrow_flight/arrow_flight_batch_reader.cpp
@@ -347,8 +347,13 @@ arrow::Status ArrowFlightBatchRemoteReader::_fetch_data() {
std::call_once(_timezone_once_flag, [this, callback] {
DCHECK(callback->response_->has_timezone());
-
TimezoneUtils::find_cctz_time_zone(callback->response_->timezone(),
_timezone_obj);
+ _timezone_valid =
TimezoneUtils::find_cctz_time_zone(callback->response_->timezone(),
+
_timezone_obj);
});
+ if (!_timezone_valid) {
+ return _return_invalid_status(
+ fmt::format("Invalid timezone: {}",
callback->response_->timezone()));
+ }
{
SCOPED_ATOMIC_TIMER(&_deserialize_block_timer);
diff --git a/be/src/service/arrow_flight/arrow_flight_batch_reader.h
b/be/src/service/arrow_flight/arrow_flight_batch_reader.h
index d8dc6618ebe..c63e83cf036 100644
--- a/be/src/service/arrow_flight/arrow_flight_batch_reader.h
+++ b/be/src/service/arrow_flight/arrow_flight_batch_reader.h
@@ -109,6 +109,7 @@ private:
std::shared_ptr<PBackendService_Stub> _brpc_stub = nullptr;
std::once_flag _timezone_once_flag;
+ bool _timezone_valid = false;
std::shared_ptr<Block> _block;
};
diff --git a/be/src/util/timezone_utils.h b/be/src/util/timezone_utils.h
index 99fcf9b2afa..11341a2e33a 100644
--- a/be/src/util/timezone_utils.h
+++ b/be/src/util/timezone_utils.h
@@ -35,7 +35,8 @@ class TimezoneUtils {
public:
static void load_timezones_to_cache();
- static bool find_cctz_time_zone(const std::string& timezone,
cctz::time_zone& ctz);
+ [[nodiscard]] static bool find_cctz_time_zone(const std::string& timezone,
+ cctz::time_zone& ctz);
// The caller validates the offset according to its parsing policy.
static cctz::time_zone create_fixed_offset_time_zone(int32_t
offset_seconds);
diff --git a/be/test/core/data_type/data_type_struct_test.cpp
b/be/test/core/data_type/data_type_struct_test.cpp
index 29006c7134e..1f29bae5dfe 100644
--- a/be/test/core/data_type/data_type_struct_test.cpp
+++ b/be/test/core/data_type/data_type_struct_test.cpp
@@ -452,7 +452,7 @@ TEST_F(DataTypeStructTest, writeColumnToOrc) {
TimezoneUtils::load_timezones_to_cache();
DataTypeSerDe::FormatOptions format_options;
cctz::time_zone tz;
- TimezoneUtils::find_cctz_time_zone("UTC", tz);
+ ASSERT_TRUE(TimezoneUtils::find_cctz_time_zone("UTC", tz));
format_options.timezone = &tz;
Status status = serde->write_column_to_orc("UTC", *struct_column, nullptr,
&structBatch, 0, 1,
diff --git a/be/test/core/data_type_serde/data_type_jsonb_serde_test.cpp
b/be/test/core/data_type_serde/data_type_jsonb_serde_test.cpp
index 2bacf10d233..b7c8df94a33 100644
--- a/be/test/core/data_type_serde/data_type_jsonb_serde_test.cpp
+++ b/be/test/core/data_type_serde/data_type_jsonb_serde_test.cpp
@@ -222,7 +222,7 @@ TEST_F(DataTypeJsonbSerDeTest, serdes) {
TimezoneUtils::load_timezones_to_cache();
DataTypeSerDe::FormatOptions format_options;
cctz::time_zone tz;
- TimezoneUtils::find_cctz_time_zone("UTC", tz);
+ ASSERT_TRUE(TimezoneUtils::find_cctz_time_zone("UTC", tz));
format_options.timezone = &tz;
auto orc_batch =
std::make_unique<orc::StringVectorBatch>(row_count,
*orc::getDefaultPool());
diff --git a/be/test/core/data_type_serde/data_type_serde_arrow_test.cpp
b/be/test/core/data_type_serde/data_type_serde_arrow_test.cpp
index 902a55bf185..76c78c057a2 100644
--- a/be/test/core/data_type_serde/data_type_serde_arrow_test.cpp
+++ b/be/test/core/data_type_serde/data_type_serde_arrow_test.cpp
@@ -54,6 +54,7 @@
#include <utility>
#include <vector>
+#include "common/check.h"
#include "core/block/block.h"
#include "core/column/column.h"
#include "core/column/column_complex.h"
@@ -390,7 +391,7 @@ std::shared_ptr<Block>
create_test_block(std::vector<PrimitiveType> cols, int ro
DateV2Value<DateTimeV2ValueType> value;
std::string date_literal = "2022-01-01 11:11:11.111";
cctz::time_zone ctz;
- TimezoneUtils::find_cctz_time_zone("UTC", ctz);
+ DORIS_CHECK(TimezoneUtils::find_cctz_time_zone("UTC", ctz));
{
CastParameters p;
EXPECT_TRUE(CastToDatetimeV2::from_string_strict_mode<DatelikeParseMode::STRICT>(
diff --git a/be/test/core/data_type_serde/data_type_serde_timestamptz_test.cpp
b/be/test/core/data_type_serde/data_type_serde_timestamptz_test.cpp
index 9de6e14d898..013d132cbda 100644
--- a/be/test/core/data_type_serde/data_type_serde_timestamptz_test.cpp
+++ b/be/test/core/data_type_serde/data_type_serde_timestamptz_test.cpp
@@ -67,7 +67,7 @@ public:
std::cout << "loading test dataset" << std::endl;
TimezoneUtils::load_timezones_to_cache();
cctz::time_zone tz;
- TimezoneUtils::find_cctz_time_zone("+08:00", tz);
+ ASSERT_TRUE(TimezoneUtils::find_cctz_time_zone("+08:00", tz));
auto test_func = [&](const MutableColumnPtr& column, const auto& serde,
const std::string& data_file_name) {
MutableColumns columns;
@@ -90,7 +90,7 @@ TEST_F(DataTypeTimeStampTzSerDeTest, serdes) {
char field_delim = ';';
option.field_delim = std::string(1, field_delim);
cctz::time_zone tz;
- TimezoneUtils::find_cctz_time_zone("+08:00", tz);
+ ASSERT_TRUE(TimezoneUtils::find_cctz_time_zone("+08:00", tz));
option.timezone = &tz;
auto test_func = [&](const auto& serde, const auto& source_column) {
using SerdeType = decltype(serde);
diff --git a/be/test/core/data_type_serde/data_type_serde_varbinary_test.cpp
b/be/test/core/data_type_serde/data_type_serde_varbinary_test.cpp
index dc0a996462c..50de6365ee1 100644
--- a/be/test/core/data_type_serde/data_type_serde_varbinary_test.cpp
+++ b/be/test/core/data_type_serde/data_type_serde_varbinary_test.cpp
@@ -349,7 +349,7 @@ TEST_F(DataTypeVarbinarySerDeTest, OrcWriteSupported) {
TimezoneUtils::load_timezones_to_cache();
DataTypeSerDe::FormatOptions format_options;
cctz::time_zone tz;
- TimezoneUtils::find_cctz_time_zone("UTC", tz);
+ ASSERT_TRUE(TimezoneUtils::find_cctz_time_zone("UTC", tz));
format_options.timezone = &tz;
auto batch = std::make_unique<orc::StringVectorBatch>(1,
*orc::getDefaultPool());
auto st = serde.write_column_to_orc("UTC", *col, nullptr, batch.get(), 0,
0, arena,
@@ -584,7 +584,7 @@ TEST_F(DataTypeVarbinarySerDeTest,
OrcWriteStartEndNullMapIgnoredAndEmptyRange)
TimezoneUtils::load_timezones_to_cache();
DataTypeSerDe::FormatOptions format_options;
cctz::time_zone tz;
- TimezoneUtils::find_cctz_time_zone("UTC", tz);
+ ASSERT_TRUE(TimezoneUtils::find_cctz_time_zone("UTC", tz));
format_options.timezone = &tz;
// Provide a null_map but implementation ignores it; ensure data still
written.
diff --git a/be/test/exprs/vexpr_test.cpp b/be/test/exprs/vexpr_test.cpp
index 5268240c3a6..621db91dc68 100644
--- a/be/test/exprs/vexpr_test.cpp
+++ b/be/test/exprs/vexpr_test.cpp
@@ -606,7 +606,7 @@ TEST(TEST_VEXPR, LITERALTEST) {
int scale = 6;
std::string tz_str = "+08:00";
cctz::time_zone tz;
- TimezoneUtils::find_cctz_time_zone(tz_str, tz);
+ ASSERT_TRUE(TimezoneUtils::find_cctz_time_zone(tz_str, tz));
DateV2Value<DateTimeV2ValueType> datetime_v2;
datetime_v2.unchecked_set_time(year, month, day, hour, minute, second,
microsecond);
TimestampTzValue tz_value;
diff --git a/be/test/testutil/run_all_tests.cpp
b/be/test/testutil/run_all_tests.cpp
index 693accfdd7e..45ffb3623f0 100644
--- a/be/test/testutil/run_all_tests.cpp
+++ b/be/test/testutil/run_all_tests.cpp
@@ -41,6 +41,7 @@
#include "util/disk_info.h"
#include "util/mem_info.h"
#include "util/threadpool.h"
+#include "util/timezone_utils.h"
int main(int argc, char** argv) {
SCOPED_INIT_THREAD_CONTEXT();
@@ -92,6 +93,7 @@ int main(int argc, char** argv) {
doris::DiskInfo::init();
doris::MemInfo::init();
doris::BackendOptions::init();
+ doris::TimezoneUtils::load_timezones_to_cache();
auto service =
std::make_unique<doris::HttpService>(doris::ExecEnv::GetInstance(), 0, 1);
auto status = service->start();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]