[refactor](cache) Refactor preloaded timezone global cache (#24694)

Refactor preloaded timezone global cache
This commit is contained in:
zclllyybb
2023-09-21 17:26:41 +08:00
committed by GitHub
parent b9997d69fa
commit 85fb46bb71
13 changed files with 119 additions and 199 deletions

View File

@ -39,17 +39,13 @@ FunctionUtils::FunctionUtils() {
FunctionUtils::FunctionUtils(const doris::TypeDescriptor& return_type,
const std::vector<doris::TypeDescriptor>& arg_types,
int varargs_buffer_size, RuntimeState* state = nullptr) {
int varargs_buffer_size) {
TQueryGlobals globals;
globals.__set_now_string("2019-08-06 01:38:57");
globals.__set_timestamp_ms(1565026737805);
globals.__set_time_zone("Asia/Shanghai");
if (state == nullptr) {
_state = RuntimeState::create_unique(globals).release();
_fn_ctx = FunctionContext::create_context(_state, return_type, arg_types);
} else {
_fn_ctx = FunctionContext::create_context(state, return_type, arg_types);
}
_state = RuntimeState::create_unique(globals).release();
_fn_ctx = FunctionContext::create_context(_state, return_type, arg_types);
}
FunctionUtils::~FunctionUtils() {