Skip to content

Conversation

@zhangstar333
Copy link
Contributor

@zhangstar333 zhangstar333 commented Jul 7, 2025

What problem does this PR solve?

Problem Summary:

  • In MySQL, LOG(col, e) is equivalent to LN(col), where e is Euler’s number (~2.71828).
  • Currently, MySQL also supports LOG(col) as a shorthand for LOG(col, e) (i.e., natural logarithm).
  • This conversion replaces LOG(col) with LN(col) when only a single argument is provided.

doc: apache/doris-website#2605

Release note

None

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 Jul 7, 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?

@zhangstar333 zhangstar333 changed the title update [feature](Nereids): Convert log(x) to ln(x) Jul 7, 2025
@zhangstar333
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17594	5168	5015	5015
q2	1925	275	178	178
q3	10363	1305	722	722
q4	10229	1030	514	514
q5	7644	2379	2343	2343
q6	186	165	128	128
q7	906	758	595	595
q8	9321	1308	1130	1130
q9	6874	5139	5131	5131
q10	6887	2373	1950	1950
q11	474	286	264	264
q12	337	355	215	215
q13	17756	3699	3055	3055
q14	221	232	207	207
q15	576	473	471	471
q16	411	428	391	391
q17	604	860	355	355
q18	7424	7101	7041	7041
q19	1862	971	560	560
q20	314	338	207	207
q21	3723	3189	2343	2343
q22	363	314	289	289
Total cold run time: 105994 ms
Total hot run time: 33104 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5171	5056	5032	5032
q2	241	331	218	218
q3	2124	2675	2311	2311
q4	1386	1758	1317	1317
q5	4221	4277	4498	4277
q6	221	170	135	135
q7	2059	1976	1790	1790
q8	2620	2522	2469	2469
q9	7416	7279	7425	7279
q10	3097	3311	2925	2925
q11	574	512	499	499
q12	675	834	635	635
q13	3621	4160	3272	3272
q14	293	289	262	262
q15	506	473	480	473
q16	456	525	450	450
q17	1180	1583	1377	1377
q18	8006	7706	7653	7653
q19	773	777	872	777
q20	1974	1962	1834	1834
q21	4725	4306	4346	4306
q22	625	563	530	530
Total cold run time: 51964 ms
Total hot run time: 49821 ms

@doris-robot
Copy link

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

query1	1008	395	374	374
query2	6525	1683	1671	1671
query3	6750	215	212	212
query4	25980	23871	23168	23168
query5	4343	580	434	434
query6	296	209	203	203
query7	4634	493	286	286
query8	278	225	209	209
query9	8596	2616	2632	2616
query10	487	324	267	267
query11	15341	14949	14916	14916
query12	154	108	105	105
query13	1646	545	403	403
query14	8954	5966	5977	5966
query15	206	186	174	174
query16	7735	439	262	262
query17	1318	725	601	601
query18	2024	407	312	312
query19	199	212	158	158
query20	124	119	111	111
query21	209	130	119	119
query22	4218	4127	4005	4005
query23	34095	33389	32986	32986
query24	8406	2383	2384	2383
query25	515	483	407	407
query26	722	274	166	166
query27	2659	536	342	342
query28	4229	2130	2118	2118
query29	657	588	455	455
query30	288	224	192	192
query31	912	820	767	767
query32	67	65	58	58
query33	534	330	295	295
query34	783	841	531	531
query35	620	643	553	553
query36	936	956	885	885
query37	105	100	79	79
query38	4140	4133	4032	4032
query39	1482	1452	1418	1418
query40	211	114	122	114
query41	56	57	54	54
query42	126	113	107	107
query43	493	508	469	469
query44	1289	821	809	809
query45	177	173	165	165
query46	831	1020	633	633
query47	1794	1787	1714	1714
query48	386	414	309	309
query49	702	470	391	391
query50	640	698	415	415
query51	4221	4162	4209	4162
query52	115	109	95	95
query53	226	260	185	185
query54	608	572	503	503
query55	85	80	85	80
query56	309	296	296	296
query57	1152	1198	1128	1128
query58	254	251	251	251
query59	2502	2656	2511	2511
query60	319	307	304	304
query61	129	125	122	122
query62	800	706	665	665
query63	232	189	202	189
query64	3209	1222	905	905
query65	4251	4174	4193	4174
query66	885	405	325	325
query67	15867	15826	15514	15514
query68	8471	882	535	535
query69	516	302	265	265
query70	1240	1139	1116	1116
query71	456	319	303	303
query72	5827	4729	4885	4729
query73	730	671	352	352
query74	8933	9125	8922	8922
query75	3877	3199	2712	2712
query76	3582	1147	718	718
query77	777	402	294	294
query78	10935	11199	10372	10372
query79	1955	819	599	599
query80	583	507	432	432
query81	484	259	214	214
query82	453	126	94	94
query83	256	252	233	233
query84	245	107	89	89
query85	817	440	331	331
query86	338	316	295	295
query87	4513	4453	4389	4389
query88	3235	2269	2261	2261
query89	384	316	286	286
query90	1921	209	204	204
query91	139	145	111	111
query92	76	58	53	53
query93	1155	958	592	592
query94	679	310	198	198
query95	375	288	284	284
query96	495	564	276	276
query97	2691	2745	2732	2732
query98	223	207	205	205
query99	1466	1397	1266	1266
Total cold run time: 271871 ms
Total hot run time: 186290 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.07	0.04	0.04
query3	0.25	0.08	0.08
query4	1.61	0.11	0.10
query5	0.44	0.44	0.42
query6	1.17	0.67	0.64
query7	0.03	0.02	0.02
query8	0.04	0.03	0.04
query9	0.60	0.52	0.52
query10	0.57	0.56	0.57
query11	0.16	0.11	0.11
query12	0.14	0.12	0.12
query13	0.62	0.61	0.62
query14	0.82	0.79	0.81
query15	0.90	0.89	0.87
query16	0.39	0.40	0.39
query17	1.08	1.04	1.06
query18	0.23	0.21	0.22
query19	2.03	1.81	1.91
query20	0.02	0.02	0.01
query21	15.38	0.89	0.54
query22	0.76	1.07	0.64
query23	15.06	1.37	0.62
query24	7.69	1.42	0.43
query25	0.49	0.16	0.14
query26	0.61	0.17	0.14
query27	0.05	0.06	0.05
query28	9.44	0.87	0.44
query29	12.59	3.96	3.23
query30	0.25	0.10	0.08
query31	2.83	0.59	0.40
query32	3.23	0.56	0.48
query33	3.10	3.15	3.12
query34	16.05	5.34	4.78
query35	4.81	4.86	4.83
query36	0.69	0.50	0.49
query37	0.09	0.07	0.06
query38	0.05	0.05	0.04
query39	0.03	0.02	0.03
query40	0.16	0.13	0.14
query41	0.08	0.03	0.02
query42	0.03	0.03	0.02
query43	0.04	0.03	0.03
Total cold run time: 104.72 s
Total hot run time: 29.13 s

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jul 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2025

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2025

PR approved by anyone and no changes requested.

@zhangstar333
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 41.18% (7/17) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17693	5224	5157	5157
q2	1952	289	201	201
q3	10625	1301	751	751
q4	10314	1029	551	551
q5	8378	2349	2417	2349
q6	188	168	133	133
q7	924	779	607	607
q8	9338	1306	1107	1107
q9	7501	5133	5151	5133
q10	6900	2396	1948	1948
q11	471	283	277	277
q12	359	356	231	231
q13	17789	3745	3167	3167
q14	226	221	225	221
q15	549	484	475	475
q16	426	429	384	384
q17	596	837	385	385
q18	7714	7183	7155	7155
q19	1241	953	531	531
q20	342	349	220	220
q21	4109	3206	2437	2437
q22	371	332	308	308
Total cold run time: 108006 ms
Total hot run time: 33728 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5149	5120	5119	5119
q2	245	320	218	218
q3	2162	2731	2296	2296
q4	1399	1822	1351	1351
q5	4227	4480	4548	4480
q6	225	174	131	131
q7	2019	2024	1874	1874
q8	2706	2639	2554	2554
q9	7280	7416	7248	7248
q10	3198	3305	2866	2866
q11	635	526	512	512
q12	700	833	880	833
q13	3501	3912	3453	3453
q14	276	330	291	291
q15	524	484	476	476
q16	457	493	484	484
q17	1239	1557	1430	1430
q18	7963	7710	7396	7396
q19	788	791	869	791
q20	1999	1966	1821	1821
q21	4778	4341	4347	4341
q22	624	613	565	565
Total cold run time: 52094 ms
Total hot run time: 50530 ms

@doris-robot
Copy link

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

query1	986	390	383	383
query2	6496	1632	1644	1632
query3	6742	228	209	209
query4	26331	23775	22907	22907
query5	4301	572	451	451
query6	312	226	210	210
query7	4621	488	293	293
query8	273	218	207	207
query9	8594	2642	2639	2639
query10	481	337	277	277
query11	15632	15001	15362	15001
query12	150	108	115	108
query13	1660	552	429	429
query14	9123	6001	6115	6001
query15	209	196	173	173
query16	7322	448	272	272
query17	1295	724	599	599
query18	1999	406	316	316
query19	209	191	165	165
query20	120	123	118	118
query21	217	128	108	108
query22	4219	4128	4084	4084
query23	34140	33167	33240	33167
query24	8514	2428	2485	2428
query25	549	484	410	410
query26	1235	265	151	151
query27	2769	507	348	348
query28	4291	2137	2102	2102
query29	756	575	498	498
query30	293	229	194	194
query31	949	831	752	752
query32	71	62	62	62
query33	577	334	284	284
query34	831	842	532	532
query35	605	632	590	590
query36	949	951	895	895
query37	106	99	81	81
query38	4083	4168	4190	4168
query39	1506	1404	1421	1404
query40	258	121	108	108
query41	58	57	58	57
query42	124	110	116	110
query43	496	485	482	482
query44	1361	848	834	834
query45	176	168	165	165
query46	856	1037	650	650
query47	1746	1806	1728	1728
query48	383	429	314	314
query49	751	498	395	395
query50	684	702	428	428
query51	4241	4222	4030	4030
query52	115	110	101	101
query53	237	256	182	182
query54	592	581	507	507
query55	87	81	86	81
query56	317	310	284	284
query57	1195	1207	1138	1138
query58	272	273	261	261
query59	2580	2698	2478	2478
query60	332	320	308	308
query61	150	125	129	125
query62	810	713	658	658
query63	229	189	187	187
query64	4415	1166	831	831
query65	4256	4182	4218	4182
query66	1138	427	341	341
query67	16011	15687	15168	15168
query68	8634	896	532	532
query69	503	350	279	279
query70	1226	1096	1028	1028
query71	484	335	298	298
query72	5310	4811	4829	4811
query73	739	648	457	457
query74	9200	8812	8794	8794
query75	3924	3184	2734	2734
query76	3595	1169	738	738
query77	776	402	311	311
query78	11086	11322	10352	10352
query79	2011	891	598	598
query80	830	530	443	443
query81	459	266	218	218
query82	473	132	102	102
query83	285	264	245	245
query84	291	107	86	86
query85	784	358	321	321
query86	340	301	295	295
query87	4383	4418	4341	4341
query88	3386	2325	2332	2325
query89	397	323	290	290
query90	1949	224	213	213
query91	144	143	112	112
query92	72	60	56	56
query93	1312	979	594	594
query94	683	331	203	203
query95	382	302	291	291
query96	504	572	282	282
query97	2754	2770	2665	2665
query98	236	214	200	200
query99	1441	1451	1303	1303
Total cold run time: 275979 ms
Total hot run time: 186298 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.03
query2	0.09	0.04	0.04
query3	0.24	0.08	0.07
query4	1.61	0.12	0.11
query5	0.46	0.43	0.43
query6	1.17	0.66	0.68
query7	0.03	0.02	0.02
query8	0.05	0.04	0.03
query9	0.61	0.51	0.52
query10	0.58	0.56	0.58
query11	0.17	0.11	0.11
query12	0.15	0.11	0.12
query13	0.64	0.61	0.61
query14	0.80	0.81	0.81
query15	0.89	0.89	0.86
query16	0.38	0.38	0.39
query17	1.05	1.10	1.09
query18	0.23	0.22	0.21
query19	1.94	1.87	1.86
query20	0.01	0.01	0.02
query21	15.38	0.91	0.56
query22	0.77	1.30	0.78
query23	14.71	1.38	0.65
query24	7.20	1.48	0.38
query25	0.29	0.14	0.06
query26	0.57	0.17	0.14
query27	0.07	0.06	0.06
query28	8.99	0.90	0.43
query29	12.56	3.92	3.31
query30	0.25	0.09	0.07
query31	2.84	0.61	0.39
query32	3.25	0.56	0.47
query33	3.14	3.12	3.11
query34	16.18	5.44	4.76
query35	4.87	4.88	4.84
query36	0.71	0.51	0.49
query37	0.09	0.06	0.07
query38	0.05	0.04	0.04
query39	0.03	0.02	0.02
query40	0.17	0.15	0.14
query41	0.09	0.02	0.03
query42	0.03	0.03	0.02
query43	0.04	0.04	0.03
Total cold run time: 103.43 s
Total hot run time: 29.34 s

@HappenLee
Copy link
Contributor

@zhangstar333 we should add the change in doc

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

@zhangstar333 zhangstar333 merged commit d35fb95 into apache:master Jul 10, 2025
30 of 32 checks passed
@zhangstar333
Copy link
Contributor Author

@zhangstar333 we should add the change in doc

have updated in doc

zhangstar333 added a commit to zhangstar333/incubator-doris that referenced this pull request Jul 15, 2025
Problem Summary:

* In MySQL, LOG(col, e) is equivalent to LN(col), where e is Euler’s
number (~2.71828).
* Currently, MySQL also supports LOG(col) as a shorthand for LOG(col, e)
(i.e., natural logarithm).
* This conversion replaces LOG(col) with LN(col) when only a single
argument is provided.

 doc: apache/doris-website#2605
zhangstar333 added a commit to zhangstar333/incubator-doris that referenced this pull request Jul 15, 2025
Problem Summary:

* In MySQL, LOG(col, e) is equivalent to LN(col), where e is Euler’s
number (~2.71828).
* Currently, MySQL also supports LOG(col) as a shorthand for LOG(col, e)
(i.e., natural logarithm).
* This conversion replaces LOG(col) with LN(col) when only a single
argument is provided.

 doc: apache/doris-website#2605
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/3.1.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants