Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enchement](schema change)Standardize the behavior after a table schema change. #47471

Merged
merged 3 commits into from
Feb 28, 2025

Conversation

hubgeter
Copy link
Contributor

@hubgeter hubgeter commented Jan 27, 2025

What problem does this PR solve?

Related PR: #32873

Problem Summary:

Explicitly defines the behavior of column type conversions.

image

Special notes are as follows:

String => boolean: In Parquet, only "false", "off", "no", "0", and an empty string ("") are considered false; otherwise, it is true. In Orc, a string can be parsed as a number, and if that number is 0, it is considered false; otherwise, it is true. If parsing the number fails, it results in null.

Conversion between Int/smallint/tinyint/bigint:
Unless the conversion can be perfectly represented, an error will be reported.
For example:
Bigint column => smallint column
Reason: [INTERNAL_ERROR] Failed to cast value '9223372036854775807' to Nullable(Int16) column.

Conversion between Decimal:
Unless the conversion can be perfectly done, an error will be reported.

String => Int/smallint/tinyint/bigint:
It can be successfully converted to a number, and the number can be correctly stored. Otherwise, the result is null.

Int/smallint/tinyint/bigint => float:
The conversion is successful only if abs(number type) < 2^23.

Int/smallint/tinyint/bigint => double:
The conversion is successful only if abs(number type) < 2^52.

Decimal => Int/smallint/tinyint/bigint:
If the integer part of the decimal can be perfectly stored, only the integer part will be shown; otherwise, it will result in null.

Float => double:
Refer to the C++ static_cast(float).

Decimal => float/double:
Attempt to store the approximate value.

Boolean => string:
The conversion will result in “TRUE” or “FALSE”.

TODO: conversion to char/varchar type requires truncation.

Release note

None

Check List (For Author)

  • Test

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

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

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

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

@Thearas
Copy link
Contributor

Thearas commented Jan 27, 2025

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

Please clearly describe your PR:

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

@hubgeter
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17575	5967	5409	5409
q2	2044	301	168	168
q3	10436	1272	741	741
q4	10230	977	526	526
q5	8039	2365	2141	2141
q6	200	162	132	132
q7	908	769	593	593
q8	9236	1360	1149	1149
q9	5225	4924	4939	4924
q10	6837	2334	1908	1908
q11	484	273	263	263
q12	351	352	221	221
q13	17925	3863	3236	3236
q14	234	237	206	206
q15	515	494	468	468
q16	633	615	601	601
q17	602	889	353	353
q18	7118	6365	6295	6295
q19	1791	956	549	549
q20	307	313	202	202
q21	2900	2271	2057	2057
q22	370	339	310	310
Total cold run time: 103960 ms
Total hot run time: 32452 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5573	5500	5522	5500
q2	235	327	238	238
q3	2312	2683	2316	2316
q4	1482	1825	1401	1401
q5	4382	4744	4746	4744
q6	176	166	132	132
q7	2041	1990	1878	1878
q8	2633	2842	2731	2731
q9	7216	7243	7229	7229
q10	3046	3313	2776	2776
q11	575	511	475	475
q12	633	722	635	635
q13	3535	4010	3328	3328
q14	295	296	269	269
q15	527	476	471	471
q16	660	679	651	651
q17	1259	1752	1259	1259
q18	7787	7536	7223	7223
q19	793	1184	1082	1082
q20	2011	2031	1911	1911
q21	5868	5125	5023	5023
q22	597	634	595	595
Total cold run time: 53636 ms
Total hot run time: 51867 ms

@doris-robot
Copy link

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

query1	1348	971	933	933
query2	6297	1950	2078	1950
query3	10999	4511	4517	4511
query4	60844	28622	22925	22925
query5	5555	598	450	450
query6	442	208	187	187
query7	5547	508	303	303
query8	330	239	231	231
query9	8419	2719	2703	2703
query10	443	312	251	251
query11	17922	15135	15554	15135
query12	153	107	110	107
query13	1454	561	403	403
query14	11469	7501	7276	7276
query15	216	207	194	194
query16	7275	658	514	514
query17	1156	758	599	599
query18	1935	410	327	327
query19	206	191	173	173
query20	126	117	110	110
query21	210	125	108	108
query22	4586	4706	4614	4614
query23	34069	33333	33462	33333
query24	5459	2383	2398	2383
query25	479	509	390	390
query26	673	278	166	166
query27	1913	469	332	332
query28	4264	2505	2504	2504
query29	572	571	422	422
query30	208	187	152	152
query31	934	877	832	832
query32	67	62	60	60
query33	426	354	308	308
query34	730	883	529	529
query35	834	833	759	759
query36	1012	1065	982	982
query37	121	107	74	74
query38	4454	4308	4367	4308
query39	1502	1467	1429	1429
query40	201	121	106	106
query41	50	52	48	48
query42	118	105	102	102
query43	523	524	507	507
query44	1353	864	855	855
query45	182	181	173	173
query46	904	1074	660	660
query47	1873	1930	1866	1866
query48	388	414	325	325
query49	726	520	427	427
query50	663	677	410	410
query51	4339	4305	4273	4273
query52	105	102	96	96
query53	229	266	193	193
query54	489	516	410	410
query55	83	78	85	78
query56	274	265	255	255
query57	1201	1230	1159	1159
query58	237	235	237	235
query59	3261	3368	3075	3075
query60	268	263	250	250
query61	115	113	109	109
query62	723	722	647	647
query63	226	197	190	190
query64	1288	1001	691	691
query65	3243	3144	3127	3127
query66	760	391	290	290
query67	16016	15798	15275	15275
query68	5001	831	533	533
query69	480	296	255	255
query70	1210	1151	1129	1129
query71	392	275	302	275
query72	6110	3891	3751	3751
query73	767	751	368	368
query74	9758	9153	8765	8765
query75	3207	3184	2705	2705
query76	3793	1156	759	759
query77	469	353	279	279
query78	10070	10070	9400	9400
query79	2325	847	618	618
query80	687	510	464	464
query81	516	279	237	237
query82	292	150	120	120
query83	172	176	147	147
query84	288	94	76	76
query85	729	365	302	302
query86	349	320	297	297
query87	4638	4453	4406	4406
query88	3218	2215	2266	2215
query89	402	324	307	307
query90	1611	193	188	188
query91	135	133	110	110
query92	59	54	52	52
query93	1843	872	541	541
query94	655	414	305	305
query95	334	264	247	247
query96	496	623	280	280
query97	2820	2891	2766	2766
query98	225	203	199	199
query99	1302	1342	1249	1249
Total cold run time: 308840 ms
Total hot run time: 192144 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.07	0.03	0.03
query3	0.24	0.07	0.07
query4	1.61	0.11	0.10
query5	0.44	0.41	0.38
query6	1.17	0.65	0.66
query7	0.02	0.02	0.01
query8	0.04	0.03	0.04
query9	0.60	0.49	0.49
query10	0.56	0.58	0.56
query11	0.15	0.10	0.11
query12	0.13	0.10	0.11
query13	0.62	0.60	0.60
query14	2.72	2.78	2.74
query15	0.88	0.82	0.82
query16	0.38	0.39	0.38
query17	1.01	1.05	0.98
query18	0.24	0.21	0.19
query19	1.96	1.86	1.99
query20	0.01	0.01	0.01
query21	15.39	0.93	0.58
query22	0.77	0.79	0.73
query23	15.19	1.43	0.62
query24	4.48	0.77	0.96
query25	0.19	0.11	0.10
query26	0.33	0.16	0.14
query27	0.05	0.07	0.04
query28	13.47	1.00	0.43
query29	12.60	3.88	3.28
query30	0.25	0.08	0.06
query31	2.84	0.58	0.39
query32	3.23	0.54	0.46
query33	2.96	3.06	3.02
query34	16.30	5.13	4.49
query35	4.48	4.48	4.46
query36	0.65	0.49	0.49
query37	0.09	0.06	0.06
query38	0.05	0.04	0.03
query39	0.04	0.03	0.02
query40	0.15	0.12	0.13
query41	0.07	0.03	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.04
Total cold run time: 106.54 s
Total hot run time: 30.49 s

@hubgeter
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17575	5473	5405	5405
q2	2052	301	162	162
q3	10448	1235	763	763
q4	10220	970	535	535
q5	7665	2357	2168	2168
q6	191	174	132	132
q7	905	755	622	622
q8	9222	1342	1144	1144
q9	5171	4870	4887	4870
q10	6838	2318	1926	1926
q11	467	282	259	259
q12	337	359	225	225
q13	17758	3704	3078	3078
q14	232	229	212	212
q15	526	481	460	460
q16	631	614	597	597
q17	555	866	317	317
q18	6932	6598	6568	6568
q19	2520	984	562	562
q20	309	331	204	204
q21	2960	2180	2021	2021
q22	360	340	309	309
Total cold run time: 103874 ms
Total hot run time: 32539 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5615	5450	5516	5450
q2	244	323	230	230
q3	2293	2641	2353	2353
q4	1433	1827	1379	1379
q5	4339	4729	4580	4580
q6	163	155	131	131
q7	2075	1985	1866	1866
q8	2636	2838	2671	2671
q9	7315	7300	7243	7243
q10	3011	3309	2796	2796
q11	578	510	497	497
q12	667	746	584	584
q13	3534	3956	3304	3304
q14	290	290	285	285
q15	516	473	470	470
q16	662	684	656	656
q17	1231	1719	1297	1297
q18	7723	7404	7153	7153
q19	803	1087	1147	1087
q20	2005	2047	1868	1868
q21	5825	5249	4822	4822
q22	591	583	556	556
Total cold run time: 53549 ms
Total hot run time: 51278 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192302 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 99ccfa2ec3c5dbae8c4c2da779d408a9c5839fd2, data reload: false

query1	1321	922	928	922
query2	6207	2122	2088	2088
query3	10999	4595	4467	4467
query4	32713	23329	23514	23329
query5	3849	611	463	463
query6	295	202	186	186
query7	3992	489	308	308
query8	299	255	235	235
query9	9501	2654	2661	2654
query10	455	306	259	259
query11	17516	15088	15002	15002
query12	158	107	103	103
query13	1557	519	385	385
query14	8673	7091	7096	7091
query15	255	210	193	193
query16	7750	624	477	477
query17	1617	711	596	596
query18	2068	425	345	345
query19	224	195	165	165
query20	125	117	120	117
query21	224	129	116	116
query22	4588	4707	4184	4184
query23	34224	33828	33242	33242
query24	6409	2349	2325	2325
query25	490	496	432	432
query26	801	279	166	166
query27	2111	468	347	347
query28	5333	2508	2472	2472
query29	580	601	433	433
query30	216	197	169	169
query31	919	899	804	804
query32	80	67	59	59
query33	497	363	329	329
query34	745	883	528	528
query35	822	833	747	747
query36	1008	1046	985	985
query37	128	98	85	85
query38	4347	4302	4276	4276
query39	1717	1425	1423	1423
query40	221	118	106	106
query41	54	53	52	52
query42	120	109	107	107
query43	541	549	521	521
query44	1387	823	824	823
query45	194	172	171	171
query46	895	1051	652	652
query47	1874	1891	1823	1823
query48	390	424	326	326
query49	733	530	405	405
query50	675	678	408	408
query51	4371	4271	4241	4241
query52	117	112	103	103
query53	237	255	206	206
query54	513	512	426	426
query55	89	80	77	77
query56	275	270	245	245
query57	1189	1175	1143	1143
query58	257	232	228	228
query59	3337	3436	3355	3355
query60	287	281	252	252
query61	120	121	127	121
query62	812	755	678	678
query63	230	203	195	195
query64	3659	1039	706	706
query65	3398	3265	3249	3249
query66	878	410	306	306
query67	16219	15549	15370	15370
query68	5434	828	546	546
query69	498	298	260	260
query70	1190	1154	1087	1087
query71	374	293	256	256
query72	5906	3837	3916	3837
query73	669	759	363	363
query74	10349	9104	9059	9059
query75	3179	3155	2670	2670
query76	3095	1242	783	783
query77	464	372	278	278
query78	10037	10203	9364	9364
query79	2771	841	605	605
query80	1359	543	458	458
query81	546	270	234	234
query82	348	151	120	120
query83	172	168	155	155
query84	242	91	78	78
query85	734	350	303	303
query86	404	309	304	304
query87	4532	4508	4317	4317
query88	4383	2177	2122	2122
query89	382	326	291	291
query90	1804	190	198	190
query91	135	138	118	118
query92	67	55	54	54
query93	2642	878	534	534
query94	730	401	307	307
query95	329	275	261	261
query96	494	619	278	278
query97	2770	2818	2813	2813
query98	225	207	204	204
query99	1326	1379	1251	1251
Total cold run time: 285475 ms
Total hot run time: 192302 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.04
query2	0.06	0.04	0.03
query3	0.24	0.07	0.07
query4	1.62	0.11	0.10
query5	0.42	0.40	0.41
query6	1.13	0.66	0.65
query7	0.02	0.02	0.01
query8	0.04	0.03	0.03
query9	0.58	0.50	0.50
query10	0.55	0.56	0.54
query11	0.14	0.10	0.11
query12	0.14	0.10	0.10
query13	0.60	0.60	0.60
query14	2.75	2.78	2.88
query15	0.89	0.83	0.86
query16	0.39	0.38	0.38
query17	1.06	0.99	1.03
query18	0.23	0.20	0.20
query19	1.88	1.88	1.99
query20	0.01	0.01	0.01
query21	15.35	0.92	0.58
query22	0.75	0.85	0.72
query23	15.26	1.48	0.51
query24	2.61	1.29	1.31
query25	0.17	0.23	0.07
query26	0.27	0.15	0.14
query27	0.08	0.05	0.05
query28	14.06	1.04	0.44
query29	12.62	3.90	3.22
query30	0.25	0.09	0.07
query31	2.80	0.59	0.40
query32	3.22	0.55	0.46
query33	2.98	3.05	3.13
query34	16.76	5.08	4.56
query35	4.56	4.53	4.47
query36	0.64	0.50	0.48
query37	0.10	0.06	0.05
query38	0.05	0.04	0.03
query39	0.04	0.02	0.02
query40	0.17	0.14	0.13
query41	0.07	0.02	0.02
query42	0.04	0.03	0.02
query43	0.03	0.03	0.03
Total cold run time: 105.67 s
Total hot run time: 31.05 s

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 42.07% (10997/26138)
Line Coverage: 32.33% (92880/287262)
Region Coverage: 31.50% (47643/151248)
Branch Coverage: 27.56% (24122/87512)
Coverage Report: http://coverage.selectdb-in.cc/coverage/99ccfa2ec3c5dbae8c4c2da779d408a9c5839fd2_99ccfa2ec3c5dbae8c4c2da779d408a9c5839fd2/report/index.html

@hubgeter hubgeter force-pushed the schema_change branch 3 times, most recently from 0250377 to 337ca4f Compare February 14, 2025 04:32
@hubgeter
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17574	5257	5112	5112
q2	2063	294	164	164
q3	10415	1283	749	749
q4	10217	1016	548	548
q5	7539	2423	2335	2335
q6	194	171	134	134
q7	910	757	598	598
q8	9305	1310	1126	1126
q9	4813	4724	4788	4724
q10	6827	2312	1882	1882
q11	461	269	245	245
q12	349	354	218	218
q13	17778	3690	3108	3108
q14	215	219	212	212
q15	503	470	460	460
q16	628	613	595	595
q17	557	886	342	342
q18	7044	6202	6190	6190
q19	1210	941	555	555
q20	314	333	202	202
q21	2893	2242	1966	1966
q22	376	329	309	309
Total cold run time: 102185 ms
Total hot run time: 31774 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5195	5203	5161	5161
q2	234	328	228	228
q3	2122	2638	2237	2237
q4	1473	1823	1389	1389
q5	4253	4121	4163	4121
q6	205	164	126	126
q7	1871	1785	1741	1741
q8	2596	2683	2575	2575
q9	7176	7110	7121	7110
q10	3007	3191	2806	2806
q11	564	506	493	493
q12	685	744	628	628
q13	3524	3979	3324	3324
q14	276	306	272	272
q15	503	471	479	471
q16	642	665	637	637
q17	1154	1530	1378	1378
q18	7592	7398	7361	7361
q19	788	815	920	815
q20	1940	2013	1871	1871
q21	5450	4959	4765	4765
q22	643	587	520	520
Total cold run time: 51893 ms
Total hot run time: 50029 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 189473 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 337ca4f0a2458dfcc0db3d1cfce39fb5ce1a9c5a, data reload: false

query1	1316	947	949	947
query2	6211	1983	1908	1908
query3	11020	4425	4339	4339
query4	54132	25392	22864	22864
query5	5324	535	478	478
query6	435	196	181	181
query7	5452	503	298	298
query8	335	253	228	228
query9	7704	2483	2499	2483
query10	428	290	241	241
query11	15444	15266	15115	15115
query12	152	105	105	105
query13	1386	510	374	374
query14	9977	6609	6444	6444
query15	207	194	185	185
query16	7063	657	500	500
query17	1095	749	585	585
query18	1514	417	327	327
query19	204	201	174	174
query20	125	134	125	125
query21	208	120	105	105
query22	4341	4506	4308	4308
query23	33846	33241	33332	33241
query24	5695	2421	2451	2421
query25	464	447	405	405
query26	721	275	155	155
query27	1926	472	331	331
query28	2724	2467	2412	2412
query29	575	552	427	427
query30	217	190	153	153
query31	883	893	806	806
query32	75	95	58	58
query33	462	361	295	295
query34	769	839	515	515
query35	809	847	754	754
query36	983	993	931	931
query37	116	101	73	73
query38	4263	4469	4206	4206
query39	1530	1447	1399	1399
query40	229	126	102	102
query41	54	54	51	51
query42	121	108	109	108
query43	519	542	494	494
query44	1306	810	814	810
query45	174	174	169	169
query46	894	1066	662	662
query47	1865	1859	1806	1806
query48	402	412	319	319
query49	688	512	437	437
query50	717	749	427	427
query51	4260	4324	4307	4307
query52	106	101	99	99
query53	235	260	196	196
query54	484	497	405	405
query55	87	79	81	79
query56	268	263	265	263
query57	1140	1164	1125	1125
query58	235	235	243	235
query59	2896	2883	2845	2845
query60	284	270	260	260
query61	118	115	120	115
query62	758	756	690	690
query63	226	190	189	189
query64	1788	1051	655	655
query65	3211	3125	3095	3095
query66	781	399	296	296
query67	15984	15481	15459	15459
query68	5310	772	526	526
query69	523	303	256	256
query70	1181	1130	1112	1112
query71	434	297	246	246
query72	5949	3589	3771	3589
query73	991	748	352	352
query74	8894	9164	8686	8686
query75	3231	3130	2688	2688
query76	3921	1165	728	728
query77	530	378	280	280
query78	10017	10020	9418	9418
query79	2561	817	599	599
query80	643	506	458	458
query81	512	277	228	228
query82	216	130	96	96
query83	169	185	154	154
query84	293	91	71	71
query85	790	347	293	293
query86	373	311	271	271
query87	4475	4576	4370	4370
query88	3559	2212	2207	2207
query89	430	316	289	289
query90	1776	190	189	189
query91	131	132	108	108
query92	73	58	56	56
query93	2220	991	571	571
query94	664	406	293	293
query95	337	266	256	256
query96	475	557	268	268
query97	2807	2859	2755	2755
query98	225	209	207	207
query99	1298	1381	1259	1259
Total cold run time: 294969 ms
Total hot run time: 189473 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.08	0.03	0.03
query3	0.24	0.06	0.07
query4	1.61	0.10	0.10
query5	0.42	0.42	0.39
query6	1.17	0.68	0.65
query7	0.02	0.01	0.02
query8	0.04	0.03	0.03
query9	0.59	0.52	0.51
query10	0.58	0.56	0.55
query11	0.15	0.10	0.10
query12	0.14	0.11	0.12
query13	0.61	0.59	0.61
query14	2.68	2.75	2.84
query15	0.90	0.85	0.84
query16	0.37	0.37	0.38
query17	1.02	0.99	1.00
query18	0.21	0.20	0.20
query19	1.84	1.78	1.90
query20	0.02	0.01	0.02
query21	15.39	0.91	0.54
query22	0.76	1.27	0.62
query23	14.89	1.39	0.63
query24	10.30	1.86	0.83
query25	0.55	0.26	0.10
query26	0.97	0.18	0.13
query27	0.05	0.04	0.04
query28	6.47	0.74	0.41
query29	12.53	3.93	3.24
query30	0.25	0.10	0.06
query31	2.82	0.57	0.37
query32	3.22	0.56	0.47
query33	2.96	2.97	3.04
query34	15.80	5.09	4.52
query35	4.51	4.49	4.48
query36	0.64	0.49	0.48
query37	0.09	0.06	0.06
query38	0.05	0.03	0.03
query39	0.03	0.03	0.03
query40	0.17	0.14	0.12
query41	0.07	0.03	0.02
query42	0.04	0.02	0.03
query43	0.04	0.03	0.02
Total cold run time: 105.32 s
Total hot run time: 30.29 s

@hubgeter
Copy link
Contributor Author

run buildall

@hubgeter hubgeter marked this pull request as ready for review February 14, 2025 10:44
@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17629	5168	5115	5115
q2	2051	302	167	167
q3	10408	1243	728	728
q4	10193	995	530	530
q5	7510	2301	2364	2301
q6	186	169	131	131
q7	886	760	600	600
q8	9283	1322	1127	1127
q9	4950	4614	4737	4614
q10	6812	2305	1877	1877
q11	492	267	252	252
q12	341	347	214	214
q13	17880	3721	3075	3075
q14	219	227	206	206
q15	496	453	460	453
q16	619	607	589	589
q17	566	866	333	333
q18	6558	6231	6222	6222
q19	1912	959	531	531
q20	311	318	188	188
q21	2768	2108	1904	1904
q22	358	335	298	298
Total cold run time: 102428 ms
Total hot run time: 31455 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5142	5067	5078	5067
q2	232	328	227	227
q3	2091	2671	2305	2305
q4	1451	1831	1400	1400
q5	4212	4128	4152	4128
q6	203	163	122	122
q7	1851	1819	1644	1644
q8	2571	2613	2641	2613
q9	7207	7206	7120	7120
q10	2983	3184	2773	2773
q11	576	524	486	486
q12	673	762	598	598
q13	3548	3757	4052	3757
q14	293	307	271	271
q15	492	454	463	454
q16	644	682	651	651
q17	1123	1579	1314	1314
q18	7588	7359	7315	7315
q19	789	821	936	821
q20	1954	1985	1898	1898
q21	5389	4907	4677	4677
q22	618	577	530	530
Total cold run time: 51630 ms
Total hot run time: 50171 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 188909 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 52a77d03032d4f0bec872aaae3416e933f087de2, data reload: false

query1	1313	947	937	937
query2	6160	1891	1796	1796
query3	10966	4388	4235	4235
query4	54046	25373	22991	22991
query5	5104	622	482	482
query6	327	186	189	186
query7	4868	522	297	297
query8	300	240	218	218
query9	5627	2477	2477	2477
query10	436	302	256	256
query11	15151	15069	14886	14886
query12	156	107	103	103
query13	1033	497	372	372
query14	10475	6518	6251	6251
query15	220	196	180	180
query16	7070	664	456	456
query17	1090	722	567	567
query18	1480	405	341	341
query19	226	196	166	166
query20	130	126	132	126
query21	218	132	114	114
query22	4316	4501	4498	4498
query23	33820	33246	33404	33246
query24	6126	2477	2448	2448
query25	446	473	385	385
query26	691	269	157	157
query27	2021	500	328	328
query28	2891	2411	2393	2393
query29	575	544	441	441
query30	210	183	160	160
query31	920	874	777	777
query32	73	63	63	63
query33	455	390	288	288
query34	766	856	518	518
query35	806	836	759	759
query36	965	1026	881	881
query37	130	99	70	70
query38	4287	4269	4209	4209
query39	1510	1683	1455	1455
query40	197	109	99	99
query41	50	47	52	47
query42	123	109	104	104
query43	506	535	494	494
query44	1289	796	797	796
query45	177	170	161	161
query46	882	1053	648	648
query47	1842	1853	1776	1776
query48	388	431	306	306
query49	678	527	416	416
query50	704	782	425	425
query51	4318	4297	4180	4180
query52	104	108	98	98
query53	226	266	186	186
query54	473	489	420	420
query55	84	86	82	82
query56	270	253	263	253
query57	1154	1232	1149	1149
query58	236	238	230	230
query59	2768	2935	2668	2668
query60	281	297	269	269
query61	118	120	116	116
query62	752	758	685	685
query63	229	193	194	193
query64	1848	1039	650	650
query65	3206	3180	3150	3150
query66	737	381	299	299
query67	15860	15623	15444	15444
query68	5605	773	515	515
query69	516	288	264	264
query70	1220	1175	1134	1134
query71	464	295	263	263
query72	6356	3594	3809	3594
query73	1360	741	342	342
query74	9022	9283	8965	8965
query75	3216	3131	2692	2692
query76	3878	1162	742	742
query77	519	377	277	277
query78	10002	10136	9286	9286
query79	2469	812	597	597
query80	590	516	441	441
query81	510	273	240	240
query82	547	134	95	95
query83	170	170	142	142
query84	278	85	77	77
query85	759	349	295	295
query86	346	321	278	278
query87	4508	4475	4486	4475
query88	3554	2172	2125	2125
query89	405	310	283	283
query90	1632	184	190	184
query91	139	130	106	106
query92	77	61	53	53
query93	1857	1011	571	571
query94	731	391	295	295
query95	371	264	256	256
query96	480	568	261	261
query97	2877	2862	2728	2728
query98	246	202	200	200
query99	1372	1375	1276	1276
Total cold run time: 292980 ms
Total hot run time: 188909 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.04
query2	0.07	0.03	0.03
query3	0.23	0.07	0.07
query4	1.63	0.10	0.10
query5	0.41	0.40	0.41
query6	1.17	0.68	0.65
query7	0.02	0.01	0.01
query8	0.04	0.03	0.04
query9	0.59	0.51	0.53
query10	0.57	0.57	0.57
query11	0.15	0.10	0.10
query12	0.14	0.10	0.11
query13	0.61	0.59	0.60
query14	2.68	2.74	2.70
query15	0.92	0.84	0.84
query16	0.37	0.39	0.39
query17	1.06	1.00	1.02
query18	0.22	0.19	0.20
query19	1.87	1.81	1.97
query20	0.02	0.01	0.02
query21	15.37	0.90	0.55
query22	0.76	1.18	0.70
query23	14.89	1.38	0.60
query24	11.49	1.00	0.42
query25	0.28	0.16	0.12
query26	0.98	0.20	0.13
query27	0.04	0.04	0.05
query28	6.24	0.74	0.42
query29	12.52	3.91	3.30
query30	0.25	0.10	0.06
query31	2.83	0.58	0.38
query32	3.22	0.55	0.46
query33	2.93	3.00	3.08
query34	15.65	5.09	4.45
query35	4.55	4.57	4.47
query36	0.66	0.49	0.49
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.02
query40	0.17	0.13	0.13
query41	0.08	0.02	0.02
query42	0.04	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 105.96 s
Total hot run time: 30.04 s

@hubgeter
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17620	5207	5054	5054
q2	2051	304	171	171
q3	10492	1250	732	732
q4	10209	991	525	525
q5	7530	2309	2334	2309
q6	178	165	136	136
q7	882	751	592	592
q8	9298	1267	1096	1096
q9	4883	4711	4755	4711
q10	6872	2311	1868	1868
q11	474	267	247	247
q12	349	349	218	218
q13	17772	3711	3068	3068
q14	222	220	203	203
q15	505	486	463	463
q16	628	625	574	574
q17	574	864	339	339
q18	6612	6279	6332	6279
q19	1683	954	553	553
q20	312	324	192	192
q21	2790	2140	1961	1961
q22	360	331	307	307
Total cold run time: 102296 ms
Total hot run time: 31598 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5218	5145	5132	5132
q2	232	322	231	231
q3	2119	2670	2315	2315
q4	1392	1804	1372	1372
q5	4226	4247	4135	4135
q6	212	164	124	124
q7	1853	1845	1665	1665
q8	2597	2536	2527	2527
q9	7205	7128	7066	7066
q10	3003	3212	2746	2746
q11	586	531	485	485
q12	683	760	622	622
q13	3521	3828	3341	3341
q14	294	299	275	275
q15	507	472	467	467
q16	642	671	624	624
q17	1111	1584	1326	1326
q18	7607	7265	7489	7265
q19	784	811	811	811
q20	1957	2019	1870	1870
q21	5460	5095	4736	4736
q22	612	578	555	555
Total cold run time: 51821 ms
Total hot run time: 49690 ms

@doris-robot
Copy link

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

query1	1301	961	948	948
query2	6190	1914	1895	1895
query3	10979	4581	4446	4446
query4	53921	24651	22975	22975
query5	5271	528	477	477
query6	400	203	186	186
query7	5341	518	286	286
query8	331	238	231	231
query9	7099	2504	2521	2504
query10	432	306	249	249
query11	15395	15134	14968	14968
query12	151	108	106	106
query13	1255	511	391	391
query14	10199	6538	6379	6379
query15	193	189	167	167
query16	6919	664	497	497
query17	1085	710	587	587
query18	1537	403	316	316
query19	204	193	176	176
query20	126	123	171	123
query21	215	124	104	104
query22	4420	4633	4584	4584
query23	34042	33516	33274	33274
query24	5848	2435	2401	2401
query25	463	471	393	393
query26	716	284	157	157
query27	2056	491	336	336
query28	2980	2428	2410	2410
query29	612	560	418	418
query30	222	189	158	158
query31	879	858	819	819
query32	76	64	65	64
query33	440	370	292	292
query34	795	847	506	506
query35	781	830	750	750
query36	966	994	901	901
query37	119	102	73	73
query38	4254	4398	4151	4151
query39	1469	1511	1481	1481
query40	214	113	99	99
query41	58	56	48	48
query42	119	104	101	101
query43	501	531	475	475
query44	1306	801	789	789
query45	178	176	163	163
query46	872	1050	645	645
query47	1909	1896	1893	1893
query48	387	424	317	317
query49	718	487	441	441
query50	697	764	414	414
query51	4242	4259	4244	4244
query52	112	108	92	92
query53	234	259	191	191
query54	494	498	420	420
query55	85	82	82	82
query56	278	263	273	263
query57	1202	1190	1093	1093
query58	243	244	235	235
query59	2915	2957	2755	2755
query60	282	276	266	266
query61	117	116	119	116
query62	755	742	677	677
query63	230	192	189	189
query64	1643	1015	663	663
query65	3321	3237	3116	3116
query66	714	392	297	297
query67	15837	15605	15404	15404
query68	5597	761	501	501
query69	526	312	286	286
query70	1180	1089	1082	1082
query71	477	297	275	275
query72	6014	3647	3683	3647
query73	961	757	341	341
query74	9208	9048	8770	8770
query75	3228	3150	2706	2706
query76	4033	1155	720	720
query77	533	356	276	276
query78	10146	9974	9373	9373
query79	2503	794	590	590
query80	668	534	446	446
query81	494	279	234	234
query82	453	124	94	94
query83	178	166	150	150
query84	293	90	68	68
query85	759	347	296	296
query86	396	302	300	300
query87	4323	4517	4482	4482
query88	3571	2158	2156	2156
query89	405	312	281	281
query90	1764	189	190	189
query91	134	136	104	104
query92	74	58	54	54
query93	2362	992	573	573
query94	703	383	280	280
query95	347	263	258	258
query96	485	551	273	273
query97	2779	2890	2719	2719
query98	243	208	201	201
query99	1330	1402	1233	1233
Total cold run time: 295512 ms
Total hot run time: 189625 ms

@doris-robot
Copy link

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

query1	0.03	0.04	0.03
query2	0.07	0.04	0.03
query3	0.24	0.06	0.07
query4	1.63	0.10	0.10
query5	0.42	0.43	0.39
query6	1.19	0.66	0.67
query7	0.02	0.02	0.02
query8	0.04	0.03	0.03
query9	0.59	0.52	0.53
query10	0.57	0.58	0.56
query11	0.16	0.11	0.11
query12	0.15	0.11	0.11
query13	0.62	0.60	0.60
query14	2.72	2.70	2.68
query15	0.93	0.87	0.85
query16	0.37	0.37	0.37
query17	1.05	1.02	1.05
query18	0.21	0.20	0.19
query19	1.98	1.87	1.99
query20	0.02	0.01	0.01
query21	15.36	0.89	0.54
query22	0.75	1.10	0.66
query23	14.98	1.39	0.65
query24	12.32	1.00	0.36
query25	0.31	0.11	0.10
query26	0.76	0.19	0.14
query27	0.04	0.04	0.05
query28	5.93	0.79	0.44
query29	12.57	3.94	3.27
query30	0.25	0.09	0.06
query31	2.81	0.60	0.40
query32	3.23	0.55	0.47
query33	3.03	2.98	3.04
query34	15.79	5.10	4.49
query35	4.49	4.54	4.56
query36	0.69	0.49	0.48
query37	0.08	0.06	0.07
query38	0.05	0.04	0.04
query39	0.03	0.02	0.02
query40	0.17	0.14	0.13
query41	0.08	0.03	0.02
query42	0.03	0.03	0.02
query43	0.03	0.02	0.02
Total cold run time: 106.79 s
Total hot run time: 30.14 s

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 43.57% (11384/26129)
Line Coverage: 33.61% (95925/285389)
Region Coverage: 32.43% (49213/151748)
Branch Coverage: 28.46% (25006/87870)
Coverage Report: http://coverage.selectdb-in.cc/coverage/e7b7af07c4f92e5c6d1286093779cb4157d3dcbc_e7b7af07c4f92e5c6d1286093779cb4157d3dcbc/report/index.html

Copy link
Contributor

@morningman morningman 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 github-actions bot added the approved Indicates a PR has been approved by one committer. label Feb 17, 2025
Copy link
Contributor

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

Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@kaka11chen kaka11chen left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman merged commit 3f85ad6 into apache:master Feb 28, 2025
27 of 29 checks passed
seawinde pushed a commit to seawinde/doris that referenced this pull request Feb 28, 2025
…ma change. (apache#47471)

### What problem does this PR solve?
Related PR: apache#32873 

Problem Summary:

Explicitly defines the behavior of column type conversions.

<img width="935" alt="image"
src="https://github.com/user-attachments/assets/1e5afcf6-fbcf-4c36-b44e-82843feacb05"
/>

Special notes are as follows:

`String => boolean`: In Parquet, only "false", "off", "no", "0", and an
empty string ("") are considered false; otherwise, it is true. In Orc, a
string can be parsed as a number, and if that number is 0, it is
considered false; otherwise, it is true. If parsing the number fails, it
results in null.

Conversion between `Int/smallint/tinyint/bigint`:
Unless the conversion can be perfectly represented, an error will be
reported.
For example:
Bigint column => smallint column
Reason: [INTERNAL_ERROR] Failed to cast value '9223372036854775807' to
Nullable(Int16) column.

Conversion between `Decimal`:
Unless the conversion can be perfectly done, an error will be reported.

`String => Int/smallint/tinyint/bigint`:
It can be successfully converted to a number, and the number can be
correctly stored. Otherwise, the result is null.

`Int/smallint/tinyint/bigint => float`:
The conversion is successful only if abs(number type) < 2^23.

`Int/smallint/tinyint/bigint => double`:
The conversion is successful only if abs(number type) < 2^52.

`Decimal => Int/smallint/tinyint/bigint`:
If the integer part of the decimal can be perfectly stored, only the
integer part will be shown; otherwise, it will result in null.

`Float => double`:
Refer to the C++ static_cast<double>(float).

`Decimal => float/double`:
Attempt to store the approximate value.

`Boolean => string`:
The conversion will result in “TRUE” or “FALSE”.

TODO:  conversion to `char/varchar` type requires truncation.
mymeiyi pushed a commit to mymeiyi/doris that referenced this pull request Mar 4, 2025
…ma change. (apache#47471)

### What problem does this PR solve?
Related PR: apache#32873 

Problem Summary:

Explicitly defines the behavior of column type conversions.

<img width="935" alt="image"
src="https://github.com/user-attachments/assets/1e5afcf6-fbcf-4c36-b44e-82843feacb05"
/>

Special notes are as follows:

`String => boolean`: In Parquet, only "false", "off", "no", "0", and an
empty string ("") are considered false; otherwise, it is true. In Orc, a
string can be parsed as a number, and if that number is 0, it is
considered false; otherwise, it is true. If parsing the number fails, it
results in null.

Conversion between `Int/smallint/tinyint/bigint`:
Unless the conversion can be perfectly represented, an error will be
reported.
For example:
Bigint column => smallint column
Reason: [INTERNAL_ERROR] Failed to cast value '9223372036854775807' to
Nullable(Int16) column.

Conversion between `Decimal`:
Unless the conversion can be perfectly done, an error will be reported.

`String => Int/smallint/tinyint/bigint`:
It can be successfully converted to a number, and the number can be
correctly stored. Otherwise, the result is null.

`Int/smallint/tinyint/bigint => float`:
The conversion is successful only if abs(number type) < 2^23.

`Int/smallint/tinyint/bigint => double`:
The conversion is successful only if abs(number type) < 2^52.

`Decimal => Int/smallint/tinyint/bigint`:
If the integer part of the decimal can be perfectly stored, only the
integer part will be shown; otherwise, it will result in null.

`Float => double`:
Refer to the C++ static_cast<double>(float).

`Decimal => float/double`:
Attempt to store the approximate value.

`Boolean => string`:
The conversion will result in “TRUE” or “FALSE”.

TODO:  conversion to `char/varchar` type requires truncation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants