Skip to content

Conversation

@morningman
Copy link
Contributor

@morningman morningman commented Apr 10, 2025

What problem does this PR solve?

In #49036, we only support hive serde dialect in BE side.
But some constant expr will be evaluated and output in FE side, need to support it too.

Refactor the method of getting string format value for all type of literals in FE side.

There are 2 kind of string format value for literal. One is for Query, the other is for Stream Load.
Here is some difference:

  • NullLiteral
    For query, it should be null. For load, it should be \N.

  • StructLiteral
    For query, it should be {"k1":"v1", "k2":null, "k3":"", "k4":"a"}. For load, it should be {"v1", null, "", "a"}

So we need 2 different methods to distinguish them: getStringValueForQuery and getStringValueForStreamLoad.
And I removed or renamed some old and messy methods.

Exmples

  • Doris/Hive/Presto means when setting serde_dialect to these types, the format of query result for different column types.
  • Stream Load means what format should be like in csv format when loading to the table
Type Doris Hive Presto Stream Load Comment
Bool 1, 0 1, 0 1, 0 `1 0, true
Integer 1, 1000 1, 1000 1, 1000 `1 1000`
Float/Decimal 1.2, 3.00 1.2, 3.00 1.2, 3.00 `1.2 3.00`
Date/Datetime 2025-01-012025-01-01 10:11:11 2025-01-012025-01-01 10:11:11 2025-01-012025-01-01 10:11:11 `2025-01-01 2025-01-01 10:11:11`
String abc, 中国 abc, 中国 abc, 中国 abc,中国
Null null null NULL \N
Array [1, 0] [true,false] [1, 0] [1, 0], [true, false]
Array [1, 1000] [1,1000] [1, 1000] [1, 1000]
Array ["abc", "中国"] ["abc","中国"] ["abc", "中国"] ["abc", "中国"]
Array<date/datetime> ["2025-01-01", "2025-01-01 10:11:11"] ["2025-01-01","2025-01-01 10:11:11"] ["2025-01-01", "2025-01-01 10:11:11"] ["2025-01-01", "2025-01-01 10:11:11"]
Array [null] [null] [NULL] [null]
Map<int, string> {1:"abc", 2:"中国"} {1:"abc",2:"中国"} {1=abc, 2=中国} {1:"abc", 2:"中国"}
Map<string, date/datetime> {"k1":"2022-10-01", "k2":"2022-10-01 10:10:10"} {"k1":"2022-10-01","k2":"2022-10-01 10:10:10"} {k1=2022-10-01, k2=2022-10-01 10:10:10} {"k1":"2022-10-01", "k2":"2022-10-01 10:10:10"}
Map<int, null> {1:null, 2:null} {1:null,2:null} {1=NULL, 2=NULL} {1:null, 2:null}
Struct<> Same as map Same as map Same as map Same as map
  1. Fix a bug that for batch insert transaction, the trim_double_quotas should be set to false

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?

Check List (For Reviewer who merge this PR)

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

@hello-stephen
Copy link
Contributor

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?

morningman and others added 2 commits April 10, 2025 11:53
@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	26548	5031	5044	5031
q2	2066	281	182	182
q3	10393	1230	668	668
q4	10224	994	519	519
q5	7552	2302	2351	2302
q6	189	165	136	136
q7	920	745	608	608
q8	9320	1275	1092	1092
q9	6752	5148	5043	5043
q10	6850	2299	1911	1911
q11	481	288	272	272
q12	357	360	216	216
q13	17760	3673	3139	3139
q14	233	221	216	216
q15	530	488	480	480
q16	649	613	577	577
q17	612	843	374	374
q18	7461	7350	7094	7094
q19	1877	938	572	572
q20	343	334	237	237
q21	4267	3417	2499	2499
q22	1069	975	945	945
Total cold run time: 116453 ms
Total hot run time: 34113 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5228	5156	5123	5123
q2	243	333	236	236
q3	2232	2756	2434	2434
q4	1490	1897	1582	1582
q5	4545	4520	4385	4385
q6	222	166	126	126
q7	1961	1935	1745	1745
q8	2565	2636	2498	2498
q9	7286	7006	7203	7006
q10	3006	3133	2748	2748
q11	567	524	497	497
q12	681	769	600	600
q13	3554	3881	3420	3420
q14	277	291	278	278
q15	528	475	481	475
q16	657	682	644	644
q17	1171	1579	1368	1368
q18	7877	7556	7508	7508
q19	802	811	875	811
q20	1954	1969	1852	1852
q21	5291	4890	4672	4672
q22	1101	1056	993	993
Total cold run time: 53238 ms
Total hot run time: 51001 ms

@doris-robot
Copy link

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

query1	1384	1085	1065	1065
query2	6204	1998	1967	1967
query3	11022	4565	4520	4520
query4	50741	24420	23066	23066
query5	5315	510	447	447
query6	354	190	196	190
query7	5008	496	276	276
query8	337	251	237	237
query9	6620	2586	2607	2586
query10	438	323	271	271
query11	15397	15174	14835	14835
query12	159	113	107	107
query13	1134	513	403	403
query14	10149	6406	6531	6406
query15	194	194	186	186
query16	6758	668	471	471
query17	1103	747	609	609
query18	1461	402	322	322
query19	198	202	169	169
query20	134	130	125	125
query21	215	127	111	111
query22	4478	4520	4259	4259
query23	33775	33459	33311	33311
query24	6863	2469	2443	2443
query25	508	470	401	401
query26	751	276	150	150
query27	2417	508	356	356
query28	3204	2466	2444	2444
query29	556	539	456	456
query30	275	222	192	192
query31	871	887	788	788
query32	72	64	58	58
query33	480	370	310	310
query34	766	885	520	520
query35	821	849	782	782
query36	965	1007	917	917
query37	117	98	79	79
query38	4178	4140	4300	4140
query39	1499	1469	1434	1434
query40	210	120	111	111
query41	53	52	49	49
query42	120	106	109	106
query43	520	516	505	505
query44	1314	847	824	824
query45	192	171	170	170
query46	838	1068	648	648
query47	1866	1856	1773	1773
query48	388	422	315	315
query49	706	518	439	439
query50	687	697	426	426
query51	4308	4265	4263	4263
query52	112	111	103	103
query53	230	253	187	187
query54	596	598	505	505
query55	84	81	86	81
query56	313	328	295	295
query57	1182	1204	1136	1136
query58	260	265	263	263
query59	2722	2828	2843	2828
query60	334	323	307	307
query61	139	128	126	126
query62	753	730	669	669
query63	227	201	196	196
query64	2269	1053	780	780
query65	4461	4398	4295	4295
query66	768	405	297	297
query67	15818	15593	15359	15359
query68	6911	837	526	526
query69	536	307	274	274
query70	1187	1147	1120	1120
query71	510	309	292	292
query72	5627	4789	4822	4789
query73	1247	619	345	345
query74	9252	8981	8970	8970
query75	3774	3233	2691	2691
query76	4265	1206	765	765
query77	621	365	285	285
query78	9989	10139	9310	9310
query79	1554	819	554	554
query80	609	564	454	454
query81	469	261	218	218
query82	422	126	95	95
query83	396	261	237	237
query84	308	115	90	90
query85	755	356	316	316
query86	366	286	287	286
query87	4360	4472	4399	4399
query88	2858	2253	2245	2245
query89	392	317	277	277
query90	2029	212	219	212
query91	138	144	111	111
query92	75	64	56	56
query93	1206	957	595	595
query94	705	401	370	370
query95	371	297	290	290
query96	488	568	271	271
query97	3169	3264	3064	3064
query98	224	212	208	208
query99	1418	1401	1314	1314
Total cold run time: 294622 ms
Total hot run time: 193494 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.13	0.11	0.10
query3	0.25	0.20	0.19
query4	1.59	0.21	0.20
query5	0.60	0.58	0.59
query6	1.17	0.72	0.73
query7	0.02	0.01	0.02
query8	0.05	0.04	0.03
query9	0.59	0.52	0.52
query10	0.57	0.57	0.58
query11	0.16	0.11	0.10
query12	0.14	0.11	0.11
query13	0.61	0.60	0.60
query14	2.67	2.67	2.80
query15	0.93	0.86	0.86
query16	0.38	0.40	0.39
query17	1.02	1.01	1.03
query18	0.21	0.19	0.20
query19	1.90	1.94	1.90
query20	0.02	0.01	0.01
query21	15.37	0.90	0.53
query22	0.76	1.08	0.61
query23	15.08	1.36	0.62
query24	7.04	2.01	0.88
query25	0.51	0.26	0.05
query26	0.57	0.16	0.13
query27	0.06	0.05	0.04
query28	9.70	0.88	0.43
query29	12.53	4.03	3.38
query30	0.25	0.10	0.07
query31	2.83	0.59	0.38
query32	3.23	0.54	0.46
query33	3.00	3.05	2.99
query34	15.92	5.08	4.52
query35	4.54	4.52	4.51
query36	0.68	0.49	0.48
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.03	0.02	0.02
query40	0.17	0.13	0.12
query41	0.08	0.02	0.03
query42	0.04	0.03	0.02
query43	0.04	0.03	0.02
Total cold run time: 105.62 s
Total hot run time: 31.17 s

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	26249	5305	5142	5142
q2	2070	295	188	188
q3	10370	1238	687	687
q4	10357	1042	551	551
q5	8422	2306	2343	2306
q6	187	174	136	136
q7	939	752	609	609
q8	9318	1275	1158	1158
q9	8047	5168	5268	5168
q10	6985	2360	1969	1969
q11	470	291	276	276
q12	356	361	226	226
q13	19557	3747	3099	3099
q14	241	239	270	239
q15	804	501	496	496
q16	609	629	588	588
q17	778	864	365	365
q18	8505	7214	7213	7213
q19	2052	990	569	569
q20	344	339	229	229
q21	4104	3494	2429	2429
q22	1059	1036	981	981
Total cold run time: 121823 ms
Total hot run time: 34624 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5321	5205	5159	5159
q2	244	329	231	231
q3	2102	2715	2429	2429
q4	1525	1893	1514	1514
q5	4513	4380	4337	4337
q6	224	174	132	132
q7	1961	1960	1761	1761
q8	2645	2479	2578	2479
q9	7013	7198	7049	7049
q10	2997	3222	2796	2796
q11	582	514	491	491
q12	704	770	639	639
q13	3483	3970	3339	3339
q14	301	300	284	284
q15	542	472	476	472
q16	645	691	647	647
q17	1161	1571	1406	1406
q18	7792	7415	7157	7157
q19	781	794	908	794
q20	1980	1999	1933	1933
q21	5281	5105	4973	4973
q22	1095	1050	1015	1015
Total cold run time: 52892 ms
Total hot run time: 51037 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 170289 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 37054317c093c309bdc126d682fe60cd06939409, data reload: false

============================================
query1	1432	1088	1053	1053
query2	6182	1925	1908	1908
query3	11197	4459	4542	4459
query4	query5	5906	496	478	478
query6	390	211	209	209
query7	5033	274	292	274
query8	326	226	218	218
query9	8351	2594	2594	2594
query10	499	318	263	263
query11	15361	15439	14834	14834
query12	151	109	101	101
query13	1121	530	373	373
query14	10289	6251	6287	6251
query15	225	188	173	173
query16	7368	635	491	491
query17	1133	751	599	599
query18	1790	401	305	305
query19	311	196	162	162
query20	131	119	119	119
query21	217	124	105	105
query22	4276	4487	4215	4215
query23	34312	33811	33520	33520
query24	6836	2410	2437	2410
query25	511	489	432	432
query26	716	281	155	155
query27	2536	507	340	340
query28	3042	2542	2432	2432
query29	665	562	427	427
query30	270	219	196	196
query31	944	883	793	793
query32	120	65	57	57
query33	472	368	328	328
query34	759	872	520	520
query35	833	854	763	763
query36	964	1004	879	879
query37	121	110	85	85
query38	4244	4256	4272	4256
query39	1514	1444	1456	1444
query40	210	116	112	112
query41	54	50	50	50
query42	122	107	108	107
query43	526	510	489	489
query44	1366	825	839	825
query45	186	178	170	170
query46	841	1017	639	639
query47	1853	1857	1804	1804
query48	387	403	323	323
query49	697	532	439	439
query50	652	700	405	405
query51	4267	4276	4273	4273
query52	110	105	98	98
query53	221	256	193	193
query54	583	595	523	523
query55	84	82	82	82
query56	345	297	295	295
query57	1169	1180	1128	1128
query58	279	270	262	262
query59	2767	2911	2697	2697
query60	372	346	312	312
query61	135	135	177	135
query62	754	726	678	678
query63	223	188	195	188
query64	2307	1052	708	708
query65	4395	4325	4337	4325
query66	795	411	313	313
query67	16107	15558	15429	15429
query68	6942	881	517	517
query69	528	302	261	261
query70	1175	1092	1144	1092
query71	486	322	307	307
query72	5949	4740	4757	4740
query73	1283	710	345	345
query74	9001	9123	9003	9003
query75	3999	3233	2735	2735
query76	5319	1177	761	761
query77	717	376	284	284
query78	10138	10276	9353	9353
query79	1473	855	569	569
query80	701	513	468	468
query81	500	257	228	228
query82	701	124	95	95
query83	389	250	233	233
query84	287	109	151	109
query85	785	357	321	321
query86	376	323	294	294
query87	4505	4439	4387	4387
query88	3288	2286	2243	2243
query89	397	310	282	282
query90	1787	209	207	207
query91	154	140	108	108
query92	79	63	55	55
query93	1547	956	582	582
query94	635	413	317	317
query95	368	292	288	288
query96	482	559	281	281
query97	3216	3206	3112	3112
query98	256	205	209	205
query99	1430	1419	1284	1284
Total cold run time: 251248 ms
Total hot run time: 170289 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.13	0.10	0.09
query3	0.24	0.20	0.19
query4	1.59	0.19	0.19
query5	0.57	0.57	0.58
query6	1.20	0.71	0.71
query7	0.03	0.02	0.02
query8	0.04	0.03	0.04
query9	0.57	0.52	0.51
query10	0.57	0.59	0.57
query11	0.16	0.11	0.10
query12	0.14	0.12	0.11
query13	0.62	0.60	0.59
query14	2.67	2.69	2.70
query15	0.91	0.84	0.86
query16	0.38	0.39	0.40
query17	1.00	1.07	1.04
query18	0.20	0.19	0.20
query19	1.90	1.92	1.91
query20	0.01	0.01	0.02
query21	15.36	0.96	0.57
query22	0.75	1.12	0.64
query23	15.10	1.39	0.62
query24	6.82	1.91	0.71
query25	0.52	0.19	0.09
query26	0.62	0.16	0.13
query27	0.05	0.05	0.06
query28	10.28	0.88	0.42
query29	12.53	3.93	3.32
query30	0.26	0.09	0.06
query31	2.82	0.59	0.39
query32	3.22	0.55	0.46
query33	2.99	3.08	3.02
query34	15.76	5.13	4.49
query35	4.55	4.54	4.51
query36	0.67	0.50	0.48
query37	0.08	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.02
query40	0.16	0.13	0.13
query41	0.08	0.02	0.02
query42	0.03	0.02	0.02
query43	0.03	0.02	0.02
Total cold run time: 105.73 s
Total hot run time: 31.05 s

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	25914	4978	4947	4947
q2	2077	285	184	184
q3	10386	1237	672	672
q4	10226	1022	551	551
q5	7543	2319	2334	2319
q6	186	163	133	133
q7	923	740	605	605
q8	9310	1248	1087	1087
q9	6833	5168	5132	5132
q10	6805	2311	1883	1883
q11	491	282	267	267
q12	351	356	215	215
q13	17755	3602	3117	3117
q14	237	227	217	217
q15	524	504	488	488
q16	628	635	583	583
q17	585	832	370	370
q18	7459	7151	6990	6990
q19	1555	928	528	528
q20	342	333	226	226
q21	3960	2635	3117	2635
q22	1047	1026	971	971
Total cold run time: 115137 ms
Total hot run time: 34120 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5131	5079	5175	5079
q2	253	337	233	233
q3	2207	2695	2322	2322
q4	1449	1830	1414	1414
q5	4486	4470	4425	4425
q6	225	171	130	130
q7	1990	1931	1803	1803
q8	2611	2714	2602	2602
q9	7392	7327	7223	7223
q10	3028	3170	2756	2756
q11	572	509	504	504
q12	673	764	614	614
q13	3468	3896	3352	3352
q14	275	317	301	301
q15	544	490	491	490
q16	653	683	630	630
q17	1119	1596	1375	1375
q18	7775	7622	7474	7474
q19	796	779	830	779
q20	1896	2040	1866	1866
q21	5340	4809	4693	4693
q22	1108	1086	1031	1031
Total cold run time: 52991 ms
Total hot run time: 51096 ms

@doris-robot
Copy link

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

query1	1397	1045	1044	1044
query2	6063	1949	1914	1914
query3	11158	4563	4714	4563
query4	54027	24209	23296	23296
query5	5068	498	458	458
query6	338	204	193	193
query7	4910	479	279	279
query8	305	233	229	229
query9	5810	2589	2597	2589
query10	446	313	260	260
query11	15086	14996	14931	14931
query12	162	112	107	107
query13	1026	506	368	368
query14	9944	6306	6347	6306
query15	200	194	169	169
query16	7050	671	510	510
query17	1063	724	566	566
query18	1528	393	301	301
query19	194	193	163	163
query20	124	129	119	119
query21	207	125	106	106
query22	4435	4696	4308	4308
query23	34164	33783	33467	33467
query24	6662	2422	2467	2422
query25	488	463	398	398
query26	655	280	153	153
query27	2177	494	337	337
query28	3017	2462	2449	2449
query29	583	554	447	447
query30	277	227	190	190
query31	858	855	787	787
query32	73	64	65	64
query33	470	369	323	323
query34	762	864	520	520
query35	822	822	794	794
query36	968	1028	923	923
query37	127	98	80	80
query38	4152	4233	4099	4099
query39	1511	1434	1442	1434
query40	230	129	112	112
query41	59	57	58	57
query42	131	115	109	109
query43	506	525	493	493
query44	1303	829	830	829
query45	181	178	171	171
query46	844	1022	646	646
query47	1882	1878	1802	1802
query48	378	416	328	328
query49	729	559	444	444
query50	678	698	412	412
query51	4260	4296	4254	4254
query52	122	121	103	103
query53	232	258	192	192
query54	598	600	536	536
query55	87	84	83	83
query56	325	324	319	319
query57	1189	1216	1115	1115
query58	282	276	317	276
query59	2775	2846	2746	2746
query60	330	338	334	334
query61	131	130	127	127
query62	733	733	679	679
query63	225	184	186	184
query64	1447	1009	695	695
query65	4334	4251	4261	4251
query66	707	402	301	301
query67	15805	15606	15214	15214
query68	7512	868	522	522
query69	537	307	275	275
query70	1185	1163	1105	1105
query71	507	317	288	288
query72	6001	4681	4711	4681
query73	1382	593	342	342
query74	9194	8855	8746	8746
query75	3923	3239	2753	2753
query76	4238	1200	822	822
query77	633	359	287	287
query78	9934	10129	9267	9267
query79	2155	826	564	564
query80	714	498	437	437
query81	484	258	233	233
query82	462	125	100	100
query83	382	260	234	234
query84	299	107	81	81
query85	778	356	307	307
query86	388	321	306	306
query87	4480	4646	4421	4421
query88	3755	2259	2253	2253
query89	473	317	283	283
query90	1800	209	208	208
query91	146	145	119	119
query92	77	60	53	53
query93	1780	951	573	573
query94	666	407	298	298
query95	364	295	281	281
query96	486	564	275	275
query97	3161	3276	3158	3158
query98	240	200	202	200
query99	1453	1371	1308	1308
Total cold run time: 298399 ms
Total hot run time: 193258 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.12	0.11	0.11
query3	0.25	0.19	0.19
query4	1.59	0.17	0.20
query5	0.59	0.57	0.60
query6	1.19	0.72	0.71
query7	0.02	0.02	0.02
query8	0.04	0.03	0.03
query9	0.58	0.52	0.52
query10	0.61	0.59	0.56
query11	0.15	0.11	0.11
query12	0.16	0.12	0.12
query13	0.61	0.60	0.62
query14	2.77	2.70	2.70
query15	0.92	0.85	0.85
query16	0.37	0.38	0.38
query17	1.03	1.05	1.04
query18	0.22	0.20	0.19
query19	1.91	1.96	1.84
query20	0.01	0.01	0.02
query21	15.35	0.92	0.55
query22	0.74	1.30	0.75
query23	14.72	1.37	0.62
query24	7.12	1.61	0.57
query25	0.46	0.20	0.07
query26	0.61	0.16	0.14
query27	0.05	0.05	0.05
query28	9.60	0.88	0.43
query29	12.51	3.95	3.25
query30	0.24	0.10	0.07
query31	2.82	0.58	0.38
query32	3.22	0.55	0.48
query33	3.04	3.08	3.08
query34	15.87	5.17	4.50
query35	4.54	4.58	4.50
query36	0.68	0.50	0.49
query37	0.08	0.06	0.06
query38	0.05	0.04	0.04
query39	0.04	0.02	0.02
query40	0.17	0.14	0.14
query41	0.08	0.02	0.02
query42	0.03	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 105.23 s
Total hot run time: 31.01 s

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	26137	5243	5017	5017
q2	2084	270	187	187
q3	10399	1242	678	678
q4	10222	999	529	529
q5	7552	2401	2336	2336
q6	184	163	132	132
q7	914	747	621	621
q8	9340	1315	1134	1134
q9	7319	5165	5173	5165
q10	6871	2344	1941	1941
q11	493	291	273	273
q12	362	365	221	221
q13	17779	3677	3085	3085
q14	231	226	216	216
q15	527	487	487	487
q16	653	625	606	606
q17	577	861	352	352
q18	7554	7151	7045	7045
q19	1405	955	548	548
q20	321	338	214	214
q21	4013	3359	2404	2404
q22	1022	1003	969	969
Total cold run time: 115959 ms
Total hot run time: 34160 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5099	5185	5073	5073
q2	235	326	226	226
q3	2129	2667	2258	2258
q4	1425	1818	1442	1442
q5	4451	4418	4369	4369
q6	222	169	127	127
q7	1990	1893	1724	1724
q8	2584	2657	2518	2518
q9	7285	7127	7212	7127
q10	3008	3152	2720	2720
q11	590	527	483	483
q12	686	773	589	589
q13	3533	3913	3318	3318
q14	277	295	275	275
q15	542	483	481	481
q16	666	715	659	659
q17	1147	1609	1378	1378
q18	7653	7554	7468	7468
q19	791	768	845	768
q20	1910	1963	1880	1880
q21	5238	4928	4823	4823
q22	1095	1062	995	995
Total cold run time: 52556 ms
Total hot run time: 50701 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 193383 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 5943c39f315bc3ac279a7aa1fd1cecc551b414db, data reload: false

query1	1411	1083	1072	1072
query2	6191	1893	1892	1892
query3	11013	4266	4395	4266
query4	52736	25438	23560	23560
query5	5155	537	445	445
query6	338	198	212	198
query7	4918	517	285	285
query8	339	284	240	240
query9	5854	2622	2627	2622
query10	426	330	275	275
query11	15102	15008	15051	15008
query12	165	113	107	107
query13	1045	505	392	392
query14	10057	6355	6411	6355
query15	212	189	177	177
query16	6986	691	515	515
query17	1088	754	621	621
query18	1543	417	331	331
query19	222	195	182	182
query20	131	132	131	131
query21	219	123	106	106
query22	4322	4523	4277	4277
query23	34393	33668	33692	33668
query24	6626	2439	2467	2439
query25	473	467	411	411
query26	735	276	158	158
query27	2361	495	329	329
query28	3475	2454	2441	2441
query29	581	585	432	432
query30	273	225	190	190
query31	874	834	798	798
query32	76	68	66	66
query33	495	361	302	302
query34	766	897	540	540
query35	797	847	763	763
query36	958	1004	895	895
query37	125	102	79	79
query38	4339	4322	4182	4182
query39	1540	1449	1431	1431
query40	207	124	110	110
query41	55	55	51	51
query42	131	109	108	108
query43	519	523	477	477
query44	1361	819	823	819
query45	184	175	169	169
query46	843	1040	641	641
query47	1814	1864	1748	1748
query48	384	419	320	320
query49	686	505	414	414
query50	679	692	407	407
query51	4333	4264	4196	4196
query52	107	108	99	99
query53	229	283	186	186
query54	593	587	540	540
query55	86	85	83	83
query56	305	308	292	292
query57	1169	1188	1108	1108
query58	266	252	281	252
query59	2706	2803	2684	2684
query60	339	315	304	304
query61	130	133	131	131
query62	752	760	675	675
query63	225	188	200	188
query64	1749	1027	677	677
query65	4342	4293	4269	4269
query66	758	400	305	305
query67	15746	15687	15505	15505
query68	7274	886	521	521
query69	536	317	269	269
query70	1222	1129	1099	1099
query71	525	330	277	277
query72	5569	4747	4649	4649
query73	1314	592	344	344
query74	9247	8862	8647	8647
query75	3997	3216	2701	2701
query76	4329	1209	755	755
query77	648	379	285	285
query78	9975	10094	9220	9220
query79	2378	812	555	555
query80	606	522	435	435
query81	487	341	224	224
query82	441	123	98	98
query83	338	249	237	237
query84	293	109	86	86
query85	785	351	315	315
query86	358	304	274	274
query87	4418	4481	4473	4473
query88	3350	2231	2247	2231
query89	405	319	347	319
query90	1949	215	219	215
query91	153	147	111	111
query92	70	63	58	58
query93	1132	952	574	574
query94	677	419	308	308
query95	365	288	287	287
query96	484	558	272	272
query97	3146	3224	3161	3161
query98	230	196	205	196
query99	1473	1390	1248	1248
Total cold run time: 297232 ms
Total hot run time: 193383 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.12	0.10	0.11
query3	0.25	0.20	0.20
query4	1.59	0.20	0.19
query5	0.59	0.61	0.59
query6	1.18	0.72	0.73
query7	0.03	0.02	0.02
query8	0.04	0.03	0.03
query9	0.58	0.53	0.53
query10	0.56	0.58	0.56
query11	0.16	0.10	0.10
query12	0.15	0.12	0.11
query13	0.62	0.60	0.60
query14	2.72	2.71	2.82
query15	0.95	0.86	0.84
query16	0.38	0.38	0.38
query17	1.00	1.01	1.03
query18	0.21	0.20	0.20
query19	1.89	2.02	1.84
query20	0.01	0.01	0.02
query21	15.38	0.89	0.54
query22	0.74	1.24	0.70
query23	14.86	1.37	0.63
query24	6.65	1.00	0.97
query25	0.51	0.10	0.06
query26	0.62	0.17	0.14
query27	0.06	0.05	0.05
query28	9.46	0.86	0.45
query29	12.58	3.97	3.34
query30	0.25	0.09	0.07
query31	2.82	0.59	0.40
query32	3.22	0.54	0.47
query33	3.04	3.08	3.01
query34	15.88	5.08	4.50
query35	4.54	4.54	4.50
query36	0.70	0.51	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.17	0.13	0.13
query41	0.09	0.03	0.03
query42	0.04	0.03	0.02
query43	0.03	0.04	0.03
Total cold run time: 104.88 s
Total hot run time: 31.42 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.46% (14104/26883)
Line Coverage 41.26% (121896/295452)
Region Coverage 40.02% (62081/155128)
Branch Coverage 34.67% (31080/89652)

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

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

@morningman morningman merged commit 81fc37d into apache:master Apr 16, 2025
31 of 32 checks passed
seawinde pushed a commit to seawinde/doris that referenced this pull request Apr 17, 2025
### What problem does this PR solve?

1.
In apache#49036, we only support hive serde dialect in BE side.
But some constant expr will be evaluated and output in FE side, need to
support it too.

2.
Refactor the method of getting string format value for all type of
literals in FE side.

There are 2 kind of string format value for literal. One is for Query,
the other is for Stream Load.
Here is some difference:

- NullLiteral
    For query, it should be `null`. For load, it should be `\N`.

- StructLiteral
For query, it should be `{"k1":"v1", "k2":null, "k3":"", "k4":"a"}`. For
load, it should be `{"v1", null, "", "a"}`

So we need 2 different methods to distinguish them:
`getStringValueForQuery` and `getStringValueForStreamLoad`.
And I removed or renamed some old and messy methods.

**Exmples**

- `Doris/Hive/Presto` means when setting `serde_dialect` to these types,
the format of query result for different column types.
- `Stream Load ` means what format should be like in csv format when
loading to the table

| Type | Doris | Hive | Presto | Stream Load | Comment |
| --- | --- | --- | --- | --- | --- |
| Bool | `1`, `0` | `1`, `0` | `1`, `0` | `1|0`, `true|false` ||
| Integer | `1`, `1000` | `1`, `1000` | `1`, `1000` | `1|1000` | |
| Float/Decimal | `1.2`, `3.00` | `1.2`, `3.00` | `1.2`, `3.00` |
`1.2|3.00` | |
| Date/Datetime | `2025-01-01`, `2025-01-01 10:11:11` | `2025-01-01`,
`2025-01-01 10:11:11` | `2025-01-01`, `2025-01-01 10:11:11` |
`2025-01-01|2025-01-01 10:11:11` | |
| String | `abc`, `中国` | `abc`, `中国` | `abc`, `中国` | `abc,中国` | |
| Null | `null` | `null` | `NULL` | `\N` ||
| Array<bool> | `[1, 0]` | `[true,false]` | `[1, 0]` | `[1, 0]`, `[true,
false]` ||
| Array<int> | `[1, 1000]` | `[1,1000]` | `[1, 1000]` | `[1, 1000]` ||
| Array<string> | `["abc", "中国"]` | `["abc","中国"]` | `["abc", "中国"]` |
`["abc", "中国"]` | |
| Array<date/datetime> | `["2025-01-01", "2025-01-01 10:11:11"]` |
`["2025-01-01","2025-01-01 10:11:11"]` | `["2025-01-01", "2025-01-01
10:11:11"]` | `["2025-01-01", "2025-01-01 10:11:11"]` ||
| Array<null> | `[null]` | `[null]` | `[NULL]` | `[null]` | |
| Map<int, string> | `{1:"abc", 2:"中国"}` |`{1:"abc",2:"中国"}` |`{1=abc,
2=中国}` | `{1:"abc", 2:"中国"}` | |
| Map<string, date/datetime> | `{"k1":"2022-10-01", "k2":"2022-10-01
10:10:10"}` | `{"k1":"2022-10-01","k2":"2022-10-01 10:10:10"}` |
`{k1=2022-10-01, k2=2022-10-01 10:10:10}` | `{"k1":"2022-10-01",
"k2":"2022-10-01 10:10:10"}` | |
| Map<int, null> | `{1:null, 2:null}` | `{1:null,2:null}` | `{1=NULL,
2=NULL}` | `{1:null, 2:null}` | |
| Struct<> | Same as map | Same as map | Same as map | Same as map | |


3. Fix a bug that for batch insert transaction, the `trim_double_quotas`
should be set to false
@morningman morningman added the usercase Important user case type label label May 14, 2025
morningman added a commit to morningman/doris that referenced this pull request May 14, 2025
1.
In apache#49036, we only support hive serde dialect in BE side.
But some constant expr will be evaluated and output in FE side, need to
support it too.

2.
Refactor the method of getting string format value for all type of
literals in FE side.

There are 2 kind of string format value for literal. One is for Query,
the other is for Stream Load.
Here is some difference:

- NullLiteral
    For query, it should be `null`. For load, it should be `\N`.

- StructLiteral
For query, it should be `{"k1":"v1", "k2":null, "k3":"", "k4":"a"}`. For
load, it should be `{"v1", null, "", "a"}`

So we need 2 different methods to distinguish them:
`getStringValueForQuery` and `getStringValueForStreamLoad`.
And I removed or renamed some old and messy methods.

**Exmples**

- `Doris/Hive/Presto` means when setting `serde_dialect` to these types,
the format of query result for different column types.
- `Stream Load ` means what format should be like in csv format when
loading to the table

| Type | Doris | Hive | Presto | Stream Load | Comment |
| --- | --- | --- | --- | --- | --- |
| Bool | `1`, `0` | `1`, `0` | `1`, `0` | `1|0`, `true|false` ||
| Integer | `1`, `1000` | `1`, `1000` | `1`, `1000` | `1|1000` | |
| Float/Decimal | `1.2`, `3.00` | `1.2`, `3.00` | `1.2`, `3.00` |
`1.2|3.00` | |
| Date/Datetime | `2025-01-01`, `2025-01-01 10:11:11` | `2025-01-01`,
`2025-01-01 10:11:11` | `2025-01-01`, `2025-01-01 10:11:11` |
`2025-01-01|2025-01-01 10:11:11` | |
| String | `abc`, `中国` | `abc`, `中国` | `abc`, `中国` | `abc,中国` | |
| Null | `null` | `null` | `NULL` | `\N` ||
| Array<bool> | `[1, 0]` | `[true,false]` | `[1, 0]` | `[1, 0]`, `[true,
false]` ||
| Array<int> | `[1, 1000]` | `[1,1000]` | `[1, 1000]` | `[1, 1000]` ||
| Array<string> | `["abc", "中国"]` | `["abc","中国"]` | `["abc", "中国"]` |
`["abc", "中国"]` | |
| Array<date/datetime> | `["2025-01-01", "2025-01-01 10:11:11"]` |
`["2025-01-01","2025-01-01 10:11:11"]` | `["2025-01-01", "2025-01-01
10:11:11"]` | `["2025-01-01", "2025-01-01 10:11:11"]` ||
| Array<null> | `[null]` | `[null]` | `[NULL]` | `[null]` | |
| Map<int, string> | `{1:"abc", 2:"中国"}` |`{1:"abc",2:"中国"}` |`{1=abc,
2=中国}` | `{1:"abc", 2:"中国"}` | |
| Map<string, date/datetime> | `{"k1":"2022-10-01", "k2":"2022-10-01
10:10:10"}` | `{"k1":"2022-10-01","k2":"2022-10-01 10:10:10"}` |
`{k1=2022-10-01, k2=2022-10-01 10:10:10}` | `{"k1":"2022-10-01",
"k2":"2022-10-01 10:10:10"}` | |
| Map<int, null> | `{1:null, 2:null}` | `{1:null,2:null}` | `{1=NULL,
2=NULL}` | `{1:null, 2:null}` | |
| Struct<> | Same as map | Same as map | Same as map | Same as map | |

3. Fix a bug that for batch insert transaction, the `trim_double_quotas`
should be set to false
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
### What problem does this PR solve?

1.
In apache#49036, we only support hive serde dialect in BE side.
But some constant expr will be evaluated and output in FE side, need to
support it too.

2.
Refactor the method of getting string format value for all type of
literals in FE side.

There are 2 kind of string format value for literal. One is for Query,
the other is for Stream Load.
Here is some difference:

- NullLiteral
    For query, it should be `null`. For load, it should be `\N`.

- StructLiteral
For query, it should be `{"k1":"v1", "k2":null, "k3":"", "k4":"a"}`. For
load, it should be `{"v1", null, "", "a"}`

So we need 2 different methods to distinguish them:
`getStringValueForQuery` and `getStringValueForStreamLoad`.
And I removed or renamed some old and messy methods.

**Exmples**

- `Doris/Hive/Presto` means when setting `serde_dialect` to these types,
the format of query result for different column types.
- `Stream Load ` means what format should be like in csv format when
loading to the table

| Type | Doris | Hive | Presto | Stream Load | Comment |
| --- | --- | --- | --- | --- | --- |
| Bool | `1`, `0` | `1`, `0` | `1`, `0` | `1|0`, `true|false` ||
| Integer | `1`, `1000` | `1`, `1000` | `1`, `1000` | `1|1000` | |
| Float/Decimal | `1.2`, `3.00` | `1.2`, `3.00` | `1.2`, `3.00` |
`1.2|3.00` | |
| Date/Datetime | `2025-01-01`, `2025-01-01 10:11:11` | `2025-01-01`,
`2025-01-01 10:11:11` | `2025-01-01`, `2025-01-01 10:11:11` |
`2025-01-01|2025-01-01 10:11:11` | |
| String | `abc`, `中国` | `abc`, `中国` | `abc`, `中国` | `abc,中国` | |
| Null | `null` | `null` | `NULL` | `\N` ||
| Array<bool> | `[1, 0]` | `[true,false]` | `[1, 0]` | `[1, 0]`, `[true,
false]` ||
| Array<int> | `[1, 1000]` | `[1,1000]` | `[1, 1000]` | `[1, 1000]` ||
| Array<string> | `["abc", "中国"]` | `["abc","中国"]` | `["abc", "中国"]` |
`["abc", "中国"]` | |
| Array<date/datetime> | `["2025-01-01", "2025-01-01 10:11:11"]` |
`["2025-01-01","2025-01-01 10:11:11"]` | `["2025-01-01", "2025-01-01
10:11:11"]` | `["2025-01-01", "2025-01-01 10:11:11"]` ||
| Array<null> | `[null]` | `[null]` | `[NULL]` | `[null]` | |
| Map<int, string> | `{1:"abc", 2:"中国"}` |`{1:"abc",2:"中国"}` |`{1=abc,
2=中国}` | `{1:"abc", 2:"中国"}` | |
| Map<string, date/datetime> | `{"k1":"2022-10-01", "k2":"2022-10-01
10:10:10"}` | `{"k1":"2022-10-01","k2":"2022-10-01 10:10:10"}` |
`{k1=2022-10-01, k2=2022-10-01 10:10:10}` | `{"k1":"2022-10-01",
"k2":"2022-10-01 10:10:10"}` | |
| Map<int, null> | `{1:null, 2:null}` | `{1:null,2:null}` | `{1=NULL,
2=NULL}` | `{1:null, 2:null}` | |
| Struct<> | Same as map | Same as map | Same as map | Same as map | |


3. Fix a bug that for batch insert transaction, the `trim_double_quotas`
should be set to false
@gavinchou gavinchou mentioned this pull request Jun 11, 2025
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.0.6-merged reviewed usercase Important user case type label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants