Skip to content

Conversation

@bobhan1
Copy link
Contributor

@bobhan1 bobhan1 commented Aug 28, 2024

Proposed changes

  1. [Fix](partial update) Fix rowset not found error when doing partial update #34112 let partial update fetch rowsets in the initialization of RowsetBuilder rather than flush phase. So we can remove that tablet header lock.
  2. refactor some partial update code

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

@bobhan1 bobhan1 force-pushed the remove-lock-for-mow branch from 3fd1a57 to bc3a640 Compare August 28, 2024 10:51
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@github-actions
Copy link
Contributor

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

@bobhan1 bobhan1 force-pushed the remove-lock-for-mow branch from bc3a640 to 1abde8f Compare August 28, 2024 10:59
@github-actions
Copy link
Contributor

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

@bobhan1 bobhan1 force-pushed the remove-lock-for-mow branch from 1abde8f to b2f13cd Compare August 28, 2024 11:11
@github-actions
Copy link
Contributor

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

@bobhan1 bobhan1 force-pushed the remove-lock-for-mow branch from 6142029 to 4de5d7d Compare August 28, 2024 11:22
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@bobhan1
Copy link
Contributor Author

bobhan1 commented Aug 28, 2024

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18278	4621	4468	4468
q2	2719	189	175	175
q3	11122	1166	1181	1166
q4	10575	771	778	771
q5	8163	2932	2848	2848
q6	235	141	146	141
q7	977	631	603	603
q8	9325	2085	2128	2085
q9	7044	6573	6579	6573
q10	7017	2159	2208	2159
q11	448	248	250	248
q12	399	229	230	229
q13	17776	3062	3048	3048
q14	269	246	238	238
q15	522	489	495	489
q16	567	510	494	494
q17	992	690	779	690
q18	7498	6830	6922	6830
q19	1390	969	919	919
q20	707	348	347	347
q21	3873	2998	3051	2998
q22	1139	1006	1027	1006
Total cold run time: 111035 ms
Total hot run time: 38525 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4372	4321	4341	4321
q2	372	284	281	281
q3	2865	2675	2637	2637
q4	1894	1719	1670	1670
q5	5389	5392	5371	5371
q6	223	136	134	134
q7	2135	1762	1727	1727
q8	3256	3367	3346	3346
q9	8460	8459	8435	8435
q10	3477	3235	3221	3221
q11	606	519	497	497
q12	791	627	607	607
q13	12007	3061	3059	3059
q14	319	273	288	273
q15	519	482	487	482
q16	609	570	566	566
q17	1799	1507	1494	1494
q18	7711	7585	7476	7476
q19	1699	1499	1551	1499
q20	2066	1814	1803	1803
q21	5433	5308	5193	5193
q22	1103	1068	1046	1046
Total cold run time: 67105 ms
Total hot run time: 55138 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 188501 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 4de5d7de9fe61459bc3fbff7407104467e2a1fb9, data reload: false

query1	915	396	373	373
query2	6466	2041	1921	1921
query3	6648	214	220	214
query4	28981	23186	23167	23167
query5	4213	499	495	495
query6	255	166	180	166
query7	4586	297	293	293
query8	259	206	206	206
query9	8505	2506	2495	2495
query10	444	269	264	264
query11	17959	15040	15219	15040
query12	151	104	100	100
query13	1635	381	388	381
query14	11703	7493	6937	6937
query15	274	178	178	178
query16	7472	462	484	462
query17	1597	581	567	567
query18	1290	284	288	284
query19	283	145	148	145
query20	117	109	107	107
query21	215	107	103	103
query22	4478	4333	4164	4164
query23	34209	33517	33614	33517
query24	11200	2896	2828	2828
query25	611	403	383	383
query26	1180	162	167	162
query27	2696	288	283	283
query28	7376	2144	2128	2128
query29	768	413	417	413
query30	318	162	152	152
query31	971	773	784	773
query32	103	59	61	59
query33	764	301	296	296
query34	946	500	486	486
query35	876	737	707	707
query36	1089	943	952	943
query37	162	97	100	97
query38	4069	3757	3870	3757
query39	1441	1380	1371	1371
query40	205	120	120	120
query41	50	51	46	46
query42	116	100	102	100
query43	534	478	484	478
query44	1255	773	765	765
query45	202	170	170	170
query46	1111	756	763	756
query47	1870	1807	1819	1807
query48	378	310	289	289
query49	1087	427	419	419
query50	801	417	415	415
query51	7181	7122	7101	7101
query52	102	90	92	90
query53	260	192	183	183
query54	876	461	465	461
query55	78	80	78	78
query56	298	257	255	255
query57	1197	1051	1074	1051
query58	224	227	243	227
query59	3172	2714	2937	2714
query60	301	269	269	269
query61	100	98	101	98
query62	814	663	654	654
query63	227	189	189	189
query64	4381	670	685	670
query65	3241	3148	3184	3148
query66	1082	342	334	334
query67	15515	15258	15427	15258
query68	3505	588	575	575
query69	399	287	276	276
query70	1134	1058	1133	1058
query71	343	287	274	274
query72	6362	4019	3986	3986
query73	743	337	340	337
query74	9140	8936	9217	8936
query75	3402	2736	2698	2698
query76	1841	1010	933	933
query77	481	325	328	325
query78	9636	9856	9193	9193
query79	1072	561	554	554
query80	700	519	524	519
query81	463	237	233	233
query82	257	153	148	148
query83	174	161	163	161
query84	237	81	80	80
query85	741	352	279	279
query86	295	303	284	284
query87	4506	4274	4207	4207
query88	3009	2332	2334	2332
query89	395	288	290	288
query90	1876	204	203	203
query91	126	102	102	102
query92	62	52	51	51
query93	1041	564	548	548
query94	781	294	314	294
query95	363	275	269	269
query96	592	264	274	264
query97	3234	3073	3083	3073
query98	225	205	205	205
query99	1466	1254	1284	1254
Total cold run time: 282484 ms
Total hot run time: 188501 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.04
query2	0.07	0.04	0.04
query3	0.23	0.04	0.04
query4	1.69	0.07	0.07
query5	0.51	0.49	0.50
query6	1.13	0.73	0.73
query7	0.02	0.01	0.01
query8	0.05	0.04	0.04
query9	0.55	0.49	0.49
query10	0.55	0.54	0.54
query11	0.16	0.12	0.11
query12	0.16	0.12	0.13
query13	0.61	0.59	0.59
query14	2.10	2.05	2.05
query15	0.89	0.83	0.82
query16	0.38	0.38	0.36
query17	1.03	1.07	1.06
query18	0.21	0.21	0.20
query19	1.83	1.85	1.73
query20	0.01	0.01	0.00
query21	15.42	0.68	0.66
query22	3.70	7.06	2.71
query23	18.26	1.40	1.32
query24	2.16	0.25	0.23
query25	0.17	0.10	0.09
query26	0.27	0.17	0.18
query27	0.09	0.09	0.09
query28	13.30	1.02	1.00
query29	12.62	3.40	3.34
query30	0.24	0.06	0.05
query31	2.88	0.40	0.38
query32	3.26	0.48	0.49
query33	2.98	2.97	3.01
query34	17.03	4.43	4.40
query35	4.45	4.43	4.59
query36	0.65	0.47	0.50
query37	0.20	0.16	0.15
query38	0.17	0.16	0.15
query39	0.05	0.04	0.03
query40	0.15	0.13	0.13
query41	0.10	0.04	0.05
query42	0.06	0.05	0.05
query43	0.05	0.05	0.04
Total cold run time: 110.49 s
Total hot run time: 32.91 s

@bobhan1 bobhan1 force-pushed the remove-lock-for-mow branch from 4de5d7d to 08d1be0 Compare August 29, 2024 01:59
@bobhan1
Copy link
Contributor Author

bobhan1 commented Aug 29, 2024

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17614	4499	4312	4312
q2	2030	186	174	174
q3	11883	951	1072	951
q4	10526	721	718	718
q5	7789	2846	2826	2826
q6	229	139	135	135
q7	962	640	605	605
q8	9330	2071	2094	2071
q9	7298	6575	6563	6563
q10	7006	2250	2211	2211
q11	441	238	238	238
q12	418	221	224	221
q13	18020	3050	3016	3016
q14	282	238	234	234
q15	511	475	489	475
q16	586	507	516	507
q17	981	717	736	717
q18	7443	6816	6960	6816
q19	1392	986	952	952
q20	706	328	328	328
q21	4125	2874	3079	2874
q22	1117	1019	995	995
Total cold run time: 110689 ms
Total hot run time: 37939 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4374	4293	4292	4292
q2	380	276	272	272
q3	2864	2599	2648	2599
q4	1934	1630	1643	1630
q5	5613	5662	5697	5662
q6	248	142	134	134
q7	2241	1790	1783	1783
q8	3327	3399	3407	3399
q9	8849	8871	8818	8818
q10	3590	3375	3359	3359
q11	613	551	506	506
q12	817	681	687	681
q13	15175	3154	3202	3154
q14	322	298	283	283
q15	534	496	484	484
q16	660	568	574	568
q17	1867	1529	1527	1527
q18	8205	7832	7896	7832
q19	1726	1706	1559	1559
q20	2183	1863	1881	1863
q21	5800	5455	5744	5455
q22	1141	1039	1033	1033
Total cold run time: 72463 ms
Total hot run time: 56893 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192279 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 08d1be00f28368fb61307577bc5db894a0109c97, data reload: false

query1	1257	875	850	850
query2	6312	2006	1981	1981
query3	10665	4047	3834	3834
query4	59386	25580	23065	23065
query5	5338	505	499	499
query6	398	175	158	158
query7	5772	302	301	301
query8	288	218	216	216
query9	9136	2528	2510	2510
query10	513	280	279	279
query11	18269	15037	15424	15037
query12	162	109	102	102
query13	1584	418	409	409
query14	11275	7340	6729	6729
query15	268	168	178	168
query16	7580	465	486	465
query17	1144	562	568	562
query18	2051	301	290	290
query19	309	145	148	145
query20	113	109	108	108
query21	206	105	102	102
query22	4527	4380	4459	4380
query23	34260	33251	33400	33251
query24	5964	2905	2825	2825
query25	513	375	368	368
query26	685	154	157	154
query27	1785	286	281	281
query28	3796	2121	2108	2108
query29	646	404	410	404
query30	236	156	157	156
query31	924	739	747	739
query32	82	55	57	55
query33	452	289	283	283
query34	868	489	502	489
query35	840	739	706	706
query36	1112	904	934	904
query37	144	87	96	87
query38	3916	3828	3878	3828
query39	1424	1537	1397	1397
query40	203	119	115	115
query41	47	45	45	45
query42	113	98	98	98
query43	500	465	468	465
query44	1099	760	763	760
query45	195	167	168	167
query46	1099	755	774	755
query47	1917	1812	1835	1812
query48	378	301	298	298
query49	777	437	451	437
query50	856	432	426	426
query51	7224	7161	7076	7076
query52	98	87	88	87
query53	254	183	186	183
query54	566	447	451	447
query55	78	76	80	76
query56	281	255	264	255
query57	1192	1078	1065	1065
query58	227	229	222	222
query59	2998	2889	2876	2876
query60	294	276	286	276
query61	104	105	99	99
query62	740	630	663	630
query63	221	191	189	189
query64	2873	677	671	671
query65	3267	3160	3129	3129
query66	680	342	339	339
query67	15369	15368	15208	15208
query68	2988	575	589	575
query69	405	281	270	270
query70	1173	1111	1133	1111
query71	349	283	277	277
query72	5481	3970	3966	3966
query73	756	334	340	334
query74	9084	8944	9020	8944
query75	3336	2665	2680	2665
query76	1400	1001	1000	1000
query77	530	316	322	316
query78	10895	9347	9035	9035
query79	1040	551	532	532
query80	694	528	538	528
query81	546	241	235	235
query82	291	145	153	145
query83	171	148	146	146
query84	269	77	80	77
query85	689	291	286	286
query86	318	293	303	293
query87	4465	4342	4282	4282
query88	2934	2354	2313	2313
query89	388	287	287	287
query90	2002	199	198	198
query91	129	103	103	103
query92	65	55	53	53
query93	1048	553	545	545
query94	682	299	378	299
query95	342	263	269	263
query96	604	273	286	273
query97	3189	3040	3068	3040
query98	216	199	200	199
query99	1686	1258	1274	1258
Total cold run time: 306015 ms
Total hot run time: 192279 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.04
query2	0.08	0.05	0.05
query3	0.23	0.05	0.04
query4	1.67	0.08	0.07
query5	0.50	0.51	0.50
query6	1.12	0.73	0.73
query7	0.01	0.01	0.01
query8	0.06	0.05	0.04
query9	0.55	0.50	0.49
query10	0.54	0.53	0.55
query11	0.16	0.12	0.13
query12	0.16	0.13	0.12
query13	0.61	0.59	0.58
query14	2.02	2.12	2.11
query15	0.90	0.83	0.82
query16	0.38	0.38	0.38
query17	1.06	0.96	1.05
query18	0.21	0.20	0.21
query19	1.92	1.80	1.87
query20	0.01	0.01	0.01
query21	15.39	0.67	0.66
query22	4.13	7.21	2.02
query23	18.27	1.37	1.21
query24	2.18	0.22	0.22
query25	0.14	0.08	0.09
query26	0.28	0.18	0.18
query27	0.08	0.09	0.07
query28	13.22	1.02	0.99
query29	12.60	3.36	3.37
query30	0.24	0.06	0.05
query31	2.87	0.40	0.38
query32	3.26	0.47	0.47
query33	2.95	2.96	3.02
query34	17.17	4.45	4.38
query35	4.42	4.37	4.39
query36	0.65	0.47	0.48
query37	0.19	0.16	0.15
query38	0.17	0.15	0.15
query39	0.05	0.04	0.04
query40	0.16	0.13	0.12
query41	0.09	0.05	0.05
query42	0.06	0.05	0.05
query43	0.04	0.04	0.04
Total cold run time: 110.85 s
Total hot run time: 32.07 s

@bobhan1 bobhan1 force-pushed the remove-lock-for-mow branch from 08d1be0 to 996aa53 Compare August 29, 2024 05:30
@bobhan1
Copy link
Contributor Author

bobhan1 commented Aug 29, 2024

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17642	4426	4373	4373
q2	2027	202	187	187
q3	11670	995	1123	995
q4	10522	859	728	728
q5	7833	2920	2858	2858
q6	231	145	139	139
q7	973	628	619	619
q8	9320	2148	2087	2087
q9	7285	6565	6626	6565
q10	7043	2164	2190	2164
q11	465	232	237	232
q12	398	226	237	226
q13	17938	3028	3005	3005
q14	286	244	238	238
q15	518	486	500	486
q16	566	545	525	525
q17	988	673	658	658
q18	7433	6805	6807	6805
q19	1391	1057	1094	1057
q20	698	331	340	331
q21	3970	2924	3037	2924
q22	1110	1004	1035	1004
Total cold run time: 110307 ms
Total hot run time: 38206 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4382	4304	4317	4304
q2	389	280	274	274
q3	2915	2674	2684	2674
q4	1917	1666	1659	1659
q5	5679	5738	5775	5738
q6	233	138	138	138
q7	2257	1845	1834	1834
q8	3347	3463	3493	3463
q9	8916	8879	8877	8877
q10	3612	3441	3381	3381
q11	602	508	539	508
q12	863	659	655	655
q13	14084	3278	3194	3194
q14	337	298	295	295
q15	544	499	489	489
q16	635	571	591	571
q17	1878	1544	1547	1544
q18	8187	7809	7805	7805
q19	1740	1562	1571	1562
q20	2216	1981	1892	1892
q21	5700	5631	5510	5510
q22	1184	1101	1039	1039
Total cold run time: 71617 ms
Total hot run time: 57406 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 193179 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 996aa53fad07995e33b0d0b1b62bc569ff26562b, data reload: false

query1	1242	875	853	853
query2	6279	1927	1919	1919
query3	10624	3967	3974	3967
query4	59445	26979	23287	23287
query5	5422	501	506	501
query6	402	163	192	163
query7	5785	298	296	296
query8	291	215	206	206
query9	9073	2507	2508	2507
query10	494	268	254	254
query11	15786	14950	15233	14950
query12	156	116	106	106
query13	1607	386	375	375
query14	11145	7355	6506	6506
query15	248	176	187	176
query16	7617	479	462	462
query17	1157	587	595	587
query18	2062	306	319	306
query19	286	162	145	145
query20	116	123	121	121
query21	208	106	108	106
query22	4671	4516	4545	4516
query23	34530	33676	33305	33305
query24	5928	2904	2881	2881
query25	545	384	385	384
query26	694	159	158	158
query27	1777	289	292	289
query28	3801	2150	2125	2125
query29	694	407	406	406
query30	238	151	160	151
query31	953	746	749	746
query32	82	51	58	51
query33	484	294	282	282
query34	872	486	487	486
query35	830	731	709	709
query36	1074	940	946	940
query37	152	96	98	96
query38	4001	3843	3852	3843
query39	1629	1412	1419	1412
query40	206	119	120	119
query41	49	50	47	47
query42	113	97	102	97
query43	505	479	469	469
query44	1121	759	765	759
query45	205	171	171	171
query46	1106	754	778	754
query47	1928	1819	1840	1819
query48	380	301	291	291
query49	768	443	453	443
query50	819	422	415	415
query51	7117	7077	7133	7077
query52	103	90	90	90
query53	259	183	183	183
query54	585	458	460	458
query55	81	77	82	77
query56	282	275	262	262
query57	1186	1112	1085	1085
query58	248	240	242	240
query59	3188	2852	2747	2747
query60	306	282	299	282
query61	124	121	119	119
query62	779	658	660	658
query63	227	187	196	187
query64	2918	778	800	778
query65	3235	3157	3182	3157
query66	696	356	349	349
query67	15369	15336	15466	15336
query68	3251	615	603	603
query69	411	293	289	289
query70	1157	1083	1069	1069
query71	379	288	281	281
query72	6475	4281	4281	4281
query73	758	332	332	332
query74	9173	8866	8968	8866
query75	3393	2666	2711	2666
query76	1461	1027	1092	1027
query77	554	327	320	320
query78	11297	9541	9088	9088
query79	1774	541	532	532
query80	996	533	502	502
query81	561	234	241	234
query82	656	147	149	147
query83	259	153	150	150
query84	269	76	76	76
query85	754	305	290	290
query86	445	306	302	302
query87	4481	4228	4319	4228
query88	3381	2345	2327	2327
query89	386	296	283	283
query90	1729	193	193	193
query91	142	117	102	102
query92	68	54	54	54
query93	1726	544	534	534
query94	804	312	320	312
query95	359	265	258	258
query96	604	272	266	266
query97	3254	3081	3096	3081
query98	219	207	193	193
query99	1572	1305	1251	1251
Total cold run time: 309051 ms
Total hot run time: 193179 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.04
query2	0.08	0.04	0.05
query3	0.23	0.06	0.06
query4	1.66	0.08	0.08
query5	0.52	0.49	0.48
query6	1.12	0.74	0.74
query7	0.02	0.02	0.01
query8	0.06	0.05	0.05
query9	0.55	0.48	0.48
query10	0.55	0.54	0.54
query11	0.16	0.12	0.11
query12	0.16	0.12	0.12
query13	0.62	0.59	0.59
query14	2.03	2.09	2.16
query15	0.84	0.82	0.83
query16	0.37	0.37	0.35
query17	0.98	0.95	1.02
query18	0.21	0.22	0.21
query19	1.86	1.70	1.75
query20	0.01	0.01	0.02
query21	15.39	0.67	0.67
query22	4.03	7.43	2.49
query23	18.23	1.41	1.30
query24	2.13	0.23	0.23
query25	0.16	0.09	0.07
query26	0.26	0.18	0.18
query27	0.08	0.08	0.07
query28	13.19	1.02	1.00
query29	12.63	3.30	3.29
query30	0.24	0.06	0.06
query31	2.89	0.42	0.39
query32	3.23	0.49	0.48
query33	2.96	3.02	3.00
query34	17.07	4.37	4.37
query35	4.44	4.43	4.39
query36	0.66	0.47	0.47
query37	0.18	0.16	0.16
query38	0.16	0.15	0.16
query39	0.05	0.04	0.04
query40	0.17	0.13	0.14
query41	0.11	0.06	0.05
query42	0.06	0.05	0.06
query43	0.05	0.04	0.04
Total cold run time: 110.45 s
Total hot run time: 32.55 s

@bobhan1 bobhan1 force-pushed the remove-lock-for-mow branch from 996aa53 to 45b1688 Compare September 3, 2024 07:31
@bobhan1
Copy link
Contributor Author

bobhan1 commented Sep 3, 2024

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18043	4932	4373	4373
q2	2030	183	181	181
q3	11533	992	1091	992
q4	10311	799	781	781
q5	7777	2889	2873	2873
q6	229	140	138	138
q7	969	624	602	602
q8	9341	2101	2111	2101
q9	7282	6622	6569	6569
q10	6996	2188	2230	2188
q11	446	240	236	236
q12	403	224	228	224
q13	18940	3085	3060	3060
q14	289	225	248	225
q15	517	480	491	480
q16	590	521	499	499
q17	1012	662	784	662
q18	7707	7018	6963	6963
q19	1389	1012	1105	1012
q20	670	335	338	335
q21	3919	2895	2988	2895
q22	1110	1028	1031	1028
Total cold run time: 111503 ms
Total hot run time: 38417 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4390	4329	4348	4329
q2	388	280	278	278
q3	2882	2672	2665	2665
q4	1923	1628	1649	1628
q5	5695	5717	5800	5717
q6	227	135	135	135
q7	2184	1852	1797	1797
q8	3291	3486	3491	3486
q9	8950	8914	8902	8902
q10	3645	3404	3376	3376
q11	597	509	507	507
q12	813	662	637	637
q13	14191	3273	3256	3256
q14	331	296	288	288
q15	549	491	476	476
q16	610	573	583	573
q17	1856	1547	1572	1547
q18	8151	7887	7958	7887
q19	1747	1579	1597	1579
q20	2151	1908	1954	1908
q21	5796	5554	5304	5304
q22	1141	1042	1053	1042
Total cold run time: 71508 ms
Total hot run time: 57317 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192191 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 45b1688a06c6be2a184f537573d3033f5b5e7916, data reload: false

query1	1288	908	866	866
query2	6327	1880	1865	1865
query3	10622	3912	3921	3912
query4	59895	26838	23317	23317
query5	5416	489	496	489
query6	414	160	176	160
query7	5874	297	291	291
query8	284	199	203	199
query9	9003	2491	2460	2460
query10	488	266	263	263
query11	17803	15089	15448	15089
query12	151	102	105	102
query13	1596	402	387	387
query14	10893	7449	7031	7031
query15	251	170	185	170
query16	7448	468	488	468
query17	1162	591	594	591
query18	1818	317	309	309
query19	300	157	178	157
query20	135	110	113	110
query21	208	104	102	102
query22	4450	4448	4573	4448
query23	35384	33800	33371	33371
query24	5936	2869	2725	2725
query25	497	372	382	372
query26	676	152	153	152
query27	1793	272	276	272
query28	3712	2058	2033	2033
query29	625	403	412	403
query30	240	150	155	150
query31	924	765	814	765
query32	89	55	52	52
query33	477	289	281	281
query34	870	484	488	484
query35	841	732	725	725
query36	1065	932	935	932
query37	152	83	84	83
query38	4074	3876	3806	3806
query39	1454	1371	1398	1371
query40	194	113	111	111
query41	47	45	44	44
query42	117	95	92	92
query43	511	466	471	466
query44	1064	730	719	719
query45	194	167	160	160
query46	1082	718	702	702
query47	1881	1778	1786	1778
query48	374	292	285	285
query49	754	422	442	422
query50	822	421	405	405
query51	6941	6903	6862	6862
query52	96	85	84	84
query53	243	174	183	174
query54	570	459	446	446
query55	75	75	76	75
query56	261	247	249	247
query57	1185	1063	1072	1063
query58	216	263	229	229
query59	2917	2838	2780	2780
query60	303	270	268	268
query61	106	104	102	102
query62	737	652	678	652
query63	231	189	195	189
query64	2811	778	727	727
query65	3240	3128	3123	3123
query66	614	337	339	337
query67	15450	15330	15209	15209
query68	3000	591	571	571
query69	391	281	286	281
query70	1104	1024	998	998
query71	335	277	274	274
query72	5783	3985	4083	3985
query73	744	339	331	331
query74	9104	8764	8816	8764
query75	3342	2709	2727	2709
query76	1325	1124	920	920
query77	536	329	312	312
query78	10007	10113	9279	9279
query79	1049	540	533	533
query80	691	579	499	499
query81	465	239	234	234
query82	238	146	142	142
query83	171	148	149	148
query84	253	76	73	73
query85	693	289	283	283
query86	295	302	296	296
query87	4403	4241	4221	4221
query88	3234	2365	2341	2341
query89	376	279	276	276
query90	1989	193	188	188
query91	124	97	100	97
query92	61	51	52	51
query93	1028	533	534	533
query94	683	297	291	291
query95	329	256	295	256
query96	589	265	263	263
query97	3217	3094	3081	3081
query98	214	194	199	194
query99	1499	1263	1253	1253
Total cold run time: 304943 ms
Total hot run time: 192191 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.04
query2	0.07	0.04	0.05
query3	0.22	0.05	0.04
query4	1.67	0.08	0.08
query5	0.51	0.50	0.49
query6	1.13	0.74	0.73
query7	0.02	0.01	0.01
query8	0.05	0.04	0.04
query9	0.55	0.49	0.48
query10	0.55	0.54	0.54
query11	0.15	0.11	0.11
query12	0.14	0.12	0.12
query13	0.62	0.59	0.59
query14	2.05	2.07	2.04
query15	0.89	0.82	0.83
query16	0.38	0.38	0.38
query17	0.99	1.04	1.05
query18	0.21	0.21	0.20
query19	1.89	1.90	1.85
query20	0.02	0.01	0.01
query21	15.41	0.65	0.64
query22	4.43	6.63	1.59
query23	18.26	1.44	1.30
query24	2.10	0.23	0.22
query25	0.15	0.09	0.08
query26	0.26	0.19	0.18
query27	0.08	0.07	0.08
query28	13.31	1.03	1.00
query29	12.56	3.36	3.35
query30	0.23	0.05	0.05
query31	2.86	0.40	0.39
query32	3.26	0.48	0.47
query33	2.94	2.99	3.02
query34	17.18	4.35	4.36
query35	4.42	4.48	4.46
query36	0.67	0.48	0.49
query37	0.19	0.15	0.16
query38	0.15	0.14	0.14
query39	0.05	0.04	0.04
query40	0.16	0.13	0.13
query41	0.09	0.06	0.05
query42	0.06	0.05	0.06
query43	0.05	0.04	0.04
Total cold run time: 111.03 s
Total hot run time: 31.87 s

@bobhan1 bobhan1 force-pushed the remove-lock-for-mow branch from 45b1688 to ed436b1 Compare September 4, 2024 02:36
@bobhan1 bobhan1 force-pushed the remove-lock-for-mow branch from ed436b1 to 7bbd70a Compare September 11, 2024 10:33
@bobhan1 bobhan1 requested a review from zhannngchen September 11, 2024 10:40
@bobhan1
Copy link
Contributor Author

bobhan1 commented Sep 11, 2024

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18055	4681	4451	4451
q2	2644	190	178	178
q3	11737	1158	1260	1158
q4	10636	817	747	747
q5	7785	2939	2879	2879
q6	240	141	144	141
q7	993	629	595	595
q8	9330	2109	2089	2089
q9	7167	6591	6573	6573
q10	7007	2215	2210	2210
q11	471	254	243	243
q12	403	221	221	221
q13	18902	3112	3112	3112
q14	283	239	254	239
q15	533	497	498	497
q16	518	430	423	423
q17	990	755	737	737
q18	7480	6976	6961	6961
q19	1440	1055	1102	1055
q20	702	335	333	333
q21	3968	3114	3159	3114
q22	1110	1021	1031	1021
Total cold run time: 112394 ms
Total hot run time: 38977 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4475	4294	4312	4294
q2	380	275	279	275
q3	2900	2656	2681	2656
q4	1919	1672	1624	1624
q5	5445	5468	5454	5454
q6	225	133	133	133
q7	2145	1786	1809	1786
q8	3256	3431	3385	3385
q9	8577	8493	8495	8493
q10	3502	3243	3207	3207
q11	608	518	520	518
q12	788	611	580	580
q13	10902	3085	3082	3082
q14	311	282	290	282
q15	528	485	486	485
q16	497	493	475	475
q17	1798	1516	1490	1490
q18	7844	7528	7580	7528
q19	1708	1557	1693	1557
q20	2074	1834	1826	1826
q21	5639	5435	5190	5190
q22	1110	1047	1042	1042
Total cold run time: 66631 ms
Total hot run time: 55362 ms

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.89% (9455/25629)
Line Coverage: 28.25% (77749/275229)
Region Coverage: 27.65% (40127/145150)
Branch Coverage: 24.26% (20389/84044)
Coverage Report: http://coverage.selectdb-in.cc/coverage/bb539e1cc8a5355a025e02245e258c0306ff559c_bb539e1cc8a5355a025e02245e258c0306ff559c/report/index.html

@doris-robot
Copy link

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

query1	921	387	385	385
query2	6491	1946	1884	1884
query3	6647	206	214	206
query4	31589	23236	23116	23116
query5	4155	513	510	510
query6	260	170	166	166
query7	4585	295	301	295
query8	282	217	227	217
query9	8589	2473	2485	2473
query10	440	282	280	280
query11	18046	15007	15092	15007
query12	153	100	100	100
query13	1636	391	398	391
query14	9608	7188	7341	7188
query15	256	167	182	167
query16	8035	473	480	473
query17	1577	557	541	541
query18	2115	283	283	283
query19	337	142	158	142
query20	120	108	115	108
query21	213	104	105	104
query22	4497	4370	4231	4231
query23	34294	33614	33519	33519
query24	11155	2867	2825	2825
query25	616	391	417	391
query26	1193	156	149	149
query27	2814	270	274	270
query28	7639	2027	2005	2005
query29	822	408	402	402
query30	291	160	148	148
query31	987	767	786	767
query32	97	54	53	53
query33	742	288	278	278
query34	956	477	478	477
query35	876	743	716	716
query36	1100	943	946	943
query37	168	84	85	84
query38	4008	3865	3884	3865
query39	1448	1401	1418	1401
query40	200	112	112	112
query41	49	45	46	45
query42	113	96	96	96
query43	517	469	469	469
query44	1242	751	734	734
query45	193	195	178	178
query46	1107	735	744	735
query47	1903	1812	1831	1812
query48	372	296	288	288
query49	1094	424	426	424
query50	827	410	401	401
query51	7040	6858	6732	6732
query52	98	88	87	87
query53	253	183	179	179
query54	872	444	449	444
query55	76	74	73	73
query56	276	248	263	248
query57	1195	1102	1095	1095
query58	237	231	240	231
query59	3011	2738	2737	2737
query60	300	258	267	258
query61	136	99	99	99
query62	857	638	664	638
query63	215	191	188	188
query64	4913	689	657	657
query65	3255	3185	3153	3153
query66	1427	336	347	336
query67	15950	15526	15166	15166
query68	3112	846	837	837
query69	428	316	327	316
query70	1178	1143	1182	1143
query71	343	345	353	345
query72	6172	3584	3594	3584
query73	584	584	583	583
query74	9005	9112	8824	8824
query75	3130	2999	2999	2999
query76	1908	856	855	855
query77	486	397	388	388
query78	9516	9679	9232	9232
query79	889	894	875	875
query80	836	822	805	805
query81	443	260	260	260
query82	270	270	263	263
query83	192	193	196	193
query84	233	109	110	109
query85	678	455	453	453
query86	299	316	306	306
query87	4227	4330	4319	4319
query88	4404	4060	4035	4035
query89	381	371	373	371
query90	1384	320	314	314
query91	125	122	122	122
query92	77	76	74	74
query93	927	949	927	927
query94	480	358	373	358
query95	418	422	409	409
query96	476	472	468	468
query97	3147	3069	3142	3069
query98	230	227	244	227
query99	1373	1287	1286	1286
Total cold run time: 284837 ms
Total hot run time: 192524 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.04
query2	0.07	0.04	0.04
query3	0.23	0.05	0.06
query4	1.67	0.10	0.10
query5	0.49	0.49	0.49
query6	1.14	0.74	0.73
query7	0.02	0.01	0.02
query8	0.05	0.04	0.04
query9	0.56	0.51	0.49
query10	0.54	0.57	0.54
query11	0.16	0.12	0.12
query12	0.15	0.13	0.12
query13	0.60	0.60	0.59
query14	1.44	1.44	1.42
query15	0.86	0.83	0.82
query16	0.37	0.36	0.37
query17	0.97	0.99	1.00
query18	0.22	0.21	0.20
query19	1.85	1.89	1.86
query20	0.02	0.01	0.01
query21	15.41	0.66	0.67
query22	4.22	7.03	2.14
query23	18.30	1.45	1.25
query24	2.11	0.24	0.21
query25	0.16	0.08	0.08
query26	0.26	0.18	0.18
query27	0.08	0.08	0.08
query28	13.21	1.04	1.00
query29	12.57	3.39	3.39
query30	0.25	0.06	0.06
query31	2.89	0.40	0.40
query32	3.24	0.49	0.48
query33	2.99	2.98	3.04
query34	17.17	4.39	4.44
query35	4.50	4.44	4.44
query36	0.66	0.49	0.47
query37	0.18	0.15	0.16
query38	0.15	0.14	0.15
query39	0.05	0.04	0.04
query40	0.17	0.12	0.13
query41	0.10	0.06	0.05
query42	0.06	0.05	0.06
query43	0.04	0.05	0.04
Total cold run time: 110.22 s
Total hot run time: 31.82 s

Copy link
Contributor

@zhannngchen zhannngchen 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
Copy link
Contributor

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

@github-actions github-actions bot added approved Indicates a PR has been approved by one committer. reviewed labels Sep 11, 2024
@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@zhannngchen
Copy link
Contributor

run cloud_p0

@zhannngchen zhannngchen merged commit fe8905a into apache:master Sep 12, 2024
dataroaring pushed a commit that referenced this pull request Oct 9, 2024
…for partial update (#40062)

## Proposed changes
1. #34112 let partial update fetch
rowsets in the initialization of RowsetBuilder rather than flush phase.
So we can remove that tablet header lock.
2. refactor some partial update code
bobhan1 added a commit to bobhan1/doris that referenced this pull request Oct 14, 2024
…code for partial update (apache#40062)

1. apache#34112 let partial update fetch
rowsets in the initialization of RowsetBuilder rather than flush phase.
So we can remove that tablet header lock.
2. refactor some partial update code
bobhan1 added a commit to bobhan1/doris that referenced this pull request Oct 14, 2024
…code for partial update (apache#40062)

1. apache#34112 let partial update fetch
rowsets in the initialization of RowsetBuilder rather than flush phase.
So we can remove that tablet header lock.
2. refactor some partial update code
@bobhan1 bobhan1 mentioned this pull request Oct 14, 2024
bobhan1 added a commit to bobhan1/doris that referenced this pull request Oct 15, 2024
…update apache#39619

pick [opt](partial update) Remove unnecessary lock and refactor some code for partial update (apache#40062)

1. apache#34112 let partial update fetch
rowsets in the initialization of RowsetBuilder rather than flush phase.
So we can remove that tablet header lock.
2. refactor some partial update code

fix compile

pick [Fix](partial update) Fix __DORIS_SEQUENCE_COL__ is not set for newly inserted rows in partial update apache#40272

picks apache#40272

pick [Cherry-pick](branch-2.1) Pick "[Featrue](default value) Support bitmap_empty default value (apache#40364)" (apache#40487)

Pick apache#40364

<!--Describe your changes.-->

pick [Feature](partial update) Support flexible partial update in stream load with json files (apache#39756)

This PR add the ability to update different columns for each row in one
stream load
Doc: apache/doris-website#1140
```sql
MySQL root@127.1:d1> CREATE TABLE t1 (
                  -> `k` int(11) NULL,
                  -> `v1` BIGINT NULL,
                  -> `v2` BIGINT NULL DEFAULT "9876",
                  -> `v3` BIGINT NOT NULL,
                  -> `v4` BIGINT NOT NULL DEFAULT "1234",
                  -> `v5` BIGINT NULL
                  -> ) UNIQUE KEY(`k`) DISTRIBUTED BY HASH(`k`) BUCKETS 1
                  -> PROPERTIES(
                  -> "replication_num" = "1",
                  -> "enable_unique_key_merge_on_write" = "true");
Query OK, 0 rows affected
Time: 0.013s
MySQL root@127.1:d1> insert into t1 select number, number, number, number, number, number from numbers("number" = "6");
Query OK, 6 rows affected
Time: 0.107s
MySQL root@127.1:d1> select * from t1;
+---+----+----+----+----+----+
| k | v1 | v2 | v3 | v4 | v5 |
+---+----+----+----+----+----+
| 0 | 0  | 0  | 0  | 0  | 0  |
| 1 | 1  | 1  | 1  | 1  | 1  |
| 2 | 2  | 2  | 2  | 2  | 2  |
| 3 | 3  | 3  | 3  | 3  | 3  |
| 4 | 4  | 4  | 4  | 4  | 4  |
| 5 | 5  | 5  | 5  | 5  | 5  |
+---+----+----+----+----+----+
```
test1.json:
```json
{"k": 1, "v1": 10}
{"k": 2, "v2": 20, "v5": 25}
{"k": 3, "v3": 30}
{"k": 4, "v4": 20, "v1": 43, "v3": 99}
{"k": 5, "v5": null}
{"k": 6, "v1": 999, "v3": 777}
{"k": 2, "v4": 222}
{"k": 1, "v2": 111, "v3": 111}
```

```bash
curl --location-trusted -u root: \
-H "strict_mode:false" \
-H "format:json" \
-H "read_json_by_line:true" \
-H "unique_key_update_mode:UPDATE_FLEXIBLE_COLUMNS" \
-T test1.json \
-XPUT http://<host>:<http_port>/api/d1/t1/_stream_load
```

```sql
MySQL root@127.1:d1> select * from t1;
+---+-----+------+-----+------+--------+
| k | v1  | v2   | v3  | v4   | v5     |
+---+-----+------+-----+------+--------+
| 0 | 0   | 0    | 0   | 0    | 0      |
| 1 | 10  | 111  | 111 | 1    | 1      |
| 2 | 2   | 20   | 2   | 222  | 25     |
| 3 | 3   | 3    | 30  | 3    | 3      |
| 4 | 43  | 4    | 99  | 20   | 4      |
| 5 | 5   | 5    | 5   | 5    | <null> |
| 6 | 999 | 9876 | 777 | 1234 | <null> |
+---+-----+------+-----+------+--------+
```

fix compile

pick [branch-2.1] Picks "[opt](partial update) Allow to only specify key columns in partial update apache#40736" (apache#40863)

picks apache#40736

fix
bobhan1 added a commit to bobhan1/doris that referenced this pull request Oct 15, 2024
…update apache#39619

pick [opt](partial update) Remove unnecessary lock and refactor some code for partial update (apache#40062)

1. apache#34112 let partial update fetch
rowsets in the initialization of RowsetBuilder rather than flush phase.
So we can remove that tablet header lock.
2. refactor some partial update code

fix compile

pick [Fix](partial update) Fix __DORIS_SEQUENCE_COL__ is not set for newly inserted rows in partial update apache#40272

picks apache#40272

pick [Cherry-pick](branch-2.1) Pick "[Featrue](default value) Support bitmap_empty default value (apache#40364)" (apache#40487)

Pick apache#40364

<!--Describe your changes.-->

pick [Feature](partial update) Support flexible partial update in stream load with json files (apache#39756)

This PR add the ability to update different columns for each row in one
stream load
Doc: apache/doris-website#1140
```sql
MySQL root@127.1:d1> CREATE TABLE t1 (
                  -> `k` int(11) NULL,
                  -> `v1` BIGINT NULL,
                  -> `v2` BIGINT NULL DEFAULT "9876",
                  -> `v3` BIGINT NOT NULL,
                  -> `v4` BIGINT NOT NULL DEFAULT "1234",
                  -> `v5` BIGINT NULL
                  -> ) UNIQUE KEY(`k`) DISTRIBUTED BY HASH(`k`) BUCKETS 1
                  -> PROPERTIES(
                  -> "replication_num" = "1",
                  -> "enable_unique_key_merge_on_write" = "true");
Query OK, 0 rows affected
Time: 0.013s
MySQL root@127.1:d1> insert into t1 select number, number, number, number, number, number from numbers("number" = "6");
Query OK, 6 rows affected
Time: 0.107s
MySQL root@127.1:d1> select * from t1;
+---+----+----+----+----+----+
| k | v1 | v2 | v3 | v4 | v5 |
+---+----+----+----+----+----+
| 0 | 0  | 0  | 0  | 0  | 0  |
| 1 | 1  | 1  | 1  | 1  | 1  |
| 2 | 2  | 2  | 2  | 2  | 2  |
| 3 | 3  | 3  | 3  | 3  | 3  |
| 4 | 4  | 4  | 4  | 4  | 4  |
| 5 | 5  | 5  | 5  | 5  | 5  |
+---+----+----+----+----+----+
```
test1.json:
```json
{"k": 1, "v1": 10}
{"k": 2, "v2": 20, "v5": 25}
{"k": 3, "v3": 30}
{"k": 4, "v4": 20, "v1": 43, "v3": 99}
{"k": 5, "v5": null}
{"k": 6, "v1": 999, "v3": 777}
{"k": 2, "v4": 222}
{"k": 1, "v2": 111, "v3": 111}
```

```bash
curl --location-trusted -u root: \
-H "strict_mode:false" \
-H "format:json" \
-H "read_json_by_line:true" \
-H "unique_key_update_mode:UPDATE_FLEXIBLE_COLUMNS" \
-T test1.json \
-XPUT http://<host>:<http_port>/api/d1/t1/_stream_load
```

```sql
MySQL root@127.1:d1> select * from t1;
+---+-----+------+-----+------+--------+
| k | v1  | v2   | v3  | v4   | v5     |
+---+-----+------+-----+------+--------+
| 0 | 0   | 0    | 0   | 0    | 0      |
| 1 | 10  | 111  | 111 | 1    | 1      |
| 2 | 2   | 20   | 2   | 222  | 25     |
| 3 | 3   | 3    | 30  | 3    | 3      |
| 4 | 43  | 4    | 99  | 20   | 4      |
| 5 | 5   | 5    | 5   | 5    | <null> |
| 6 | 999 | 9876 | 777 | 1234 | <null> |
+---+-----+------+-----+------+--------+
```

fix compile

pick [branch-2.1] Picks "[opt](partial update) Allow to only specify key columns in partial update apache#40736" (apache#40863)

picks apache#40736

fix
bobhan1 added a commit to bobhan1/doris that referenced this pull request Oct 15, 2024
…update apache#39619

pick [opt](partial update) Remove unnecessary lock and refactor some code for partial update (apache#40062)

1. apache#34112 let partial update fetch
rowsets in the initialization of RowsetBuilder rather than flush phase.
So we can remove that tablet header lock.
2. refactor some partial update code

fix compile

pick [Fix](partial update) Fix __DORIS_SEQUENCE_COL__ is not set for newly inserted rows in partial update apache#40272

picks apache#40272

pick [Cherry-pick](branch-2.1) Pick "[Featrue](default value) Support bitmap_empty default value (apache#40364)" (apache#40487)

Pick apache#40364

<!--Describe your changes.-->

pick [Feature](partial update) Support flexible partial update in stream load with json files (apache#39756)

This PR add the ability to update different columns for each row in one
stream load
Doc: apache/doris-website#1140
```sql
MySQL root@127.1:d1> CREATE TABLE t1 (
                  -> `k` int(11) NULL,
                  -> `v1` BIGINT NULL,
                  -> `v2` BIGINT NULL DEFAULT "9876",
                  -> `v3` BIGINT NOT NULL,
                  -> `v4` BIGINT NOT NULL DEFAULT "1234",
                  -> `v5` BIGINT NULL
                  -> ) UNIQUE KEY(`k`) DISTRIBUTED BY HASH(`k`) BUCKETS 1
                  -> PROPERTIES(
                  -> "replication_num" = "1",
                  -> "enable_unique_key_merge_on_write" = "true");
Query OK, 0 rows affected
Time: 0.013s
MySQL root@127.1:d1> insert into t1 select number, number, number, number, number, number from numbers("number" = "6");
Query OK, 6 rows affected
Time: 0.107s
MySQL root@127.1:d1> select * from t1;
+---+----+----+----+----+----+
| k | v1 | v2 | v3 | v4 | v5 |
+---+----+----+----+----+----+
| 0 | 0  | 0  | 0  | 0  | 0  |
| 1 | 1  | 1  | 1  | 1  | 1  |
| 2 | 2  | 2  | 2  | 2  | 2  |
| 3 | 3  | 3  | 3  | 3  | 3  |
| 4 | 4  | 4  | 4  | 4  | 4  |
| 5 | 5  | 5  | 5  | 5  | 5  |
+---+----+----+----+----+----+
```
test1.json:
```json
{"k": 1, "v1": 10}
{"k": 2, "v2": 20, "v5": 25}
{"k": 3, "v3": 30}
{"k": 4, "v4": 20, "v1": 43, "v3": 99}
{"k": 5, "v5": null}
{"k": 6, "v1": 999, "v3": 777}
{"k": 2, "v4": 222}
{"k": 1, "v2": 111, "v3": 111}
```

```bash
curl --location-trusted -u root: \
-H "strict_mode:false" \
-H "format:json" \
-H "read_json_by_line:true" \
-H "unique_key_update_mode:UPDATE_FLEXIBLE_COLUMNS" \
-T test1.json \
-XPUT http://<host>:<http_port>/api/d1/t1/_stream_load
```

```sql
MySQL root@127.1:d1> select * from t1;
+---+-----+------+-----+------+--------+
| k | v1  | v2   | v3  | v4   | v5     |
+---+-----+------+-----+------+--------+
| 0 | 0   | 0    | 0   | 0    | 0      |
| 1 | 10  | 111  | 111 | 1    | 1      |
| 2 | 2   | 20   | 2   | 222  | 25     |
| 3 | 3   | 3    | 30  | 3    | 3      |
| 4 | 43  | 4    | 99  | 20   | 4      |
| 5 | 5   | 5    | 5   | 5    | <null> |
| 6 | 999 | 9876 | 777 | 1234 | <null> |
+---+-----+------+-----+------+--------+
```

fix compile

pick [branch-2.1] Picks "[opt](partial update) Allow to only specify key columns in partial update apache#40736" (apache#40863)

picks apache#40736

fix
bobhan1 added a commit to bobhan1/doris that referenced this pull request Oct 15, 2024
…update apache#39619

pick [opt](partial update) Remove unnecessary lock and refactor some code for partial update (apache#40062)

1. apache#34112 let partial update fetch
rowsets in the initialization of RowsetBuilder rather than flush phase.
So we can remove that tablet header lock.
2. refactor some partial update code

fix compile

pick [Fix](partial update) Fix __DORIS_SEQUENCE_COL__ is not set for newly inserted rows in partial update apache#40272

picks apache#40272

pick [Cherry-pick](branch-2.1) Pick "[Featrue](default value) Support bitmap_empty default value (apache#40364)" (apache#40487)

Pick apache#40364

<!--Describe your changes.-->

pick [Feature](partial update) Support flexible partial update in stream load with json files (apache#39756)

This PR add the ability to update different columns for each row in one
stream load
Doc: apache/doris-website#1140
```sql
MySQL root@127.1:d1> CREATE TABLE t1 (
                  -> `k` int(11) NULL,
                  -> `v1` BIGINT NULL,
                  -> `v2` BIGINT NULL DEFAULT "9876",
                  -> `v3` BIGINT NOT NULL,
                  -> `v4` BIGINT NOT NULL DEFAULT "1234",
                  -> `v5` BIGINT NULL
                  -> ) UNIQUE KEY(`k`) DISTRIBUTED BY HASH(`k`) BUCKETS 1
                  -> PROPERTIES(
                  -> "replication_num" = "1",
                  -> "enable_unique_key_merge_on_write" = "true");
Query OK, 0 rows affected
Time: 0.013s
MySQL root@127.1:d1> insert into t1 select number, number, number, number, number, number from numbers("number" = "6");
Query OK, 6 rows affected
Time: 0.107s
MySQL root@127.1:d1> select * from t1;
+---+----+----+----+----+----+
| k | v1 | v2 | v3 | v4 | v5 |
+---+----+----+----+----+----+
| 0 | 0  | 0  | 0  | 0  | 0  |
| 1 | 1  | 1  | 1  | 1  | 1  |
| 2 | 2  | 2  | 2  | 2  | 2  |
| 3 | 3  | 3  | 3  | 3  | 3  |
| 4 | 4  | 4  | 4  | 4  | 4  |
| 5 | 5  | 5  | 5  | 5  | 5  |
+---+----+----+----+----+----+
```
test1.json:
```json
{"k": 1, "v1": 10}
{"k": 2, "v2": 20, "v5": 25}
{"k": 3, "v3": 30}
{"k": 4, "v4": 20, "v1": 43, "v3": 99}
{"k": 5, "v5": null}
{"k": 6, "v1": 999, "v3": 777}
{"k": 2, "v4": 222}
{"k": 1, "v2": 111, "v3": 111}
```

```bash
curl --location-trusted -u root: \
-H "strict_mode:false" \
-H "format:json" \
-H "read_json_by_line:true" \
-H "unique_key_update_mode:UPDATE_FLEXIBLE_COLUMNS" \
-T test1.json \
-XPUT http://<host>:<http_port>/api/d1/t1/_stream_load
```

```sql
MySQL root@127.1:d1> select * from t1;
+---+-----+------+-----+------+--------+
| k | v1  | v2   | v3  | v4   | v5     |
+---+-----+------+-----+------+--------+
| 0 | 0   | 0    | 0   | 0    | 0      |
| 1 | 10  | 111  | 111 | 1    | 1      |
| 2 | 2   | 20   | 2   | 222  | 25     |
| 3 | 3   | 3    | 30  | 3    | 3      |
| 4 | 43  | 4    | 99  | 20   | 4      |
| 5 | 5   | 5    | 5   | 5    | <null> |
| 6 | 999 | 9876 | 777 | 1234 | <null> |
+---+-----+------+-----+------+--------+
```

fix compile

pick [branch-2.1] Picks "[opt](partial update) Allow to only specify key columns in partial update apache#40736" (apache#40863)

picks apache#40736

fix
bobhan1 added a commit to bobhan1/doris that referenced this pull request Oct 21, 2024
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.3-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants