-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve](udf) support java-udf static load #34980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
TeamCity be ut coverage result: |
|
run buildall |
|
TeamCity be ut coverage result: |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
run buildall |
|
TeamCity be ut coverage result: |
|
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
|
clang-tidy review says "All clean, LGTM! 👍" |
|
run buildall |
|
TeamCity be ut coverage result: |
|
run buildall |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 40799 ms |
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 170598 ms |
ClickBench: Total hot run time: 30.78 s |
0ee3d8f to
a2f9d16
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 40684 ms |
|
TeamCity be ut coverage result: |
ClickBench: Total hot run time: 30.89 s |
2465fa3 to
92ca97d
Compare
update update add expiration_time update update
|
clang-tidy review says "All clean, LGTM! 👍" |
92ca97d to
4f3f25b
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 40036 ms |
TPC-DS: Total hot run time: 173500 ms |
ClickBench: Total hot run time: 30.56 s |
HappenLee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
dataroaring
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
## Proposed changes
```
CREATE FUNCTION print_12() RETURNS int
PROPERTIES (
"symbol" = "org.apache.doris.udf.AddOne",
"type" = "JAVA_UDF",
"file" = "file:///mnt/ava-udf-demo-jar-with-dependencies.jar",
"static_load" = "true", // default value is false
"expiration_time" = "60" // default value is 360 minutes
);
```
if set static_load=true, the udf ClassLoader will be cache, and will be
clear when expiration timeout
or use drop function stmt.
In this PR #34980, we cache the class load of java udf. But when calling init() method, it is still very time consuming when calling `Class.forName()`. This PR add a new class `UdfClassCache` to cache more things so that the `init()` method will not cost too much time.
In this PR #34980, we cache the class load of java udf. But when calling init() method, it is still very time consuming when calling `Class.forName()`. This PR add a new class `UdfClassCache` to cache more things so that the `init()` method will not cost too much time.
```
CREATE FUNCTION print_12() RETURNS int
PROPERTIES (
"symbol" = "org.apache.doris.udf.AddOne",
"type" = "JAVA_UDF",
"file" = "file:///mnt/ava-udf-demo-jar-with-dependencies.jar",
"static_load" = "true", // default value is false
"expiration_time" = "60" // default value is 360 minutes
);
```
if set static_load=true, the udf ClassLoader will be cache, and will be
clear when expiration timeout
or use drop function stmt.
```
CREATE FUNCTION print_12() RETURNS int
PROPERTIES (
"symbol" = "org.apache.doris.udf.AddOne",
"type" = "JAVA_UDF",
"file" = "file:///mnt/ava-udf-demo-jar-with-dependencies.jar",
"static_load" = "true", // default value is false
"expiration_time" = "60" // default value is 360 minutes
);
```
if set static_load=true, the udf ClassLoader will be cache, and will be
clear when expiration timeout
or use drop function stmt.
Proposed changes
if set static_load=true, the udf ClassLoader will be cache, and will be clear when expiration timeout
or use drop function stmt.
Issue Number: close #xxx
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...