Skip to content

[fix](arrow) Fix UT DataTypeSerDeArrowTest of Array/Map/Struct/Bitmap/HLL/Decimal256 types - #48944

Merged
xinyiZzz merged 10 commits into
apache:masterfrom
xinyiZzz:20250303_fix_arrow_ut
Mar 18, 2025
Merged

xinyiZzz merged 10 commits into
apache:masterfrom
xinyiZzz:20250303_fix_arrow_ut

Conversation

@xinyiZzz

@xinyiZzz xinyiZzz commented Mar 11, 2025 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Fix UT DataTypeSerDeArrowTest of Array/Map/Struct/Bitmap/HLL/Decimal256 types.

TODO:

  1. Map and Struct types deserialize_one_cell_from_json has Bug, which makes some cases unable to be tested by the framework. cannot test Struct type nested Array and Map and Struct, so manually construct data to test them. scalar type can be covered in the data_type_serde_arrow_test.
  2. Bitmap and HLL types only support Doris Column serialization to Arrow, but not deserialization. Currently, only ArrowReader of Data Lake uses deserialization Arrow -> Doris.

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

@hello-stephen

Copy link
Copy Markdown
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?

@xinyiZzz
xinyiZzz force-pushed the 20250303_fix_arrow_ut branch from 8143fe2 to e5e2832 Compare March 12, 2025 13:56
@xinyiZzz xinyiZzz changed the title [fix](arrow) Fix UT DataTypeSerDeArrowTest of Complex types [fix](arrow) Fix UT DataTypeSerDeArrowTest of Array/Map/Struct/Bitmap/HLL types Mar 12, 2025
@xinyiZzz

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

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

------ Round 1 ----------------------------------
q1	17592	5269	5109	5109
q2	2116	1344	1175	1175
q3	10046	1300	716	716
q4	10226	1014	543	543
q5	7558	2400	2387	2387
q6	188	164	136	136
q7	919	739	612	612
q8	9306	1288	1124	1124
q9	5070	4717	4609	4609
q10	6842	2326	1889	1889
q11	483	271	255	255
q12	350	349	224	224
q13	17779	3743	3106	3106
q14	233	228	212	212
q15	532	485	478	478
q16	636	594	586	586
q17	564	879	353	353
q18	7461	6475	6392	6392
q19	1651	965	551	551
q20	338	327	201	201
q21	3007	2180	2018	2018
q22	1066	1047	1002	1002
Total cold run time: 103963 ms
Total hot run time: 33678 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5229	5140	5132	5132
q2	243	343	238	238
q3	2193	2698	2284	2284
q4	1480	1841	1397	1397
q5	4267	4131	4212	4131
q6	215	169	132	132
q7	2057	1941	1748	1748
q8	2661	2706	2547	2547
q9	7212	7169	7313	7169
q10	2970	3179	2765	2765
q11	557	493	500	493
q12	705	777	623	623
q13	3531	4007	3309	3309
q14	282	299	282	282
q15	537	486	478	478
q16	662	696	652	652
q17	1186	1618	1373	1373
q18	7855	7534	7626	7534
q19	824	817	851	817
q20	1937	2014	1906	1906
q21	5473	4975	4875	4875
q22	1107	1074	1058	1058
Total cold run time: 53183 ms
Total hot run time: 50943 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 192426 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 e5e28326e4797e8d06cc31a24b307524c363c7c3, data reload: false

query1	1439	1015	996	996
query2	6098	1890	1898	1890
query3	11144	4581	4604	4581
query4	54620	25383	23547	23547
query5	5070	559	482	482
query6	349	198	184	184
query7	5009	520	295	295
query8	332	256	252	252
query9	6284	2626	2622	2622
query10	429	324	257	257
query11	15154	15086	14961	14961
query12	161	113	106	106
query13	1123	514	411	411
query14	10259	6729	6421	6421
query15	200	206	183	183
query16	7117	653	478	478
query17	1077	748	579	579
query18	1599	422	330	330
query19	196	201	173	173
query20	130	134	123	123
query21	215	129	107	107
query22	4389	4614	4393	4393
query23	34223	33447	33730	33447
query24	6241	2440	2444	2440
query25	501	473	396	396
query26	823	272	156	156
query27	2437	513	336	336
query28	2857	2458	2442	2442
query29	565	559	426	426
query30	284	224	191	191
query31	924	918	803	803
query32	75	64	62	62
query33	460	359	321	321
query34	755	842	501	501
query35	806	849	792	792
query36	970	1043	924	924
query37	117	111	86	86
query38	4092	4329	4266	4266
query39	1510	1466	1465	1465
query40	209	126	107	107
query41	53	57	50	50
query42	127	109	106	106
query43	503	536	494	494
query44	1377	813	809	809
query45	180	170	164	164
query46	832	1025	654	654
query47	1832	1865	1804	1804
query48	389	426	322	322
query49	699	519	456	456
query50	684	742	430	430
query51	4283	4312	4222	4222
query52	109	111	99	99
query53	257	277	189	189
query54	503	526	433	433
query55	81	85	87	85
query56	266	284	270	270
query57	1230	1212	1087	1087
query58	248	239	237	237
query59	2628	2770	2588	2588
query60	292	267	263	263
query61	126	119	121	119
query62	730	731	641	641
query63	227	193	191	191
query64	1864	1027	677	677
query65	4395	4395	4348	4348
query66	720	388	291	291
query67	15764	15448	15334	15334
query68	6767	876	514	514
query69	530	301	307	301
query70	1211	1134	1124	1124
query71	495	295	261	261
query72	5742	3562	3697	3562
query73	1349	697	346	346
query74	8994	8865	8724	8724
query75	3814	3160	2684	2684
query76	4265	1184	750	750
query77	644	382	283	283
query78	10161	10056	9291	9291
query79	3265	821	577	577
query80	659	535	462	462
query81	475	257	232	232
query82	482	127	97	97
query83	293	176	155	155
query84	284	94	76	76
query85	788	361	311	311
query86	363	331	262	262
query87	4392	4447	4411	4411
query88	3367	2266	2258	2258
query89	411	309	280	280
query90	1908	214	219	214
query91	143	143	116	116
query92	77	62	57	57
query93	1934	1048	577	577
query94	668	486	292	292
query95	355	281	266	266
query96	485	553	275	275
query97	3302	3409	3306	3306
query98	223	209	199	199
query99	1450	1402	1268	1268
Total cold run time: 299938 ms
Total hot run time: 192426 ms

@doris-robot

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

query1	0.04	0.03	0.03
query2	0.07	0.03	0.03
query3	0.24	0.07	0.06
query4	1.61	0.10	0.10
query5	0.55	0.54	0.55
query6	1.18	0.72	0.72
query7	0.02	0.01	0.02
query8	0.04	0.03	0.03
query9	0.60	0.50	0.53
query10	0.58	0.62	0.58
query11	0.16	0.11	0.11
query12	0.16	0.11	0.11
query13	0.63	0.61	0.60
query14	2.68	2.68	2.70
query15	0.91	0.86	0.87
query16	0.38	0.38	0.38
query17	1.02	1.06	1.03
query18	0.22	0.20	0.20
query19	1.98	2.01	1.81
query20	0.02	0.02	0.01
query21	15.36	0.90	0.53
query22	0.76	1.37	0.91
query23	14.72	1.38	0.68
query24	7.63	1.42	0.57
query25	0.52	0.31	0.06
query26	0.55	0.17	0.13
query27	0.06	0.05	0.05
query28	9.61	0.89	0.43
query29	12.51	3.99	3.33
query30	0.26	0.09	0.06
query31	2.81	0.61	0.40
query32	3.23	0.56	0.46
query33	2.97	2.99	2.99
query34	15.87	5.23	4.55
query35	4.55	4.54	4.57
query36	0.66	0.51	0.49
query37	0.10	0.06	0.06
query38	0.06	0.04	0.03
query39	0.04	0.03	0.02
query40	0.18	0.13	0.13
query41	0.09	0.03	0.03
query42	0.04	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 105.71 s
Total hot run time: 30.88 s

@xinyiZzz
xinyiZzz force-pushed the 20250303_fix_arrow_ut branch from e5e2832 to 628405c Compare March 13, 2025 05:27
@xinyiZzz

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

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

------ Round 1 ----------------------------------
q1	17638	5418	5356	5356
q2	2061	295	169	169
q3	10482	1378	740	740
q4	10239	1090	550	550
q5	7578	2572	2561	2561
q6	210	173	139	139
q7	1016	761	605	605
q8	9305	1436	1262	1262
q9	5133	4795	4840	4795
q10	6878	2365	1917	1917
q11	498	278	264	264
q12	359	379	216	216
q13	17772	3796	3101	3101
q14	235	230	207	207
q15	548	481	484	481
q16	654	629	578	578
q17	581	918	339	339
q18	6992	6448	6467	6448
q19	1947	1107	597	597
q20	323	332	186	186
q21	2932	2388	2016	2016
q22	1100	1045	971	971
Total cold run time: 104481 ms
Total hot run time: 33498 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5603	5528	5488	5488
q2	244	343	228	228
q3	2236	2766	2338	2338
q4	1533	1856	1399	1399
q5	4307	4166	4435	4166
q6	270	183	130	130
q7	2065	1972	1770	1770
q8	2905	2816	2860	2816
q9	7184	7079	7168	7079
q10	3095	3248	2816	2816
q11	615	513	498	498
q12	704	805	626	626
q13	3694	3976	3329	3329
q14	286	303	283	283
q15	533	477	473	473
q16	639	694	668	668
q17	1209	1791	1365	1365
q18	7817	7504	7517	7504
q19	870	913	1234	913
q20	2055	2077	1882	1882
q21	5737	5117	4798	4798
q22	1090	1044	996	996
Total cold run time: 54691 ms
Total hot run time: 51565 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 185610 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 628405c44167523ba93c59649b10a1596d0899d8, data reload: false

query1	1008	387	370	370
query2	6548	1931	1888	1888
query3	6801	219	217	217
query4	26779	23771	23435	23435
query5	4335	647	501	501
query6	308	210	190	190
query7	4611	504	300	300
query8	295	251	237	237
query9	8656	2630	2636	2630
query10	492	318	249	249
query11	15725	15296	15086	15086
query12	172	114	105	105
query13	1667	532	398	398
query14	10039	6239	6397	6239
query15	223	211	177	177
query16	7673	665	473	473
query17	1191	717	565	565
query18	1991	419	310	310
query19	197	185	159	159
query20	124	118	120	118
query21	259	127	103	103
query22	4266	4376	4028	4028
query23	33961	33195	32956	32956
query24	7753	2390	2401	2390
query25	548	452	389	389
query26	1225	277	148	148
query27	2471	468	324	324
query28	4261	2405	2389	2389
query29	745	556	425	425
query30	286	229	190	190
query31	977	873	798	798
query32	99	67	65	65
query33	559	375	302	302
query34	803	829	502	502
query35	775	821	726	726
query36	957	1033	905	905
query37	124	98	77	77
query38	4193	4117	4166	4117
query39	1495	1400	1403	1400
query40	210	119	105	105
query41	57	52	51	51
query42	123	100	106	100
query43	501	501	473	473
query44	1317	808	794	794
query45	176	175	166	166
query46	860	1055	610	610
query47	1728	1770	1702	1702
query48	380	422	298	298
query49	758	514	412	412
query50	703	728	408	408
query51	4186	4248	4089	4089
query52	111	111	97	97
query53	231	275	195	195
query54	497	520	434	434
query55	85	84	85	84
query56	274	265	274	265
query57	1097	1164	1072	1072
query58	238	243	244	243
query59	2509	2699	2469	2469
query60	278	300	256	256
query61	121	121	117	117
query62	813	767	657	657
query63	235	191	190	190
query64	4404	1019	669	669
query65	4508	4369	4382	4369
query66	1054	415	297	297
query67	15795	15449	15452	15449
query68	8975	870	501	501
query69	457	299	254	254
query70	1241	1143	1133	1133
query71	482	294	293	293
query72	5268	3569	3770	3569
query73	789	739	346	346
query74	8971	9047	8877	8877
query75	4067	3174	2690	2690
query76	3704	1189	754	754
query77	794	368	282	282
query78	9930	10070	9285	9285
query79	4220	835	573	573
query80	746	532	437	437
query81	475	260	222	222
query82	715	125	169	125
query83	216	175	157	157
query84	291	96	68	68
query85	784	351	313	313
query86	344	305	314	305
query87	4509	4407	4332	4332
query88	3494	2296	2291	2291
query89	461	314	287	287
query90	2055	210	219	210
query91	137	138	108	108
query92	75	62	58	58
query93	2630	1042	572	572
query94	670	412	309	309
query95	360	274	267	267
query96	484	566	275	275
query97	3424	3357	3288	3288
query98	250	206	207	206
query99	1433	1405	1271	1271
Total cold run time: 280292 ms
Total hot run time: 185610 ms

@doris-robot

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

query1	0.04	0.04	0.04
query2	0.06	0.03	0.04
query3	0.23	0.07	0.07
query4	1.61	0.11	0.10
query5	0.58	0.56	0.55
query6	1.21	0.72	0.71
query7	0.02	0.02	0.02
query8	0.05	0.04	0.03
query9	0.59	0.52	0.51
query10	0.57	0.62	0.56
query11	0.16	0.10	0.11
query12	0.15	0.12	0.11
query13	0.62	0.62	0.60
query14	2.67	2.67	2.69
query15	0.93	0.84	0.82
query16	0.38	0.38	0.38
query17	1.00	1.04	1.03
query18	0.21	0.20	0.20
query19	1.87	1.98	1.83
query20	0.01	0.01	0.01
query21	15.35	0.91	0.55
query22	0.75	1.25	0.65
query23	14.94	1.42	0.61
query24	7.21	1.99	0.91
query25	0.54	0.16	0.14
query26	0.68	0.16	0.13
query27	0.04	0.05	0.06
query28	9.09	0.88	0.43
query29	12.63	3.97	3.30
query30	0.25	0.09	0.06
query31	2.82	0.59	0.39
query32	3.23	0.54	0.47
query33	3.00	3.01	3.02
query34	15.60	5.18	4.53
query35	4.57	4.58	4.55
query36	0.66	0.50	0.48
query37	0.10	0.06	0.06
query38	0.05	0.04	0.03
query39	0.03	0.03	0.03
query40	0.17	0.13	0.13
query41	0.08	0.02	0.02
query42	0.03	0.02	0.03
query43	0.03	0.04	0.03
Total cold run time: 104.81 s
Total hot run time: 30.95 s

@xinyiZzz

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

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

------ Round 1 ----------------------------------
q1	17598	5348	5043	5043
q2	2044	302	160	160
q3	10488	1313	717	717
q4	10224	1021	551	551
q5	7544	2452	2370	2370
q6	187	164	134	134
q7	941	767	603	603
q8	9306	1309	1138	1138
q9	4893	4922	4840	4840
q10	6845	2332	1886	1886
q11	479	274	247	247
q12	356	354	213	213
q13	17784	3694	3085	3085
q14	219	234	214	214
q15	524	492	485	485
q16	619	632	586	586
q17	581	868	358	358
q18	7015	6456	6269	6269
q19	1217	954	546	546
q20	324	329	196	196
q21	2916	2138	1905	1905
q22	1015	1021	950	950
Total cold run time: 103119 ms
Total hot run time: 32496 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5166	5111	5134	5111
q2	237	338	236	236
q3	2140	2682	2315	2315
q4	1478	1844	1419	1419
q5	4259	4200	4183	4183
q6	222	163	122	122
q7	1889	1976	1768	1768
q8	2645	2646	2612	2612
q9	7343	7108	7282	7108
q10	2991	3187	2740	2740
q11	591	514	474	474
q12	683	787	610	610
q13	3523	3977	3258	3258
q14	275	297	261	261
q15	511	482	481	481
q16	655	685	641	641
q17	1136	1643	1343	1343
q18	7880	7630	7402	7402
q19	830	850	904	850
q20	2027	2012	1892	1892
q21	5573	4933	4860	4860
q22	1054	1003	948	948
Total cold run time: 53108 ms
Total hot run time: 50634 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 185474 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 1116ea03f16a197ec3747a8af6c8e342025de902, data reload: false

query1	1028	392	386	386
query2	6540	2003	1986	1986
query3	6791	207	220	207
query4	26447	23781	22947	22947
query5	4338	659	490	490
query6	293	201	202	201
query7	4602	517	284	284
query8	296	246	225	225
query9	8596	2591	2621	2591
query10	461	315	260	260
query11	15776	15165	14999	14999
query12	157	107	102	102
query13	1653	512	390	390
query14	8760	6973	6786	6786
query15	210	185	168	168
query16	7149	641	438	438
query17	1212	724	575	575
query18	1949	404	302	302
query19	196	182	162	162
query20	120	119	122	119
query21	211	127	110	110
query22	4163	4199	4096	4096
query23	34119	32865	33049	32865
query24	7655	2408	2413	2408
query25	557	475	420	420
query26	1250	288	164	164
query27	2090	494	333	333
query28	3902	2447	2394	2394
query29	779	583	442	442
query30	288	220	190	190
query31	938	854	786	786
query32	136	65	61	61
query33	580	374	308	308
query34	790	848	490	490
query35	786	823	737	737
query36	944	983	880	880
query37	114	96	73	73
query38	4073	4179	4038	4038
query39	1469	1406	1425	1406
query40	206	118	105	105
query41	54	51	51	51
query42	121	101	104	101
query43	508	521	484	484
query44	1299	783	775	775
query45	179	171	168	168
query46	850	1031	623	623
query47	1722	1770	1705	1705
query48	379	407	315	315
query49	801	500	411	411
query50	716	721	401	401
query51	4129	4266	4057	4057
query52	104	106	100	100
query53	237	264	189	189
query54	485	501	407	407
query55	79	79	78	78
query56	269	259	256	256
query57	1121	1151	1074	1074
query58	244	234	235	234
query59	2811	2739	2868	2739
query60	292	279	249	249
query61	127	122	120	120
query62	799	718	649	649
query63	226	187	195	187
query64	4393	1024	672	672
query65	4455	4313	4374	4313
query66	1172	452	302	302
query67	15939	15418	15241	15241
query68	8183	888	498	498
query69	470	298	257	257
query70	1210	1127	1088	1088
query71	455	300	261	261
query72	5820	3556	3692	3556
query73	770	723	345	345
query74	8993	9273	8932	8932
query75	3702	3183	2716	2716
query76	3634	1183	772	772
query77	789	384	283	283
query78	10160	10240	9283	9283
query79	2671	824	584	584
query80	689	511	438	438
query81	492	254	232	232
query82	703	127	93	93
query83	171	176	153	153
query84	245	92	72	72
query85	783	350	309	309
query86	391	292	292	292
query87	4461	4464	4380	4380
query88	3493	2242	2270	2242
query89	390	311	282	282
query90	1808	218	215	215
query91	139	140	104	104
query92	82	60	61	60
query93	1711	1059	573	573
query94	670	412	312	312
query95	371	268	264	264
query96	479	565	276	276
query97	3397	3414	3296	3296
query98	227	208	211	208
query99	1622	1396	1273	1273
Total cold run time: 274316 ms
Total hot run time: 185474 ms

@doris-robot

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

query1	0.04	0.04	0.03
query2	0.07	0.04	0.03
query3	0.23	0.07	0.06
query4	1.62	0.10	0.10
query5	0.56	0.57	0.55
query6	1.21	0.72	0.71
query7	0.03	0.02	0.02
query8	0.04	0.03	0.03
query9	0.58	0.53	0.52
query10	0.59	0.61	0.58
query11	0.16	0.10	0.10
query12	0.14	0.12	0.11
query13	0.62	0.61	0.60
query14	2.67	2.81	2.68
query15	0.92	0.88	0.85
query16	0.37	0.40	0.37
query17	0.99	1.02	1.04
query18	0.21	0.20	0.19
query19	1.94	1.80	1.99
query20	0.01	0.02	0.01
query21	15.36	0.86	0.55
query22	0.76	1.20	0.76
query23	14.79	1.37	0.63
query24	7.08	0.83	1.67
query25	0.52	0.26	0.11
query26	0.58	0.16	0.13
query27	0.05	0.06	0.05
query28	10.43	0.86	0.43
query29	12.51	3.88	3.28
query30	0.25	0.09	0.07
query31	2.82	0.57	0.38
query32	3.22	0.54	0.46
query33	2.96	2.99	3.00
query34	15.77	5.11	4.49
query35	4.52	4.51	4.54
query36	0.67	0.52	0.48
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.02
query40	0.17	0.13	0.12
query41	0.08	0.02	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 105.78 s
Total hot run time: 30.82 s

@xinyiZzz
xinyiZzz force-pushed the 20250303_fix_arrow_ut branch from 1116ea0 to 5370b6f Compare March 14, 2025 07:42
@xinyiZzz

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

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

------ Round 1 ----------------------------------
q1	17607	5580	5467	5467
q2	2039	280	165	165
q3	10427	1310	707	707
q4	10223	1015	536	536
q5	7544	2443	2357	2357
q6	190	167	133	133
q7	905	747	610	610
q8	9316	1318	1211	1211
q9	5030	4950	4896	4896
q10	6810	2301	1908	1908
q11	465	273	261	261
q12	348	358	221	221
q13	17786	3702	3113	3113
q14	223	229	218	218
q15	553	493	496	493
q16	631	628	580	580
q17	581	861	347	347
q18	6928	6453	6320	6320
q19	1219	947	546	546
q20	317	326	193	193
q21	2804	2132	1915	1915
q22	1059	1038	978	978
Total cold run time: 103005 ms
Total hot run time: 33175 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5572	5583	5516	5516
q2	235	337	223	223
q3	2192	2671	2319	2319
q4	1474	1812	1397	1397
q5	4262	4145	4146	4145
q6	210	165	124	124
q7	2005	1939	1770	1770
q8	2662	2473	2570	2473
q9	7314	7265	7145	7145
q10	3046	3272	2803	2803
q11	582	496	504	496
q12	694	787	643	643
q13	3537	3902	3352	3352
q14	280	304	280	280
q15	532	495	483	483
q16	657	691	660	660
q17	1147	1608	1356	1356
q18	7821	7516	7468	7468
q19	835	805	825	805
q20	1973	2030	1908	1908
q21	5523	4986	4908	4908
q22	1092	1051	995	995
Total cold run time: 53645 ms
Total hot run time: 51269 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 185054 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 5370b6f9caf9e629bd18e45bfd9ed266ea5811a9, data reload: false

query1	1010	393	380	380
query2	6545	1900	1897	1897
query3	6795	213	217	213
query4	26939	23739	23390	23390
query5	4383	671	477	477
query6	302	206	187	187
query7	4608	507	310	310
query8	305	252	237	237
query9	8629	2635	2617	2617
query10	465	335	248	248
query11	15573	15212	14868	14868
query12	169	110	109	109
query13	1654	522	392	392
query14	9967	6136	6500	6136
query15	205	188	170	170
query16	7698	657	466	466
query17	1202	725	563	563
query18	1997	406	320	320
query19	196	197	153	153
query20	122	118	117	117
query21	210	129	106	106
query22	4374	4079	4237	4079
query23	34137	32875	33024	32875
query24	7656	2355	2363	2355
query25	524	444	380	380
query26	1231	272	153	153
query27	2372	467	319	319
query28	4166	2409	2385	2385
query29	712	539	419	419
query30	281	219	189	189
query31	953	866	759	759
query32	70	64	63	63
query33	557	360	301	301
query34	792	840	508	508
query35	853	825	725	725
query36	947	981	896	896
query37	119	100	76	76
query38	4139	4199	3980	3980
query39	1524	1385	1414	1385
query40	210	115	98	98
query41	53	50	52	50
query42	118	102	100	100
query43	494	506	486	486
query44	1278	781	773	773
query45	179	167	162	162
query46	825	1026	606	606
query47	1772	1832	1729	1729
query48	380	412	293	293
query49	777	493	399	399
query50	691	732	403	403
query51	4161	4258	4092	4092
query52	107	106	91	91
query53	227	255	183	183
query54	486	495	402	402
query55	84	84	78	78
query56	258	267	266	266
query57	1127	1141	1093	1093
query58	269	236	239	236
query59	2457	2572	2596	2572
query60	278	268	246	246
query61	120	118	116	116
query62	823	723	662	662
query63	219	188	185	185
query64	4303	1017	685	685
query65	4386	4348	4361	4348
query66	1066	426	291	291
query67	15744	15496	15352	15352
query68	8181	870	497	497
query69	456	304	246	246
query70	1206	1113	1055	1055
query71	464	303	271	271
query72	5518	3745	3777	3745
query73	801	744	415	415
query74	9200	8892	8669	8669
query75	3761	3161	2710	2710
query76	3708	1186	747	747
query77	798	360	289	289
query78	10177	10037	9291	9291
query79	2665	827	591	591
query80	610	523	444	444
query81	493	258	222	222
query82	721	133	95	95
query83	171	182	153	153
query84	244	91	79	79
query85	818	355	310	310
query86	397	299	297	297
query87	4385	4554	4591	4554
query88	3664	2294	2294	2294
query89	391	322	283	283
query90	1881	213	213	213
query91	142	137	151	137
query92	70	61	56	56
query93	1717	1054	571	571
query94	674	423	299	299
query95	357	269	258	258
query96	486	568	282	282
query97	3395	3385	3284	3284
query98	237	199	200	199
query99	1656	1370	1298	1298
Total cold run time: 276717 ms
Total hot run time: 185054 ms

@doris-robot

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

query1	0.04	0.03	0.03
query2	0.08	0.03	0.03
query3	0.24	0.06	0.07
query4	1.62	0.10	0.11
query5	0.57	0.57	0.56
query6	1.19	0.70	0.73
query7	0.03	0.02	0.02
query8	0.05	0.03	0.04
query9	0.59	0.50	0.51
query10	0.56	0.60	0.58
query11	0.15	0.11	0.10
query12	0.14	0.11	0.11
query13	0.62	0.61	0.60
query14	2.80	2.82	2.69
query15	0.92	0.86	0.86
query16	0.40	0.38	0.37
query17	1.02	1.05	0.99
query18	0.22	0.20	0.20
query19	1.93	1.96	1.82
query20	0.01	0.01	0.01
query21	15.35	0.86	0.54
query22	0.78	1.02	0.65
query23	15.14	1.39	0.61
query24	7.84	1.15	0.85
query25	0.49	0.28	0.06
query26	0.70	0.17	0.13
query27	0.06	0.05	0.05
query28	9.29	0.85	0.42
query29	12.55	3.94	3.30
query30	0.25	0.09	0.07
query31	2.82	0.61	0.39
query32	3.22	0.54	0.46
query33	2.98	3.06	3.04
query34	15.65	5.14	4.53
query35	4.59	4.59	4.54
query36	0.65	0.49	0.48
query37	0.10	0.07	0.06
query38	0.04	0.04	0.03
query39	0.03	0.02	0.02
query40	0.17	0.14	0.13
query41	0.08	0.03	0.02
query42	0.04	0.03	0.03
query43	0.04	0.03	0.02
Total cold run time: 106.04 s
Total hot run time: 30.79 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 74.19% (23/31) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 47.98% (12828/26738)
Line Coverage 37.36% (109445/292983)
Region Coverage 36.49% (56089/153723)
Branch Coverage 31.78% (28271/88954)

@doris-robot

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

------ Round 1 ----------------------------------
q1	24417	5260	5044	5044
q2	2056	365	198	198
q3	10289	1289	694	694
q4	10227	1013	522	522
q5	7548	2409	2329	2329
q6	191	162	131	131
q7	917	755	596	596
q8	9306	1324	1043	1043
q9	4927	4825	4678	4678
q10	6818	2312	1898	1898
q11	490	270	265	265
q12	349	341	221	221
q13	17758	3713	3123	3123
q14	227	240	210	210
q15	528	479	466	466
q16	628	625	602	602
q17	572	891	328	328
q18	7089	6453	6386	6386
q19	1844	985	555	555
q20	335	333	189	189
q21	2761	2276	1996	1996
q22	1062	1033	983	983
Total cold run time: 110339 ms
Total hot run time: 32457 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5327	5110	5109	5109
q2	254	336	232	232
q3	2148	2631	2279	2279
q4	1435	1805	1385	1385
q5	4240	4174	4411	4174
q6	221	175	134	134
q7	2039	1917	1788	1788
q8	2624	2561	2625	2561
q9	7227	7269	7272	7269
q10	3006	3145	2742	2742
q11	591	521	491	491
q12	699	796	632	632
q13	3490	3893	3304	3304
q14	273	300	260	260
q15	541	493	500	493
q16	647	684	647	647
q17	1166	1616	1327	1327
q18	7772	7689	7501	7501
q19	805	839	970	839
q20	1947	2081	1924	1924
q21	5424	4819	4901	4819
q22	1138	1124	1048	1048
Total cold run time: 53014 ms
Total hot run time: 50958 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 190508 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 427878f979fbf3aa39b44610f7235d9620d0625f, data reload: false

query1	1392	1044	1004	1004
query2	6197	1923	1862	1862
query3	11126	4720	4627	4627
query4	57570	24651	22961	22961
query5	4916	520	468	468
query6	375	190	186	186
query7	4940	493	290	290
query8	334	250	239	239
query9	6392	2525	2515	2515
query10	400	311	243	243
query11	15053	15060	14756	14756
query12	157	108	107	107
query13	1074	504	403	403
query14	10925	6266	6682	6266
query15	193	212	195	195
query16	7188	664	489	489
query17	1104	722	624	624
query18	1593	408	316	316
query19	191	189	157	157
query20	123	121	145	121
query21	206	126	98	98
query22	4583	4502	4470	4470
query23	33781	33411	33410	33410
query24	5674	2411	2388	2388
query25	466	455	402	402
query26	677	277	165	165
query27	1843	498	336	336
query28	2830	2438	2421	2421
query29	571	563	434	434
query30	272	230	187	187
query31	871	858	800	800
query32	70	60	62	60
query33	451	390	321	321
query34	862	849	501	501
query35	789	823	741	741
query36	945	997	902	902
query37	128	102	71	71
query38	4256	4219	4141	4141
query39	1510	1434	1414	1414
query40	209	114	105	105
query41	55	50	50	50
query42	124	107	104	104
query43	485	487	487	487
query44	1313	806	797	797
query45	179	173	167	167
query46	846	1042	636	636
query47	1891	1886	1845	1845
query48	380	435	299	299
query49	702	491	436	436
query50	692	775	422	422
query51	4277	4368	4218	4218
query52	103	109	95	95
query53	233	260	190	190
query54	523	507	421	421
query55	85	86	85	85
query56	270	280	263	263
query57	1163	1181	1131	1131
query58	244	250	241	241
query59	2728	2716	2771	2716
query60	297	292	253	253
query61	128	122	122	122
query62	749	755	695	695
query63	239	190	187	187
query64	1639	1025	697	697
query65	4507	4521	4330	4330
query66	698	394	319	319
query67	16006	15393	15402	15393
query68	7657	813	498	498
query69	541	306	261	261
query70	1204	1118	1088	1088
query71	493	313	265	265
query72	5814	2676	3782	2676
query73	1196	750	334	334
query74	8963	9200	9047	9047
query75	3616	3131	2661	2661
query76	4193	1246	749	749
query77	646	349	281	281
query78	10099	10012	9301	9301
query79	2730	805	582	582
query80	691	514	498	498
query81	490	253	216	216
query82	650	131	92	92
query83	167	171	148	148
query84	292	89	69	69
query85	801	358	310	310
query86	406	309	311	309
query87	4437	4398	4355	4355
query88	3504	2181	2176	2176
query89	409	314	274	274
query90	1742	207	206	206
query91	134	147	110	110
query92	76	58	57	57
query93	2263	1055	577	577
query94	643	412	303	303
query95	345	259	255	255
query96	481	550	267	267
query97	3311	3382	3293	3293
query98	238	207	201	201
query99	1369	1378	1254	1254
Total cold run time: 302394 ms
Total hot run time: 190508 ms

@doris-robot

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

query1	0.04	0.04	0.04
query2	0.12	0.11	0.10
query3	0.24	0.19	0.19
query4	1.59	0.20	0.19
query5	0.62	0.59	0.57
query6	1.20	0.71	0.71
query7	0.02	0.02	0.01
query8	0.04	0.04	0.04
query9	0.58	0.52	0.54
query10	0.57	0.59	0.57
query11	0.16	0.11	0.11
query12	0.14	0.11	0.11
query13	0.61	0.59	0.60
query14	2.78	2.78	2.68
query15	0.93	0.85	0.83
query16	0.38	0.38	0.37
query17	1.00	1.04	1.01
query18	0.20	0.20	0.20
query19	1.94	1.87	1.83
query20	0.01	0.01	0.01
query21	15.35	0.92	0.55
query22	0.74	1.18	0.60
query23	14.99	1.39	0.62
query24	6.83	1.07	0.90
query25	0.53	0.08	0.27
query26	0.57	0.16	0.14
query27	0.05	0.06	0.05
query28	10.17	0.92	0.45
query29	12.52	3.99	3.31
query30	0.25	0.09	0.08
query31	2.81	0.60	0.40
query32	3.22	0.54	0.46
query33	3.12	3.00	3.10
query34	15.70	5.21	4.54
query35	4.63	4.53	4.55
query36	0.67	0.48	0.48
query37	0.08	0.07	0.07
query38	0.04	0.04	0.04
query39	0.03	0.02	0.02
query40	0.17	0.14	0.14
query41	0.07	0.03	0.03
query42	0.03	0.02	0.02
query43	0.04	0.04	0.03
Total cold run time: 105.78 s
Total hot run time: 31.22 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 86.57% (58/67) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 48.87% (13089/26784)
Line Coverage 38.42% (112773/293491)
Region Coverage 37.24% (57363/154021)
Branch Coverage 32.32% (28816/89160)

@xinyiZzz
xinyiZzz merged commit 65a26a4 into apache:master Mar 18, 2025
xinyiZzz added a commit to xinyiZzz/incubator-doris that referenced this pull request Mar 19, 2025
…/HLL/Decimal256 types (apache#48944)

Fix UT DataTypeSerDeArrowTest of Array/Map/Struct/Bitmap/HLL/Decimal256
types.

TODO:
1. Map and Struct types `deserialize_one_cell_from_json` has Bug, which
makes some cases unable to be tested by the framework. cannot test
Struct type nested Array and Map and Struct, so manually construct data
to test them. scalar type can be covered in the
`data_type_serde_arrow_test`.
2. Bitmap and HLL types only support Doris Column serialization to
Arrow, but not deserialization. Currently, only ArrowReader of Data Lake
uses deserialization Arrow -> Doris.
yiguolei pushed a commit that referenced this pull request Mar 20, 2025
…of Date/Datetime/Array/Map/Struct/Bitmap/HLL/Decimal256 types (#49244)

### What problem does this PR solve?

pick #48944 [fix](arrow) Fix UT DataTypeSerDeArrowTest of
Array/Map/Struct/Bitmap/HLL/Decimal256 types
pick #48398  [fix](arrow) Fix UT DataTypeSerDeArrowTest of Date type
xinyiZzz added a commit to xinyiZzz/incubator-doris that referenced this pull request Mar 28, 2025
…of Date/Datetime/Array/Map/Struct/Bitmap/HLL/Decimal256 types (apache#49244)

pick apache#48944 [fix](arrow) Fix UT DataTypeSerDeArrowTest of
Array/Map/Struct/Bitmap/HLL/Decimal256 types
pick apache#48398  [fix](arrow) Fix UT DataTypeSerDeArrowTest of Date type
xinyiZzz added a commit to xinyiZzz/incubator-doris that referenced this pull request Apr 30, 2025
…of Date/Datetime/Array/Map/Struct/Bitmap/HLL/Decimal256 types (apache#49244)

pick apache#48944 [fix](arrow) Fix UT DataTypeSerDeArrowTest of
Array/Map/Struct/Bitmap/HLL/Decimal256 types
pick apache#48398  [fix](arrow) Fix UT DataTypeSerDeArrowTest of Date type
dataroaring pushed a commit that referenced this pull request May 6, 2025
…of Date/Datetime/Array/Map/Struct/Bitmap/HLL/Decimal256 types (#49643)

pick #48944 [fix](arrow) Fix UT DataTypeSerDeArrowTest of
Array/Map/Struct/Bitmap/HLL/Decimal256 types
pick #48398  [fix](arrow) Fix UT DataTypeSerDeArrowTest of Date type
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
…/HLL/Decimal256 types (apache#48944)

### What problem does this PR solve?

Fix UT DataTypeSerDeArrowTest of Array/Map/Struct/Bitmap/HLL/Decimal256
types.

TODO:
1. Map and Struct types `deserialize_one_cell_from_json` has Bug, which
makes some cases unable to be tested by the framework. cannot test
Struct type nested Array and Map and Struct, so manually construct data
to test them. scalar type can be covered in the
`data_type_serde_arrow_test`.
2. Bitmap and HLL types only support Doris Column serialization to
Arrow, but not deserialization. Currently, only ArrowReader of Data Lake
uses deserialization Arrow -> Doris.
morningman added a commit to morningman/doris that referenced this pull request Oct 25, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#69581, apache#68649

Problem Summary:

Reproduction: read an Arrow Date32 array holding a day outside
0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897
(10000-01-01) written by PyArrow into a Lance dataset, or the same value
returned by an ADBC driver, an Arrow stream load or the paimon-rust reader.
The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and
MAP values.

Root cause: the DATE32 branch of the shared
`DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by
`get_date_from_daynr()` (dropped since apache#48944) and appends the
default-constructed value. It also adds the epoch offset in 32 bits, so
INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64
branch next to it already rejects out-of-range days.

Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots
append the default value without being decoded, the day number is computed
in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by
`get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is
outside the Doris DATE range: row=..., days=...")` with the 4.x wording.
ARRAY/STRUCT/MAP leaves get the same check through their element SerDes.
`write_column_to_arrow` and the year-zero calendar mapping (the other part of
apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days
whose meaning that mapping changes.

Before: out-of-range days read as `0000-00-00`. After: the read fails with
the error above; in-range values and NULLs read as before.

The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which
already contains apache#68649) relies on this SerDe check.

### Release note

Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow
stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00.

### Check List (For Author)

- Test: Unit Test
    - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`,
      `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`,
      `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`.
    - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`,
      `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`,
      `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`,
      `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch
      restored, the first two fail.
    - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on
      master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp`
      dereferences `std::set::end()`. It ran here with that assertion removed
      locally; that fix goes in a separate PR.
- Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31
  used to be returned as a non-null 0000-00-00; the scan now fails with an
  InvalidArgument error, as Arrow DATE64 values already did.
- Does this need documentation: No

Co-authored-by: Gabriel <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman added a commit to morningman/doris that referenced this pull request Oct 26, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#69581, apache#68649

Problem Summary:

Reproduction: read an Arrow Date32 array holding a day outside
0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897
(10000-01-01) written by PyArrow into a Lance dataset, or the same value
returned by an ADBC driver, an Arrow stream load or the paimon-rust reader.
The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and
MAP values.

Root cause: the DATE32 branch of the shared
`DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by
`get_date_from_daynr()` (dropped since apache#48944) and appends the
default-constructed value. It also adds the epoch offset in 32 bits, so
INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64
branch next to it already rejects out-of-range days.

Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots
append the default value without being decoded, the day number is computed
in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by
`get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is
outside the Doris DATE range: row=..., days=...")` with the 4.x wording.
ARRAY/STRUCT/MAP leaves get the same check through their element SerDes.
`write_column_to_arrow` and the year-zero calendar mapping (the other part of
apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days
whose meaning that mapping changes.

Before: out-of-range days read as `0000-00-00`. After: the read fails with
the error above; in-range values and NULLs read as before.

The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which
already contains apache#68649) relies on this SerDe check.

### Release note

Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow
stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00.

### Check List (For Author)

- Test: Unit Test
    - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`,
      `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`,
      `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`.
    - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`,
      `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`,
      `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`,
      `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch
      restored, the first two fail.
    - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on
      master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp`
      dereferences `std::set::end()`. It ran here with that assertion removed
      locally; that fix goes in a separate PR.
- Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31
  used to be returned as a non-null 0000-00-00; the scan now fails with an
  InvalidArgument error, as Arrow DATE64 values already did.
- Does this need documentation: No

Co-authored-by: Gabriel <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman added a commit to morningman/doris that referenced this pull request Oct 27, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#69581, apache#68649

Problem Summary:

Reproduction: read an Arrow Date32 array holding a day outside
0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897
(10000-01-01) written by PyArrow into a Lance dataset, or the same value
returned by an ADBC driver, an Arrow stream load or the paimon-rust reader.
The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and
MAP values.

Root cause: the DATE32 branch of the shared
`DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by
`get_date_from_daynr()` (dropped since apache#48944) and appends the
default-constructed value. It also adds the epoch offset in 32 bits, so
INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64
branch next to it already rejects out-of-range days.

Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots
append the default value without being decoded, the day number is computed
in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by
`get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is
outside the Doris DATE range: row=..., days=...")` with the 4.x wording.
ARRAY/STRUCT/MAP leaves get the same check through their element SerDes.
`write_column_to_arrow` and the year-zero calendar mapping (the other part of
apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days
whose meaning that mapping changes.

Before: out-of-range days read as `0000-00-00`. After: the read fails with
the error above; in-range values and NULLs read as before.

The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which
already contains apache#68649) relies on this SerDe check.

### Release note

Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow
stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00.

### Check List (For Author)

- Test: Unit Test
    - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`,
      `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`,
      `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`.
    - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`,
      `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`,
      `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`,
      `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch
      restored, the first two fail.
    - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on
      master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp`
      dereferences `std::set::end()`. It ran here with that assertion removed
      locally; that fix goes in a separate PR.
- Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31
  used to be returned as a non-null 0000-00-00; the scan now fails with an
  InvalidArgument error, as Arrow DATE64 values already did.
- Does this need documentation: No

Co-authored-by: Gabriel <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman added a commit to morningman/doris that referenced this pull request Oct 28, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#69581, apache#68649

Problem Summary:

Reproduction: read an Arrow Date32 array holding a day outside
0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897
(10000-01-01) written by PyArrow into a Lance dataset, or the same value
returned by an ADBC driver, an Arrow stream load or the paimon-rust reader.
The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and
MAP values.

Root cause: the DATE32 branch of the shared
`DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by
`get_date_from_daynr()` (dropped since apache#48944) and appends the
default-constructed value. It also adds the epoch offset in 32 bits, so
INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64
branch next to it already rejects out-of-range days.

Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots
append the default value without being decoded, the day number is computed
in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by
`get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is
outside the Doris DATE range: row=..., days=...")` with the 4.x wording.
ARRAY/STRUCT/MAP leaves get the same check through their element SerDes.
`write_column_to_arrow` and the year-zero calendar mapping (the other part of
apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days
whose meaning that mapping changes.

Before: out-of-range days read as `0000-00-00`. After: the read fails with
the error above; in-range values and NULLs read as before.

The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which
already contains apache#68649) relies on this SerDe check.

### Release note

Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow
stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00.

### Check List (For Author)

- Test: Unit Test
    - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`,
      `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`,
      `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`.
    - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`,
      `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`,
      `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`,
      `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch
      restored, the first two fail.
    - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on
      master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp`
      dereferences `std::set::end()`. It ran here with that assertion removed
      locally; that fix goes in a separate PR.
- Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31
  used to be returned as a non-null 0000-00-00; the scan now fails with an
  InvalidArgument error, as Arrow DATE64 values already did.
- Does this need documentation: No

Co-authored-by: Gabriel <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman added a commit to morningman/doris that referenced this pull request Oct 29, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#69581, apache#68649

Problem Summary:

Reproduction: read an Arrow Date32 array holding a day outside
0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897
(10000-01-01) written by PyArrow into a Lance dataset, or the same value
returned by an ADBC driver, an Arrow stream load or the paimon-rust reader.
The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and
MAP values.

Root cause: the DATE32 branch of the shared
`DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by
`get_date_from_daynr()` (dropped since apache#48944) and appends the
default-constructed value. It also adds the epoch offset in 32 bits, so
INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64
branch next to it already rejects out-of-range days.

Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots
append the default value without being decoded, the day number is computed
in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by
`get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is
outside the Doris DATE range: row=..., days=...")` with the 4.x wording.
ARRAY/STRUCT/MAP leaves get the same check through their element SerDes.
`write_column_to_arrow` and the year-zero calendar mapping (the other part of
apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days
whose meaning that mapping changes.

Before: out-of-range days read as `0000-00-00`. After: the read fails with
the error above; in-range values and NULLs read as before.

The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which
already contains apache#68649) relies on this SerDe check.

### Release note

Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow
stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00.

### Check List (For Author)

- Test: Unit Test
    - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`,
      `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`,
      `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`.
    - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`,
      `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`,
      `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`,
      `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch
      restored, the first two fail.
    - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on
      master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp`
      dereferences `std::set::end()`. It ran here with that assertion removed
      locally; that fix goes in a separate PR.
- Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31
  used to be returned as a non-null 0000-00-00; the scan now fails with an
  InvalidArgument error, as Arrow DATE64 values already did.
- Does this need documentation: No

Co-authored-by: Gabriel <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman added a commit to morningman/doris that referenced this pull request Oct 31, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#69581, apache#68649

Problem Summary:

Reproduction: read an Arrow Date32 array holding a day outside
0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897
(10000-01-01) written by PyArrow into a Lance dataset, or the same value
returned by an ADBC driver, an Arrow stream load or the paimon-rust reader.
The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and
MAP values.

Root cause: the DATE32 branch of the shared
`DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by
`get_date_from_daynr()` (dropped since apache#48944) and appends the
default-constructed value. It also adds the epoch offset in 32 bits, so
INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64
branch next to it already rejects out-of-range days.

Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots
append the default value without being decoded, the day number is computed
in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by
`get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is
outside the Doris DATE range: row=..., days=...")` with the 4.x wording.
ARRAY/STRUCT/MAP leaves get the same check through their element SerDes.
`write_column_to_arrow` and the year-zero calendar mapping (the other part of
apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days
whose meaning that mapping changes.

Before: out-of-range days read as `0000-00-00`. After: the read fails with
the error above; in-range values and NULLs read as before.

The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which
already contains apache#68649) relies on this SerDe check.

### Release note

Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow
stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00.

### Check List (For Author)

- Test: Unit Test
    - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`,
      `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`,
      `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`.
    - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`,
      `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`,
      `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`,
      `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch
      restored, the first two fail.
    - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on
      master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp`
      dereferences `std::set::end()`. It ran here with that assertion removed
      locally; that fix goes in a separate PR.
- Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31
  used to be returned as a non-null 0000-00-00; the scan now fails with an
  InvalidArgument error, as Arrow DATE64 values already did.
- Does this need documentation: No

Co-authored-by: Gabriel <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman added a commit to morningman/doris that referenced this pull request Nov 2, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#69581, apache#68649

Problem Summary:

Reproduction: read an Arrow Date32 array holding a day outside
0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897
(10000-01-01) written by PyArrow into a Lance dataset, or the same value
returned by an ADBC driver, an Arrow stream load or the paimon-rust reader.
The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and
MAP values.

Root cause: the DATE32 branch of the shared
`DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by
`get_date_from_daynr()` (dropped since apache#48944) and appends the
default-constructed value. It also adds the epoch offset in 32 bits, so
INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64
branch next to it already rejects out-of-range days.

Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots
append the default value without being decoded, the day number is computed
in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by
`get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is
outside the Doris DATE range: row=..., days=...")` with the 4.x wording.
ARRAY/STRUCT/MAP leaves get the same check through their element SerDes.
`write_column_to_arrow` and the year-zero calendar mapping (the other part of
apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days
whose meaning that mapping changes.

Before: out-of-range days read as `0000-00-00`. After: the read fails with
the error above; in-range values and NULLs read as before.

The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which
already contains apache#68649) relies on this SerDe check.

### Release note

Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow
stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00.

### Check List (For Author)

- Test: Unit Test
    - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`,
      `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`,
      `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`.
    - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`,
      `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`,
      `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`,
      `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch
      restored, the first two fail.
    - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on
      master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp`
      dereferences `std::set::end()`. It ran here with that assertion removed
      locally; that fix goes in a separate PR.
- Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31
  used to be returned as a non-null 0000-00-00; the scan now fails with an
  InvalidArgument error, as Arrow DATE64 values already did.
- Does this need documentation: No

Co-authored-by: Gabriel <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman added a commit to morningman/doris that referenced this pull request Nov 5, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#69581, apache#68649

Problem Summary:

Reproduction: read an Arrow Date32 array holding a day outside
0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897
(10000-01-01) written by PyArrow into a Lance dataset, or the same value
returned by an ADBC driver, an Arrow stream load or the paimon-rust reader.
The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and
MAP values.

Root cause: the DATE32 branch of the shared
`DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by
`get_date_from_daynr()` (dropped since apache#48944) and appends the
default-constructed value. It also adds the epoch offset in 32 bits, so
INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64
branch next to it already rejects out-of-range days.

Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots
append the default value without being decoded, the day number is computed
in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by
`get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is
outside the Doris DATE range: row=..., days=...")` with the 4.x wording.
ARRAY/STRUCT/MAP leaves get the same check through their element SerDes.
`write_column_to_arrow` and the year-zero calendar mapping (the other part of
apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days
whose meaning that mapping changes.

Before: out-of-range days read as `0000-00-00`. After: the read fails with
the error above; in-range values and NULLs read as before.

The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which
already contains apache#68649) relies on this SerDe check.

### Release note

Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow
stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00.

### Check List (For Author)

- Test: Unit Test
    - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`,
      `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`,
      `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`.
    - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`,
      `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`,
      `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`,
      `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch
      restored, the first two fail.
    - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on
      master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp`
      dereferences `std::set::end()`. It ran here with that assertion removed
      locally; that fix goes in a separate PR.
- Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31
  used to be returned as a non-null 0000-00-00; the scan now fails with an
  InvalidArgument error, as Arrow DATE64 values already did.
- Does this need documentation: No

Co-authored-by: Gabriel <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants