Gabriel39 commented on code in PR #25151: URL: https://github.com/apache/doris/pull/25151#discussion_r1349920467
########## be/src/vec/functions/function_java_udf.cpp: ########## @@ -85,39 +85,41 @@ Status JavaFunctionCall::open(FunctionContext* context, FunctionContext::Functio RETURN_ERROR_IF_EXC(env); context->set_function_state(FunctionContext::FRAGMENT_LOCAL, jni_env); } - JniEnv* jni_env = - reinterpret_cast<JniEnv*>(context->get_function_state(FunctionContext::FRAGMENT_LOCAL)); - std::shared_ptr<JniContext> jni_ctx = std::make_shared<JniContext>( - _argument_types.size(), jni_env->executor_cl, jni_env->executor_close_id); - context->set_function_state(FunctionContext::THREAD_LOCAL, jni_ctx); - // Add a scoped cleanup jni reference object. This cleans up local refs made below. - JniLocalFrame jni_frame; - { - std::string local_location; - auto function_cache = UserFunctionCache::instance(); - RETURN_IF_ERROR(function_cache->get_jarpath(fn_.id, fn_.hdfs_location, fn_.checksum, - &local_location)); - TJavaUdfExecutorCtorParams ctor_params; - ctor_params.__set_fn(fn_); - ctor_params.__set_location(local_location); - jbyteArray ctor_params_bytes; + if (scope == FunctionContext::FunctionStateScope::THREAD_LOCAL) { Review Comment: Use `else` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org