Skip to content

Conversation

@yujun777
Copy link
Contributor

@yujun777 yujun777 commented Mar 10, 2025

What problem does this PR solve?

if set Config.enable_java_udf = false, execute fe alias function will throw exception:

MySQL root@127.0.0.1:(none)> create global alias function foo3(STRING) with parameter(s) as concat(s, "hello");
Query OK, 0 rows affected
Time: 7.590s
MySQL root@127.0.0.1:(none)> select foo3("tt");
(1105, 'errCode = 2, detailMessage = java_udf has been disabled.')

fix this, alias function no check enable_java_udf.

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Thearas
Copy link
Contributor

Thearas commented Mar 10, 2025

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

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@yujun777
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17578	5258	5073	5073
q2	2051	280	165	165
q3	10435	1347	769	769
q4	10201	1028	532	532
q5	7553	2349	2360	2349
q6	187	163	131	131
q7	912	746	617	617
q8	9309	1290	1117	1117
q9	4965	4707	4752	4707
q10	6867	2332	1882	1882
q11	478	282	267	267
q12	366	351	216	216
q13	17764	3692	3088	3088
q14	232	241	208	208
q15	532	491	475	475
q16	622	614	592	592
q17	578	846	372	372
q18	6928	6468	6368	6368
q19	1461	954	556	556
q20	310	328	191	191
q21	2927	2150	1901	1901
q22	1040	1028	999	999
Total cold run time: 103296 ms
Total hot run time: 32575 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5172	5185	5167	5167
q2	233	328	237	237
q3	2160	2645	2302	2302
q4	1418	1887	1365	1365
q5	4234	4132	4188	4132
q6	207	163	122	122
q7	1856	1901	1791	1791
q8	2639	2609	2531	2531
q9	7284	7243	7235	7235
q10	3038	3257	2758	2758
q11	584	508	495	495
q12	727	790	596	596
q13	3399	3857	3285	3285
q14	286	306	279	279
q15	536	483	472	472
q16	635	678	656	656
q17	1144	1602	1352	1352
q18	7840	7524	7546	7524
q19	798	861	1000	861
q20	1952	2024	1919	1919
q21	5561	5041	4739	4739
q22	1135	1107	1008	1008
Total cold run time: 52838 ms
Total hot run time: 50826 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192486 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 5e2ce8d13f0fa6fdc71adc03d54262ac5ec6fdfa, data reload: false

query1	1381	1003	983	983
query2	6319	1878	1899	1878
query3	11109	4591	4603	4591
query4	56323	24335	23213	23213
query5	5272	545	481	481
query6	397	184	168	168
query7	5319	506	289	289
query8	334	231	229	229
query9	7171	2523	2532	2523
query10	417	323	259	259
query11	15596	15074	14809	14809
query12	155	110	104	104
query13	1265	500	403	403
query14	10510	6797	6925	6797
query15	193	213	185	185
query16	6924	684	506	506
query17	1088	728	590	590
query18	1535	412	334	334
query19	209	206	176	176
query20	132	130	121	121
query21	204	124	106	106
query22	4564	4774	4539	4539
query23	33888	33253	33459	33253
query24	5755	2448	2407	2407
query25	482	456	393	393
query26	779	276	153	153
query27	1945	501	339	339
query28	2782	2439	2436	2436
query29	666	562	422	422
query30	280	219	199	199
query31	873	853	769	769
query32	72	62	61	61
query33	439	389	317	317
query34	742	854	494	494
query35	812	856	761	761
query36	968	1017	887	887
query37	116	95	69	69
query38	4225	4279	4140	4140
query39	1542	1462	1436	1436
query40	229	119	103	103
query41	53	52	49	49
query42	128	108	109	108
query43	507	518	487	487
query44	1326	810	800	800
query45	182	172	173	172
query46	843	1036	639	639
query47	1812	1913	1835	1835
query48	375	408	316	316
query49	699	508	440	440
query50	697	746	440	440
query51	4247	4351	4253	4253
query52	115	114	99	99
query53	236	266	206	206
query54	490	502	403	403
query55	87	78	81	78
query56	284	253	252	252
query57	1172	1208	1112	1112
query58	251	246	254	246
query59	2807	2779	2657	2657
query60	288	292	265	265
query61	148	117	115	115
query62	748	756	683	683
query63	240	201	194	194
query64	2138	1116	681	681
query65	4514	4421	4329	4329
query66	743	402	294	294
query67	16184	15662	15460	15460
query68	8458	882	504	504
query69	546	297	266	266
query70	1226	1111	1056	1056
query71	487	297	320	297
query72	5771	3576	3710	3576
query73	1100	738	343	343
query74	9007	9196	9035	9035
query75	3801	3150	2728	2728
query76	4438	1184	759	759
query77	620	362	280	280
query78	10132	10080	9329	9329
query79	2799	823	579	579
query80	699	513	438	438
query81	492	255	228	228
query82	666	129	96	96
query83	298	166	157	157
query84	286	93	72	72
query85	781	348	307	307
query86	390	296	269	269
query87	4558	4531	4517	4517
query88	3357	2236	2222	2222
query89	405	310	286	286
query90	1832	206	219	206
query91	144	136	111	111
query92	76	57	57	57
query93	2068	1038	582	582
query94	683	417	306	306
query95	346	273	253	253
query96	476	569	271	271
query97	3391	3457	3333	3333
query98	221	197	199	197
query99	1458	1401	1290	1290
Total cold run time: 305338 ms
Total hot run time: 192486 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.07	0.03	0.04
query3	0.23	0.07	0.07
query4	1.63	0.11	0.11
query5	0.59	0.55	0.56
query6	1.19	0.72	0.73
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.60	0.54	0.53
query10	0.59	0.61	0.60
query11	0.15	0.11	0.11
query12	0.15	0.11	0.12
query13	0.62	0.59	0.60
query14	2.71	2.81	2.83
query15	0.91	0.85	0.85
query16	0.39	0.38	0.38
query17	0.99	1.01	1.02
query18	0.21	0.20	0.20
query19	1.91	1.88	1.93
query20	0.02	0.01	0.01
query21	15.40	0.91	0.55
query22	0.74	1.17	0.68
query23	14.96	1.28	0.65
query24	6.71	1.72	0.96
query25	0.52	0.22	0.08
query26	0.66	0.16	0.15
query27	0.05	0.05	0.05
query28	9.51	0.84	0.43
query29	12.65	3.92	3.26
query30	0.25	0.08	0.06
query31	2.80	0.58	0.40
query32	3.22	0.55	0.46
query33	3.00	3.01	2.99
query34	15.75	5.14	4.54
query35	4.57	4.53	4.55
query36	0.66	0.49	0.50
query37	0.08	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.02	0.02
query40	0.18	0.14	0.13
query41	0.08	0.03	0.03
query42	0.03	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 105.01 s
Total hot run time: 31.25 s

Comment on lines 217 to 219
if (candidate.stream().anyMatch(builder -> !(builder instanceof AliasUdfBuilder))) {
FunctionUtil.checkEnableJavaUdfForNereids();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we should move this check to org.apache.doris.catalog.FunctionRegistry#findFunctionBuilder(java.lang.String, java.lang.String, java.util.List<?>)

do as below:
we do two round search in candidates list if java udf is disable.
first round we only search other udf.
if no other udf is matched, we do second round search in java udf.
if no java udf is matched yet, we report no function matched.
if some java udfs are matched, we report java udf is disable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@yujun777
Copy link
Contributor Author

run buildall

@yujun777
Copy link
Contributor Author

run buildall

@yujun777
Copy link
Contributor Author

run buildall

@yujun777
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17615	5169	5048	5048
q2	2045	283	168	168
q3	10436	1277	749	749
q4	10321	997	521	521
q5	8844	2251	2343	2251
q6	187	161	132	132
q7	906	763	609	609
q8	9304	1236	1095	1095
q9	4829	4824	4860	4824
q10	6802	2297	1905	1905
q11	484	273	254	254
q12	340	347	220	220
q13	17752	3661	3114	3114
q14	225	221	208	208
q15	544	477	482	477
q16	636	610	567	567
q17	590	861	349	349
q18	6786	6523	6342	6342
q19	1360	962	566	566
q20	304	322	195	195
q21	2793	2186	1948	1948
q22	996	1026	1006	1006
Total cold run time: 104099 ms
Total hot run time: 32548 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5162	5108	5125	5108
q2	247	328	230	230
q3	2169	2670	2248	2248
q4	1410	1827	1367	1367
q5	4257	4132	4174	4132
q6	204	162	126	126
q7	1891	1974	1796	1796
q8	2611	2710	2570	2570
q9	7239	7244	7174	7174
q10	3018	3233	2767	2767
q11	569	528	482	482
q12	732	736	626	626
q13	3524	3924	3387	3387
q14	303	307	277	277
q15	538	490	484	484
q16	638	689	626	626
q17	1140	1520	1422	1422
q18	7690	7688	7661	7661
q19	826	797	889	797
q20	1956	2032	1926	1926
q21	5478	4946	4803	4803
q22	1103	1079	1030	1030
Total cold run time: 52705 ms
Total hot run time: 51039 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 195183 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 c7e9b607ce119593b0073723a080121b6eaabb34, data reload: false

query1	1381	987	996	987
query2	6208	1924	1876	1876
query3	10993	4573	4722	4573
query4	53179	25300	23732	23732
query5	5230	644	509	509
query6	345	204	199	199
query7	4888	553	312	312
query8	338	258	244	244
query9	6021	2634	2638	2634
query10	451	339	270	270
query11	15325	15330	15073	15073
query12	159	121	112	112
query13	1061	510	415	415
query14	11121	7365	6960	6960
query15	212	206	183	183
query16	7098	724	491	491
query17	1104	770	630	630
query18	1546	437	334	334
query19	225	199	175	175
query20	138	135	127	127
query21	213	136	120	120
query22	4283	4466	4489	4466
query23	34180	33518	33455	33455
query24	5934	2545	2522	2522
query25	482	511	395	395
query26	725	301	164	164
query27	1745	523	354	354
query28	2819	2463	2518	2463
query29	606	639	461	461
query30	295	236	211	211
query31	923	907	825	825
query32	78	65	64	64
query33	456	413	331	331
query34	790	902	515	515
query35	844	877	802	802
query36	1031	1077	919	919
query37	125	112	75	75
query38	4264	4452	4454	4452
query39	1526	1461	1485	1461
query40	224	122	107	107
query41	52	51	52	51
query42	131	111	111	111
query43	513	536	488	488
query44	1386	829	825	825
query45	193	181	175	175
query46	961	1137	677	677
query47	1875	1903	1771	1771
query48	410	460	319	319
query49	756	518	442	442
query50	757	808	435	435
query51	4433	4436	4366	4366
query52	116	113	101	101
query53	243	277	196	196
query54	504	509	431	431
query55	84	79	83	79
query56	296	284	279	279
query57	1173	1213	1154	1154
query58	254	261	295	261
query59	2797	2903	2680	2680
query60	302	287	293	287
query61	125	120	123	120
query62	771	778	713	713
query63	238	202	200	200
query64	1998	1065	700	700
query65	4675	4504	4552	4504
query66	749	447	312	312
query67	15918	15556	15483	15483
query68	6627	909	512	512
query69	547	324	275	275
query70	1229	1159	1120	1120
query71	498	311	269	269
query72	5913	3783	4029	3783
query73	1355	791	372	372
query74	9261	9223	8714	8714
query75	4002	3292	2810	2810
query76	4180	1329	818	818
query77	693	370	296	296
query78	10259	10393	9282	9282
query79	2161	870	609	609
query80	622	550	454	454
query81	486	275	228	228
query82	259	135	96	96
query83	168	177	159	159
query84	295	98	72	72
query85	821	362	311	311
query86	362	321	277	277
query87	4512	4598	4335	4335
query88	3923	2284	2277	2277
query89	479	339	306	306
query90	1775	217	218	217
query91	139	138	113	113
query92	73	60	59	59
query93	1847	1104	583	583
query94	625	434	293	293
query95	353	273	267	267
query96	500	627	286	286
query97	3407	3441	3298	3298
query98	238	217	198	198
query99	1432	1460	1336	1336
Total cold run time: 299317 ms
Total hot run time: 195183 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.07	0.04	0.04
query3	0.23	0.06	0.06
query4	1.63	0.11	0.11
query5	0.56	0.55	0.56
query6	1.18	0.72	0.72
query7	0.02	0.02	0.02
query8	0.04	0.04	0.03
query9	0.60	0.52	0.52
query10	0.58	0.58	0.60
query11	0.15	0.11	0.10
query12	0.15	0.10	0.12
query13	0.61	0.59	0.61
query14	2.79	2.68	2.74
query15	0.94	0.87	0.85
query16	0.37	0.39	0.38
query17	1.02	1.05	1.01
query18	0.20	0.20	0.20
query19	1.87	1.86	1.99
query20	0.02	0.01	0.01
query21	15.37	0.85	0.54
query22	0.75	1.16	0.77
query23	14.83	1.36	0.64
query24	7.12	1.49	1.22
query25	0.51	0.18	0.11
query26	0.66	0.16	0.14
query27	0.05	0.06	0.05
query28	8.96	0.85	0.43
query29	12.66	3.98	3.32
query30	0.25	0.09	0.06
query31	2.84	0.58	0.39
query32	3.22	0.55	0.47
query33	3.05	2.99	3.09
query34	15.74	5.09	4.47
query35	4.51	4.52	4.52
query36	0.67	0.49	0.48
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.02	0.03
query40	0.17	0.13	0.12
query41	0.07	0.03	0.02
query42	0.04	0.03	0.02
query43	0.04	0.03	0.02
Total cold run time: 104.75 s
Total hot run time: 31.34 s

@morrySnow morrySnow added dev/2.1.x dev/3.0.x usercase Important user case type label labels Mar 11, 2025
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 11, 2025
@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.

@924060929 924060929 merged commit ed24ac3 into apache:master Mar 11, 2025
28 of 29 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 11, 2025
if set Config.enable_java_udf = false, execute fe alias function will
throw exception:

```
MySQL root@127.0.0.1:(none)> create global alias function foo3(STRING) with parameter(s) as concat(s, "hello");
Query OK, 0 rows affected
Time: 7.590s
MySQL root@127.0.0.1:(none)> select foo3("tt");
(1105, 'errCode = 2, detailMessage = java_udf has been disabled.')
```

fix this, alias function no check enable_java_udf.
github-actions bot pushed a commit that referenced this pull request Mar 11, 2025
if set Config.enable_java_udf = false, execute fe alias function will
throw exception:

```
MySQL root@127.0.0.1:(none)> create global alias function foo3(STRING) with parameter(s) as concat(s, "hello");
Query OK, 0 rows affected
Time: 7.590s
MySQL root@127.0.0.1:(none)> select foo3("tt");
(1105, 'errCode = 2, detailMessage = java_udf has been disabled.')
```

fix this, alias function no check enable_java_udf.
dataroaring pushed a commit that referenced this pull request Mar 20, 2025
…48903)

Cherry-picked from #48843

Co-authored-by: yujun <yujun@selectdb.com>
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
if set Config.enable_java_udf = false, execute fe alias function will
throw exception:

```
MySQL root@127.0.0.1:(none)> create global alias function foo3(STRING) with parameter(s) as concat(s, "hello");
Query OK, 0 rows affected
Time: 7.590s
MySQL root@127.0.0.1:(none)> select foo3("tt");
(1105, 'errCode = 2, detailMessage = java_udf has been disabled.')
```

fix this, alias function no check enable_java_udf.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/2.1.9-merged dev/3.0.5-merged reviewed usercase Important user case type label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants