YennyQ commented on issue #24647:
URL: https://github.com/apache/doris/issues/24647#issuecomment-1735136182

   > > > > > java-udf have some problem in 2.0.1 version with `set 
experimental_enable_nereids_planner = true`; you can set this session variables 
= false, and then test it again.
   > > > > > if it's still have some error, you can at me to look together.
   > > > > 
   > > > > 
   > > > > Thank you for the assistance. I tried your suggestions, and the 
'ClassNotFoundException' issue in version 2.0.1 has been resolved. Now I can 
successfully use the Java UDF function, but the behavior appears to be the same 
as the problem in version 1.2.3, where it gets reinitialized with every call.
   > > > > Also, I would like to know how to make the changes to 
'experimental_enable_nereids_planner = false' permanent? They revert to the 
default values after a restart.
   > > > 
   > > > 
   > > > you can only set experimental_enable_nereids_planner = false when you 
SQL have java-udf function, and the problem have fixed in master branch, so at 
the next version maybe 2.0.2, you can always set 
experimental_enable_nereids_planner = true.
   > > > where it gets reinitialized with every call this is problem is about 
the class load/unload, i could have a test at local.
   > > 
   > > 
   > > Thank you, if there's anything I can do during testing, please at me 
directly.
   > > Additionally, I would like to know whether Doris is intended to load the 
UDF class only once throughout its lifecycle, or reload it under specific 
conditions (if so, what are those conditions), or reload the UDF class with 
every call? Alternatively, i would greatly appreciate if there is any 
documentation or information available about Doris' Java UDF class load/unload 
that I can study.
   > 
   > Udf implement of code in Doris, you can find in: 
fe/be-java-extensions/java-udf/src/main/java/org/apache/doris/udf/UdfExecutor.java
 be/src/vec/functions/function_java_udf.cpp
   > 
   > @YennyQ there maybe a method to load static value once.
   > 
   > 1. write the AddOne.java, this file is used to implement you function 
logical. and then package this to AddOne.jar
   > 2. mv this AddOne.jar to the doris home path: 
be/lib/java_extensions/java-udf/  (maybe need restart BE)
   > 3. then write a new file, eg: Function.java, in this file of evaluate 
method, you could invoke some function from AddOne.java.  and then only package 
Function.java to Function.jar
   > 4. create udf function use Function.jar in Doris. so it's will only load 
Function.jar every call.
   > 
   > <img alt="image" width="237" 
src="https://user-images.githubusercontent.com/87313068/270303967-f8441c9e-52eb-4545-a34c-5bf05a4eb51f.png";>
   
   Thank you, that’s exactly what I need.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to