Skip to content

Conversation

@zhangstar333
Copy link
Contributor

@zhangstar333 zhangstar333 commented May 16, 2024

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.

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...

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@zhangstar333
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.69% (9002/25221)
Line Coverage: 27.36% (74458/272170)
Region Coverage: 26.60% (38493/144729)
Branch Coverage: 23.41% (19632/83846)
Coverage Report: http://coverage.selectdb-in.cc/coverage/ef0a0545198cbcd25fd5581fceb9a990678cba9a_ef0a0545198cbcd25fd5581fceb9a990678cba9a/report/index.html

@zhangstar333
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.70% (9004/25221)
Line Coverage: 27.37% (74483/272171)
Region Coverage: 26.60% (38502/144727)
Branch Coverage: 23.43% (19643/83844)
Coverage Report: http://coverage.selectdb-in.cc/coverage/ef0a0545198cbcd25fd5581fceb9a990678cba9a_ef0a0545198cbcd25fd5581fceb9a990678cba9a/report/index.html

@zhangstar333
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@zhangstar333
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.69% (9005/25229)
Line Coverage: 27.37% (74521/272262)
Region Coverage: 26.61% (38526/144779)
Branch Coverage: 23.44% (19658/83870)
Coverage Report: http://coverage.selectdb-in.cc/coverage/1919da51b9399096821b135a3e4d39ee0b4aeeab_1919da51b9399096821b135a3e4d39ee0b4aeeab/report/index.html

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@zhangstar333
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.69% (9018/25265)
Line Coverage: 27.34% (74559/272689)
Region Coverage: 26.55% (38534/145134)
Branch Coverage: 23.41% (19663/84008)
Coverage Report: http://coverage.selectdb-in.cc/coverage/3d7d7822da3bd6753347a0990787024689af7d5b_3d7d7822da3bd6753347a0990787024689af7d5b/report/index.html

@zhangstar333
Copy link
Contributor Author

run buildall

@zhangstar333
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2024

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TPC-H: Total hot run time: 40799 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 796f9c0287bbbad795cd4b0b6896135cd9518749, data reload: false

------ Round 1 ----------------------------------
q1	17603	4398	4337	4337
q2	2025	203	201	201
q3	10425	1263	1111	1111
q4	10190	862	889	862
q5	7481	2721	2636	2636
q6	237	136	138	136
q7	969	641	603	603
q8	9218	2141	2118	2118
q9	9981	6645	6713	6645
q10	9085	3944	3899	3899
q11	460	250	238	238
q12	435	223	232	223
q13	17879	3223	3180	3180
q14	282	220	230	220
q15	512	470	480	470
q16	504	389	392	389
q17	955	678	627	627
q18	8457	7773	7730	7730
q19	7460	1333	1264	1264
q20	649	324	319	319
q21	5015	3244	3988	3244
q22	402	347	367	347
Total cold run time: 120224 ms
Total hot run time: 40799 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4602	4425	4460	4425
q2	379	262	264	262
q3	3159	2939	2890	2890
q4	1982	1781	1622	1622
q5	5284	5447	5483	5447
q6	225	130	129	129
q7	2192	1799	1815	1799
q8	3263	3369	3342	3342
q9	8689	8596	8592	8592
q10	4073	3864	3862	3862
q11	600	518	495	495
q12	793	565	629	565
q13	15999	2992	3112	2992
q14	302	277	273	273
q15	534	483	474	474
q16	488	412	410	410
q17	1792	1486	1479	1479
q18	8032	7876	7340	7340
q19	1755	1603	1587	1587
q20	3032	1777	1783	1777
q21	4742	4711	4668	4668
q22	825	527	539	527
Total cold run time: 72742 ms
Total hot run time: 54957 ms

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.28% (9238/25462)
Line Coverage: 27.65% (75830/274296)
Region Coverage: 26.87% (39277/146186)
Branch Coverage: 23.60% (19909/84364)
Coverage Report: http://coverage.selectdb-in.cc/coverage/796f9c0287bbbad795cd4b0b6896135cd9518749_796f9c0287bbbad795cd4b0b6896135cd9518749/report/index.html

@doris-robot
Copy link

TPC-DS: Total hot run time: 170598 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 796f9c0287bbbad795cd4b0b6896135cd9518749, data reload: false

query1	900	377	369	369
query2	6446	2366	2517	2366
query3	6651	212	206	206
query4	19038	17496	17291	17291
query5	4130	460	448	448
query6	241	166	154	154
query7	4589	291	285	285
query8	327	278	303	278
query9	8356	2431	2412	2412
query10	438	294	305	294
query11	10624	10192	10087	10087
query12	145	88	95	88
query13	1639	369	366	366
query14	9190	7629	7497	7497
query15	241	193	185	185
query16	7813	258	256	256
query17	1641	518	515	515
query18	1951	295	264	264
query19	213	158	151	151
query20	96	87	88	87
query21	206	134	126	126
query22	4693	4283	4341	4283
query23	33690	33325	32955	32955
query24	10938	2762	2849	2762
query25	622	347	369	347
query26	1245	150	150	150
query27	2598	320	320	320
query28	7234	2094	2075	2075
query29	887	610	584	584
query30	282	152	146	146
query31	952	740	735	735
query32	89	54	55	54
query33	764	295	296	295
query34	957	459	473	459
query35	742	620	605	605
query36	1084	908	911	908
query37	153	69	66	66
query38	2829	2739	2703	2703
query39	866	794	786	786
query40	213	125	121	121
query41	54	50	52	50
query42	120	93	102	93
query43	591	557	546	546
query44	1219	733	748	733
query45	203	170	165	165
query46	1078	743	697	697
query47	1906	1771	1805	1771
query48	365	289	296	289
query49	988	412	402	402
query50	779	385	374	374
query51	6956	6785	6774	6774
query52	99	91	87	87
query53	391	292	287	287
query54	876	460	429	429
query55	72	70	72	70
query56	272	251	260	251
query57	1145	1071	1024	1024
query58	253	268	262	262
query59	3611	3400	3227	3227
query60	296	297	260	260
query61	87	85	87	85
query62	637	436	461	436
query63	324	286	293	286
query64	8884	2214	1718	1718
query65	3190	3085	3087	3085
query66	804	320	329	320
query67	15254	15011	15146	15011
query68	4544	536	516	516
query69	449	295	295	295
query70	1134	1138	1119	1119
query71	434	280	280	280
query72	7084	2715	2578	2578
query73	739	317	315	315
query74	6009	5514	5522	5514
query75	3418	2695	2689	2689
query76	2792	938	955	938
query77	480	289	290	289
query78	10219	9754	9740	9740
query79	2576	518	498	498
query80	1435	456	452	452
query81	557	217	218	217
query82	1306	104	100	100
query83	232	166	168	166
query84	246	86	87	86
query85	1463	278	261	261
query86	492	324	318	318
query87	3309	3067	3079	3067
query88	3835	2378	2355	2355
query89	484	380	387	380
query90	1831	189	193	189
query91	133	107	106	106
query92	64	49	49	49
query93	2315	505	492	492
query94	1234	190	190	190
query95	478	308	308	308
query96	584	267	266	266
query97	3189	3009	2993	2993
query98	235	224	208	208
query99	1162	832	813	813
Total cold run time: 270629 ms
Total hot run time: 170598 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.78 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 796f9c0287bbbad795cd4b0b6896135cd9518749, data reload: false

query1	0.04	0.04	0.03
query2	0.08	0.04	0.04
query3	0.23	0.05	0.06
query4	1.66	0.09	0.10
query5	0.51	0.49	0.50
query6	1.12	0.71	0.71
query7	0.02	0.01	0.01
query8	0.05	0.05	0.05
query9	0.55	0.48	0.48
query10	0.53	0.55	0.53
query11	0.15	0.11	0.11
query12	0.15	0.12	0.12
query13	0.59	0.58	0.60
query14	0.78	0.79	0.78
query15	0.82	0.81	0.81
query16	0.36	0.37	0.34
query17	1.03	1.04	0.99
query18	0.21	0.25	0.24
query19	1.84	1.78	1.67
query20	0.02	0.01	0.01
query21	15.52	0.68	0.66
query22	4.41	6.83	2.28
query23	18.32	1.34	1.20
query24	1.75	0.27	0.23
query25	0.14	0.08	0.08
query26	0.26	0.18	0.17
query27	0.08	0.07	0.07
query28	13.32	1.00	0.98
query29	13.06	3.33	3.33
query30	0.24	0.05	0.06
query31	2.88	0.38	0.38
query32	3.29	0.46	0.47
query33	2.90	2.84	2.90
query34	17.13	4.34	4.43
query35	4.49	4.51	4.52
query36	0.69	0.51	0.48
query37	0.18	0.15	0.16
query38	0.16	0.15	0.14
query39	0.04	0.03	0.04
query40	0.17	0.14	0.14
query41	0.09	0.05	0.06
query42	0.07	0.06	0.05
query43	0.04	0.04	0.03
Total cold run time: 109.97 s
Total hot run time: 30.78 s

@zhangstar333 zhangstar333 force-pushed the static_load branch 2 times, most recently from 0ee3d8f to a2f9d16 Compare June 4, 2024 07:06
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2024

clang-tidy review says "All clean, LGTM! 👍"

@zhangstar333
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2024

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TPC-H: Total hot run time: 40684 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit a2f9d1601837e6d60fd097d67e6aa366233fb0dc, data reload: false

------ Round 1 ----------------------------------
q1	17690	4946	4400	4400
q2	2034	204	200	200
q3	10709	1275	1169	1169
q4	10300	814	765	765
q5	7516	2784	2660	2660
q6	225	138	138	138
q7	971	644	623	623
q8	9311	2126	2132	2126
q9	9479	6730	6670	6670
q10	9219	3844	3810	3810
q11	451	254	260	254
q12	459	230	225	225
q13	18904	2977	3010	2977
q14	262	215	232	215
q15	521	483	494	483
q16	500	382	384	382
q17	995	714	711	711
q18	8362	7565	7594	7565
q19	4805	1448	1526	1448
q20	652	323	315	315
q21	5018	3220	3911	3220
q22	384	328	334	328
Total cold run time: 118767 ms
Total hot run time: 40684 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4423	4290	4252	4252
q2	377	263	270	263
q3	3018	2733	2728	2728
q4	1903	1629	1594	1594
q5	5308	5301	5309	5301
q6	220	128	130	128
q7	2179	1703	1703	1703
q8	3211	3376	3317	3317
q9	8474	8445	8398	8398
q10	3986	3771	3657	3657
q11	594	493	498	493
q12	790	611	594	594
q13	16374	2974	3010	2974
q14	303	274	257	257
q15	524	500	498	498
q16	463	414	429	414
q17	1867	1521	1494	1494
q18	7980	7650	7585	7585
q19	1716	1631	1593	1593
q20	2017	1790	1799	1790
q21	5027	4689	4796	4689
q22	623	540	562	540
Total cold run time: 71377 ms
Total hot run time: 54262 ms

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.46% (9004/24695)
Line Coverage: 28.01% (73786/263422)
Region Coverage: 27.50% (38337/139432)
Branch Coverage: 24.19% (19544/80782)
Coverage Report: http://coverage.selectdb-in.cc/coverage/2465fa3392f5a3787d165ea4103e7999fb2e682c_2465fa3392f5a3787d165ea4103e7999fb2e682c/report/index.html

@doris-robot
Copy link

ClickBench: Total hot run time: 30.89 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 2465fa3392f5a3787d165ea4103e7999fb2e682c, data reload: false

query1	0.04	0.03	0.03
query2	0.08	0.03	0.04
query3	0.22	0.06	0.05
query4	1.65	0.10	0.09
query5	0.52	0.50	0.52
query6	1.13	0.72	0.72
query7	0.02	0.01	0.02
query8	0.04	0.04	0.04
query9	0.53	0.49	0.50
query10	0.54	0.55	0.54
query11	0.16	0.11	0.10
query12	0.15	0.12	0.12
query13	0.59	0.58	0.60
query14	0.77	0.77	0.78
query15	0.85	0.80	0.82
query16	0.36	0.36	0.37
query17	0.99	0.94	0.96
query18	0.21	0.26	0.24
query19	1.75	1.75	1.68
query20	0.01	0.01	0.01
query21	15.42	0.65	0.63
query22	3.88	7.20	2.39
query23	18.29	1.34	1.21
query24	2.18	0.23	0.21
query25	0.16	0.08	0.08
query26	0.26	0.18	0.18
query27	0.08	0.09	0.09
query28	13.21	1.01	0.99
query29	12.64	3.28	3.23
query30	0.26	0.07	0.06
query31	2.85	0.39	0.39
query32	3.28	0.47	0.46
query33	2.90	2.87	2.87
query34	17.17	4.47	4.42
query35	4.52	4.55	4.53
query36	0.65	0.47	0.46
query37	0.18	0.15	0.15
query38	0.15	0.14	0.15
query39	0.05	0.04	0.03
query40	0.18	0.14	0.14
query41	0.10	0.04	0.04
query42	0.06	0.06	0.05
query43	0.04	0.04	0.04
Total cold run time: 109.12 s
Total hot run time: 30.89 s

update
update
add expiration_time
update
update
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@zhangstar333
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TPC-H: Total hot run time: 40036 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 2ee94fcc0f5420e10d93d97fbbd507b460c7924e, data reload: false

------ Round 1 ----------------------------------
q1	17672	5043	4318	4318
q2	2028	191	186	186
q3	10541	1156	1091	1091
q4	10206	834	858	834
q5	7503	2682	2651	2651
q6	224	133	135	133
q7	970	594	609	594
q8	9227	2101	2128	2101
q9	9112	6529	6501	6501
q10	8898	3718	3744	3718
q11	469	236	235	235
q12	418	232	225	225
q13	18523	2970	2987	2970
q14	259	217	219	217
q15	520	478	475	475
q16	522	382	379	379
q17	976	736	723	723
q18	8054	7433	7404	7404
q19	6061	1491	1560	1491
q20	661	320	318	318
q21	4931	3141	3987	3141
q22	393	343	331	331
Total cold run time: 118168 ms
Total hot run time: 40036 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4388	4237	4253	4237
q2	374	271	269	269
q3	3077	2893	2957	2893
q4	1960	1770	1735	1735
q5	5460	5502	5460	5460
q6	216	127	128	127
q7	2212	1845	1843	1843
q8	3253	3440	3455	3440
q9	8800	8779	8805	8779
q10	4148	3719	3765	3719
q11	604	518	494	494
q12	813	624	661	624
q13	16482	3140	3167	3140
q14	294	284	259	259
q15	526	485	485	485
q16	492	428	415	415
q17	1808	1523	1523	1523
q18	8291	7972	7754	7754
q19	1866	1542	1681	1542
q20	3129	1861	1900	1861
q21	5168	4860	4910	4860
q22	623	525	551	525
Total cold run time: 73984 ms
Total hot run time: 55984 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 173500 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 2ee94fcc0f5420e10d93d97fbbd507b460c7924e, data reload: false

query1	954	384	385	384
query2	6431	2495	2287	2287
query3	6622	203	198	198
query4	18922	17050	17151	17050
query5	3606	462	489	462
query6	246	169	167	167
query7	4587	290	288	288
query8	332	307	301	301
query9	8432	2451	2383	2383
query10	564	310	272	272
query11	10633	10042	9970	9970
query12	110	80	79	79
query13	1637	387	385	385
query14	10182	7750	7582	7582
query15	250	203	196	196
query16	7709	283	282	282
query17	1865	551	539	539
query18	1831	283	288	283
query19	201	160	158	158
query20	88	83	82	82
query21	207	128	131	128
query22	4422	4101	4000	4000
query23	33914	33436	33592	33436
query24	10473	2848	2781	2781
query25	600	372	369	369
query26	708	166	162	162
query27	2294	342	333	333
query28	6001	2163	2162	2162
query29	880	660	613	613
query30	230	154	155	154
query31	988	770	773	770
query32	97	52	54	52
query33	665	282	294	282
query34	913	493	487	487
query35	734	656	655	655
query36	1110	970	942	942
query37	144	72	76	72
query38	2934	2867	2784	2784
query39	878	839	833	833
query40	220	133	130	130
query41	58	53	52	52
query42	138	105	107	105
query43	598	568	564	564
query44	1125	751	741	741
query45	190	163	166	163
query46	1077	715	729	715
query47	1819	1763	1760	1760
query48	361	299	290	290
query49	835	408	414	408
query50	770	399	391	391
query51	6872	6753	6657	6657
query52	107	92	96	92
query53	379	295	291	291
query54	875	448	439	439
query55	74	74	73	73
query56	292	252	271	252
query57	1139	1058	1040	1040
query58	248	246	258	246
query59	3348	3460	3113	3113
query60	304	273	300	273
query61	94	91	93	91
query62	616	445	452	445
query63	324	293	288	288
query64	8515	2305	1730	1730
query65	3182	3100	3119	3100
query66	740	321	325	321
query67	15312	14754	15072	14754
query68	4519	566	555	555
query69	469	308	299	299
query70	1196	1124	1106	1106
query71	378	271	279	271
query72	6940	5363	5484	5363
query73	745	323	325	323
query74	5967	5465	5542	5465
query75	3364	2714	2694	2694
query76	2245	977	921	921
query77	463	310	300	300
query78	10429	9808	9682	9682
query79	2295	511	528	511
query80	1112	464	466	464
query81	587	228	223	223
query82	783	106	98	98
query83	239	168	229	168
query84	234	81	87	81
query85	1748	301	271	271
query86	497	319	313	313
query87	3306	3094	3109	3094
query88	4014	2354	2351	2351
query89	466	389	382	382
query90	1771	197	188	188
query91	128	102	99	99
query92	61	52	52	52
query93	2470	515	528	515
query94	1197	188	194	188
query95	404	316	318	316
query96	582	277	270	270
query97	3194	3025	3028	3025
query98	216	202	184	184
query99	1277	841	879	841
Total cold run time: 266302 ms
Total hot run time: 173500 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.56 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 2ee94fcc0f5420e10d93d97fbbd507b460c7924e, data reload: false

query1	0.04	0.03	0.03
query2	0.08	0.04	0.04
query3	0.22	0.05	0.05
query4	1.67	0.07	0.07
query5	0.49	0.48	0.49
query6	1.12	0.72	0.72
query7	0.02	0.01	0.01
query8	0.05	0.04	0.04
query9	0.54	0.49	0.49
query10	0.55	0.54	0.54
query11	0.15	0.12	0.12
query12	0.16	0.12	0.12
query13	0.60	0.59	0.58
query14	0.78	0.81	0.80
query15	0.83	0.81	0.82
query16	0.37	0.36	0.36
query17	1.04	1.02	0.99
query18	0.22	0.28	0.24
query19	1.85	1.68	1.84
query20	0.01	0.01	0.01
query21	15.43	0.66	0.65
query22	4.72	7.22	1.87
query23	18.28	1.42	1.31
query24	2.25	0.23	0.21
query25	0.15	0.09	0.08
query26	0.27	0.18	0.17
query27	0.08	0.08	0.09
query28	13.14	1.01	1.01
query29	12.58	3.30	3.30
query30	0.26	0.06	0.06
query31	2.85	0.38	0.38
query32	3.27	0.48	0.47
query33	2.96	2.91	2.96
query34	17.18	4.41	4.41
query35	4.48	4.41	4.54
query36	0.65	0.46	0.45
query37	0.17	0.16	0.16
query38	0.15	0.14	0.14
query39	0.04	0.03	0.04
query40	0.17	0.15	0.15
query41	0.09	0.05	0.04
query42	0.06	0.05	0.05
query43	0.05	0.04	0.04
Total cold run time: 110.07 s
Total hot run time: 30.56 s

Copy link
Contributor

@HappenLee HappenLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jun 25, 2024
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhangstar333 zhangstar333 merged commit 3dce8a8 into apache:master Jun 26, 2024
dataroaring pushed a commit that referenced this pull request Jun 28, 2024
## 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.
morningman added a commit that referenced this pull request Sep 25, 2024
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.
gavinchou pushed a commit that referenced this pull request Sep 28, 2024
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.
morningman pushed a commit to morningman/doris that referenced this pull request Nov 21, 2024
```
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.
morningman pushed a commit to morningman/doris that referenced this pull request Feb 8, 2025
```
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants