Skip to content

[fix](expr opt) Preserve cast boundaries during arithmetic simplification - #67733

Merged
morrySnow merged 2 commits into
apache:masterfrom
morrySnow:fix/preserve-arithmetic-cast-semantics
Sep 11, 2026
Merged

[fix](expr opt) Preserve cast boundaries during arithmetic simplification#67733
morrySnow merged 2 commits into
apache:masterfrom
morrySnow:fix/preserve-arithmetic-cast-semantics

Conversation

@morrySnow

@morrySnow morrySnow commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Problem

Arithmetic simplification can move a CAST or TRY_CAST from around an arithmetic expression to each operand. That changes where type conversion happens. With large exact integers converted to DOUBLE, the rewritten expression loses precision before subtraction and returns the wrong value.

For example, subtracting 9223372036854775800 from 9223372036854775807 in BIGINT produces the exact value 7. Converting that result to DOUBLE must still produce 7, but converting both operands first rounds them to the same floating-point value and produces 0.

Root cause

The arithmetic flattener recognized a cast containing addition, subtraction, multiplication, or division and recursively propagated the cast target type to every operand. This rewrite assumes that conversion distributes over arithmetic, which is not generally true. Besides floating-point rounding, the transformation can alter overflow, conversion-error, and TRY_CAST null behavior.

Reproduction

CREATE TABLE t (
    id INT NOT NULL,
    k BIGINT NOT NULL
)
DUPLICATE KEY(id)
DISTRIBUTED BY HASH(id) BUCKETS 1
PROPERTIES ("replication_num" = "1");

INSERT INTO t VALUES
    (1, 9223372036854775807),
    (2, 9223372036854775806);

SELECT id,
       k - 9223372036854775800 AS exact_delta,
       TRY_CAST(k - 9223372036854775800 AS DOUBLE) + CAST(0 AS DOUBLE) AS try_expr,
       CAST(k - 9223372036854775800 AS DOUBLE) + CAST(0 AS DOUBLE) AS cast_expr
FROM t
ORDER BY id;

Before this change, exact_delta is 7/6, while both converted expressions incorrectly return 0/0.

Fix

Treat explicit cast expressions as semantic boundaries and atomic operands during arithmetic flattening. The simplifier can continue optimizing arithmetic below and above a cast, but it no longer distributes the conversion into the cast's operands.

This deliberately chooses correctness over the optimization enabled by cross-cast flattening; no target-type whitelist is used because conversion distribution is not safe across all values and operation types.

The P0 run also exposed a regression-test fragility: a session SET statement followed 167 lines of disabled Presto timestamp queries, so the SQL splitter sent the comments and the SET together to the dialect-conversion service. Move the SET before that disabled block so it is converted and executed as a standalone statement. Query order and expected result tags remain unchanged.

A separate chained-MTMV failure came from the task-wait helper temporarily falling back to the preceding task after it had already observed the new task. The branch is rebased onto current master, which contains the framework correction that keeps waiting for the observed task instead of latching onto the previous one.

The rebase also exposed a recently added IVM join-normalization test that still called a removed rewrite-context constructor. Build the test context through the supported CREATE-mode factory and set its full-key flag explicitly, matching the production setup path and restoring FE test-source compilation.

Tests

  • Added expression-rule coverage for both CAST and TRY_CAST around a large-integer subtraction.
  • SimplifyArithmeticRuleTest: 5 tests passed.
  • Deployed the FE to a local sandbox. The reproduction returns 7/6 for both converted expressions, and the physical expression keeps the BIGINT subtraction inside the cast.
  • Full Presto TestOperators suite with doris-sql-convertor 1.0.5: passed.
  • SuiteMTMVTaskWaitTest: 4 tests passed.
  • IvmNormalizeMTMVJoinTest: 44 tests passed.

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

@morrySnow

Copy link
Copy Markdown
Contributor Author

run buildall

@morrySnow morrySnow changed the title [fix](fe) Preserve cast boundaries during arithmetic simplification [fix](expr opt) Preserve cast boundaries during arithmetic simplification Sep 9, 2026
@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (6/6) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17556	3020	3015	3015
q2	2123	264	242	242
q3	10205	857	515	515
q4	4672	246	200	200
q5	7675	555	382	382
q6	137	110	93	93
q7	528	514	385	385
q8	9243	857	952	857
q9	3573	2436	2399	2399
q10	6504	873	711	711
q11	398	192	176	176
q12	617	262	201	201
q13	18117	1540	1205	1205
q14	159	155	142	142
q15	q16	435	389	364	364
q17	1369	868	869	868
q18	3057	2270	2238	2238
q19	1280	901	789	789
q20	386	287	205	205
q21	5566	1710	1834	1710
q22	329	268	229	229
Total cold run time: 93929 ms
Total hot run time: 16926 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3327	3296	3274	3274
q2	503	393	403	393
q3	2201	2291	2218	2218
q4	1203	1181	888	888
q5	2179	2124	2092	2092
q6	161	122	87	87
q7	1031	917	849	849
q8	1573	1367	1378	1367
q9	3126	3080	3059	3059
q10	1881	1787	1633	1633
q11	347	262	252	252
q12	452	430	346	346
q13	1494	1526	1154	1154
q14	178	165	167	165
q15	q16	393	393	357	357
q17	3556	3286	3191	3191
q18	4805	4462	4772	4462
q19	855	791	935	791
q20	1021	973	818	818
q21	3854	3091	3266	3091
q22	398	338	325	325
Total cold run time: 34538 ms
Total hot run time: 30812 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 82068 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 167e4e9d4e418e703e43a3697f01ae960baf6e1a, data reload: false

query5	4257	422	351	351
query6	388	139	126	126
query7	4931	433	237	237
query8	287	126	120	120
query9	8690	2875	2891	2875
query10	426	222	180	180
query11	5367	1063	926	926
query12	120	72	69	69
query13	1211	437	314	314
query14	6110	2212	2100	2100
query14_1	1983	1973	1983	1973
query15	180	119	113	113
query16	906	371	353	353
query17	792	466	370	370
query18	2330	337	229	229
query19	166	140	111	111
query20	83	77	70	70
query21	200	100	87	87
query22	5305	5378	5467	5378
query23	6779	6249	6198	6198
query23_1	6006	6049	6075	6049
query24	7256	1114	755	755
query24_1	777	778	768	768
query25	428	307	254	254
query26	1248	244	135	135
query27	2755	404	251	251
query28	4687	1518	1504	1504
query29	930	451	346	346
query30	256	156	131	131
query31	827	401	323	323
query32	135	82	76	76
query33	455	229	177	177
query34	1006	821	478	478
query35	405	416	357	357
query36	573	561	543	543
query37	123	81	71	71
query38	1014	870	827	827
query39	494	470	484	470
query39_1	461	460	469	460
query40	208	92	79	79
query41	60	57	57	57
query42	78	73	77	73
query43	243	246	209	209
query44	986	546	556	546
query45	119	104	104	104
query46	766	864	553	553
query47	752	759	696	696
query48	317	340	237	237
query49	555	239	189	189
query50	767	270	193	193
query51	8059	8053	7906	7906
query52	71	65	61	61
query53	204	197	146	146
query54	224	162	169	162
query55	67	61	58	58
query56	180	176	175	175
query57	778	682	656	656
query58	181	168	161	161
query59	1225	1218	1087	1087
query60	232	186	176	176
query61	109	111	110	110
query62	357	222	177	177
query63	174	149	141	141
query64	2703	703	623	623
query65	1622	1574	1582	1574
query66	1882	282	202	202
query67	9680	9830	9619	9619
query68	3034	1127	703	703
query69	350	229	201	201
query70	669	626	619	619
query71	252	178	160	160
query72	2349	1668	1488	1488
query73	656	645	324	324
query74	2011	1217	1141	1141
query75	1190	1098	964	964
query76	2381	721	520	520
query77	256	243	217	217
query78	4026	3692	3244	3244
query79	2727	829	578	578
query80	1592	353	280	280
query81	503	152	134	134
query82	621	124	97	97
query83	296	214	187	187
query84	302	109	89	89
query85	812	340	285	285
query86	399	174	168	168
query87	1013	952	890	890
query88	2891	2132	2130	2130
query89	284	197	176	176
query90	1942	133	130	130
query91	136	120	98	98
query92	82	70	70	70
query93	1629	996	720	720
query94	657	300	231	231
query95	489	329	226	226
query96	819	580	274	274
query97	1083	1050	1019	1019
query98	165	143	131	131
query99	411	348	301	301
Total cold run time: 178383 ms
Total hot run time: 82068 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.08	0.04	0.04
query3	0.25	0.10	0.10
query4	1.60	0.08	0.09
query5	0.17	0.16	0.17
query6	1.26	0.66	0.68
query7	0.03	0.00	0.01
query8	0.04	0.03	0.03
query9	0.29	0.21	0.21
query10	0.37	0.35	0.38
query11	0.16	0.12	0.11
query12	0.15	0.12	0.11
query13	0.31	0.31	0.30
query14	0.44	0.44	0.45
query15	0.36	0.36	0.34
query16	0.21	0.23	0.23
query17	0.73	0.70	0.71
query18	0.18	0.16	0.16
query19	1.19	1.22	1.12
query20	0.02	0.02	0.02
query21	15.45	0.16	0.12
query22	5.08	0.04	0.04
query23	16.17	0.26	0.10
query24	2.98	0.32	0.25
query25	0.09	0.05	0.04
query26	0.79	0.16	0.12
query27	0.04	0.03	0.04
query28	3.63	0.56	0.28
query29	12.46	3.22	2.57
query30	0.25	0.12	0.12
query31	2.76	0.37	0.17
query32	3.52	0.32	0.23
query33	1.38	1.56	1.55
query34	15.34	2.15	1.75
query35	1.76	1.74	1.74
query36	0.45	0.30	0.29
query37	0.05	0.03	0.03
query38	0.04	0.03	0.03
query39	0.03	0.02	0.03
query40	0.12	0.08	0.08
query41	0.08	0.03	0.03
query42	0.03	0.03	0.03
query43	0.03	0.03	0.03
Total cold run time: 90.37 s
Total hot run time: 14.81 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (6/6) 🎉
Increment coverage report
Complete coverage report

@morrySnow
morrySnow force-pushed the fix/preserve-arithmetic-cast-semantics branch from 167e4e9 to 756a053 Compare September 10, 2026 05:06
@morrySnow

Copy link
Copy Markdown
Contributor Author

run buildall

1 similar comment
@morrySnow

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17559	3044	3044	3044
q2	2071	259	227	227
q3	10235	933	528	528
q4	4664	253	210	210
q5	7667	584	399	399
q6	142	118	99	99
q7	533	512	404	404
q8	9241	880	920	880
q9	3473	2430	2466	2430
q10	6515	884	720	720
q11	415	203	184	184
q12	612	267	202	202
q13	18142	1574	1186	1186
q14	156	153	142	142
q15	q16	446	403	381	381
q17	1290	897	817	817
q18	3117	2310	2309	2309
q19	1103	924	801	801
q20	380	289	202	202
q21	5290	1617	1906	1617
q22	328	271	234	234
Total cold run time: 93379 ms
Total hot run time: 17016 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3398	3343	3321	3321
q2	523	395	380	380
q3	2200	2301	2236	2236
q4	1212	1178	899	899
q5	2199	2162	2126	2126
q6	170	121	88	88
q7	1049	918	883	883
q8	1604	1428	1398	1398
q9	3218	3184	3163	3163
q10	1887	1850	1649	1649
q11	366	277	261	261
q12	461	439	349	349
q13	1502	1550	1189	1189
q14	169	169	163	163
q15	q16	400	401	361	361
q17	3715	3395	3319	3319
q18	5030	4578	4880	4578
q19	1038	860	893	860
q20	997	1015	817	817
q21	3867	3235	3259	3235
q22	402	355	327	327
Total cold run time: 35407 ms
Total hot run time: 31602 ms

@hello-stephen

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

query5	4270	417	328	328
query6	390	135	129	129
query7	4937	434	241	241
query8	293	131	126	126
query9	8710	2926	2896	2896
query10	392	226	191	191
query11	5379	1054	915	915
query12	124	72	71	71
query13	1200	454	330	330
query14	6133	2252	2151	2151
query14_1	2027	2021	2016	2016
query15	176	124	115	115
query16	927	391	350	350
query17	790	463	362	362
query18	2337	352	238	238
query19	185	149	125	125
query20	81	75	76	75
query21	207	102	89	89
query22	5600	5490	5321	5321
query23	6838	6218	6306	6218
query23_1	6422	6282	6387	6282
query24	7261	1108	791	791
query24_1	781	809	757	757
query25	433	307	256	256
query26	1232	226	130	130
query27	2790	431	251	251
query28	4720	1509	1479	1479
query29	941	440	361	361
query30	249	155	131	131
query31	822	403	335	335
query32	135	83	77	77
query33	470	228	182	182
query34	981	859	502	502
query35	433	407	352	352
query36	584	584	525	525
query37	118	83	71	71
query38	1008	875	820	820
query39	520	491	472	472
query39_1	495	474	501	474
query40	206	102	83	83
query41	62	61	59	59
query42	82	76	77	76
query43	247	244	211	211
query44	989	536	547	536
query45	110	106	104	104
query46	768	894	539	539
query47	778	781	732	732
query48	335	327	229	229
query49	546	249	207	207
query50	779	271	207	207
query51	8135	8182	8165	8165
query52	68	69	60	60
query53	195	217	219	217
query54	224	183	144	144
query55	78	65	57	57
query56	194	194	185	185
query57	735	678	680	678
query58	205	162	167	162
query59	1245	1258	1125	1125
query60	251	185	189	185
query61	116	115	114	114
query62	359	207	181	181
query63	168	139	143	139
query64	2721	701	596	596
query65	1657	1621	1618	1618
query66	1764	258	212	212
query67	10230	10275	9754	9754
query68	2858	1182	744	744
query69	348	232	199	199
query70	661	610	609	609
query71	249	241	171	171
query72	2285	1732	1530	1530
query73	653	583	349	349
query74	1842	1260	1157	1157
query75	1187	1119	984	984
query76	2298	718	509	509
query77	265	276	222	222
query78	4005	3787	3260	3260
query79	2399	809	605	605
query80	1602	341	278	278
query81	494	163	133	133
query82	604	125	99	99
query83	280	224	196	196
query84	303	115	90	90
query85	774	352	289	289
query86	389	182	192	182
query87	1064	992	915	915
query88	2801	2141	2119	2119
query89	277	199	174	174
query90	1963	133	128	128
query91	135	123	99	99
query92	90	72	63	63
query93	1463	1147	688	688
query94	648	264	213	213
query95	526	268	294	268
query96	850	604	273	273
query97	1074	1067	1062	1062
query98	171	135	135	135
query99	420	346	313	313
Total cold run time: 179043 ms
Total hot run time: 83457 ms

@hello-stephen

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

query1	0.00	0.00	0.01
query2	0.08	0.04	0.03
query3	0.25	0.09	0.11
query4	1.60	0.10	0.10
query5	0.18	0.16	0.16
query6	1.27	0.70	0.68
query7	0.03	0.00	0.00
query8	0.05	0.03	0.02
query9	0.28	0.21	0.22
query10	0.37	0.35	0.35
query11	0.16	0.11	0.12
query12	0.16	0.12	0.13
query13	0.31	0.30	0.31
query14	0.46	0.45	0.45
query15	0.38	0.34	0.36
query16	0.25	0.22	0.23
query17	0.69	0.70	0.74
query18	0.17	0.17	0.17
query19	1.16	1.18	1.18
query20	0.02	0.01	0.02
query21	15.43	0.16	0.11
query22	5.08	0.05	0.04
query23	16.18	0.25	0.10
query24	3.01	0.33	0.27
query25	0.10	0.05	0.04
query26	0.74	0.17	0.12
query27	0.04	0.03	0.03
query28	3.61	0.54	0.27
query29	12.48	3.25	2.61
query30	0.26	0.11	0.12
query31	2.76	0.38	0.17
query32	3.50	0.33	0.24
query33	1.42	1.54	1.54
query34	15.44	2.21	1.82
query35	1.82	1.78	1.77
query36	0.46	0.30	0.29
query37	0.07	0.04	0.04
query38	0.05	0.03	0.03
query39	0.03	0.02	0.02
query40	0.12	0.09	0.08
query41	0.07	0.02	0.03
query42	0.04	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 90.62 s
Total hot run time: 15.01 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (6/6) 🎉
Increment coverage report
Complete coverage report

@morrySnow
morrySnow marked this pull request as draft September 10, 2026 07:26
Arithmetic flattening distributed a cast over its child operands when a
constant was present. This can change the evaluation type and move
rounding, overflow, error, or null behavior before the original operation.

Treat explicit cast expressions as atomic operands during flattening.
Arithmetic inside and outside each cast can still be simplified without
crossing the conversion boundary.

Issue Number: None

Tests:
- SimplifyArithmeticRuleTest
- sandbox SQL reproduction near the BIGINT upper bound
Keep the debug session-variable statement separate from a large block of disabled timestamp queries. This prevents the SQL file splitter from sending the comments and SET as one oversized dialect-conversion request, whose update count can become unstable under concurrent regression runs.

The statement order and expected results remain unchanged.

Issue Number: None

Tests:
- TestOperators with doris-sql-convertor 1.0.5
@morrySnow
morrySnow force-pushed the fix/preserve-arithmetic-cast-semantics branch from e570bb8 to dd88b8b Compare September 10, 2026 08:41
@morrySnow

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (6/6) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17582	3111	3088	3088
q2	2059	255	212	212
q3	10275	872	528	528
q4	4670	251	201	201
q5	7679	673	384	384
q6	136	118	91	91
q7	529	483	389	389
q8	9229	881	841	841
q9	3433	2369	2370	2369
q10	6536	863	739	739
q11	393	192	179	179
q12	615	262	189	189
q13	18132	1516	1142	1142
q14	160	147	141	141
q15	q16	436	393	362	362
q17	1398	863	813	813
q18	3088	2223	2202	2202
q19	1278	930	735	735
q20	378	283	201	201
q21	5613	1747	1803	1747
q22	338	264	229	229
Total cold run time: 93957 ms
Total hot run time: 16782 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3451	3389	3388	3388
q2	506	394	375	375
q3	2199	2241	2272	2241
q4	1192	1160	889	889
q5	2180	2096	2103	2096
q6	170	113	88	88
q7	1026	928	873	873
q8	1594	1412	1414	1412
q9	3110	3080	3046	3046
q10	1837	1811	1619	1619
q11	360	269	249	249
q12	445	433	337	337
q13	1472	1534	1173	1173
q14	187	170	150	150
q15	q16	394	399	359	359
q17	3532	3260	3194	3194
q18	4763	4414	4717	4414
q19	852	865	886	865
q20	1006	967	840	840
q21	3852	3089	3333	3089
q22	398	355	324	324
Total cold run time: 34526 ms
Total hot run time: 31021 ms

@hello-stephen

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

query5	4247	421	338	338
query6	404	136	131	131
query7	4921	422	233	233
query8	289	129	128	128
query9	8694	2890	2892	2890
query10	406	229	189	189
query11	5394	1036	927	927
query12	119	71	71	71
query13	1190	444	330	330
query14	6132	2196	2078	2078
query14_1	1984	1963	1940	1940
query15	185	121	118	118
query16	923	381	370	370
query17	1042	456	376	376
query18	2363	326	244	244
query19	169	144	122	122
query20	86	72	73	72
query21	202	103	86	86
query22	5416	5390	5372	5372
query23	6750	6265	6135	6135
query23_1	5968	6101	6107	6101
query24	7319	1080	769	769
query24_1	783	767	769	767
query25	426	308	263	263
query26	1230	227	132	132
query27	2776	416	260	260
query28	4652	1494	1465	1465
query29	935	426	362	362
query30	255	155	135	135
query31	829	396	330	330
query32	134	73	81	73
query33	466	220	188	188
query34	999	826	481	481
query35	414	393	340	340
query36	587	563	525	525
query37	124	82	73	73
query38	999	836	811	811
query39	493	472	468	468
query39_1	454	451	455	451
query40	202	91	78	78
query41	60	57	56	56
query42	76	73	73	73
query43	239	245	212	212
query44	1039	525	535	525
query45	110	104	98	98
query46	778	828	511	511
query47	742	757	715	715
query48	322	326	214	214
query49	531	238	184	184
query50	748	253	195	195
query51	8069	8040	7976	7976
query52	73	68	59	59
query53	201	191	146	146
query54	214	166	190	166
query55	68	55	53	53
query56	196	249	156	156
query57	698	700	655	655
query58	191	164	155	155
query59	1205	1221	1079	1079
query60	240	172	172	172
query61	113	111	112	111
query62	340	200	180	180
query63	173	147	141	141
query64	2797	692	628	628
query65	1618	1675	1571	1571
query66	1835	267	219	219
query67	9666	9677	9385	9385
query68	2985	1174	698	698
query69	333	222	202	202
query70	670	626	627	626
query71	249	169	167	167
query72	2274	1605	1475	1475
query73	661	580	310	310
query74	1998	1212	1122	1122
query75	1167	1106	941	941
query76	2367	721	552	552
query77	256	258	215	215
query78	4038	3768	3201	3201
query79	2324	810	573	573
query80	1591	350	280	280
query81	495	156	132	132
query82	751	125	109	109
query83	275	205	195	195
query84	250	109	84	84
query85	779	333	288	288
query86	390	187	175	175
query87	1007	969	902	902
query88	2773	2110	2100	2100
query89	290	196	174	174
query90	1986	127	128	127
query91	128	116	93	93
query92	80	71	69	69
query93	1528	1013	744	744
query94	642	262	215	215
query95	522	256	302	256
query96	779	545	257	257
query97	1032	1096	1015	1015
query98	164	148	131	131
query99	419	335	310	310
Total cold run time: 177942 ms
Total hot run time: 81747 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.08	0.03	0.04
query3	0.24	0.10	0.10
query4	1.59	0.09	0.09
query5	0.16	0.16	0.15
query6	1.30	0.69	0.73
query7	0.03	0.00	0.01
query8	0.05	0.03	0.04
query9	0.29	0.22	0.22
query10	0.35	0.34	0.35
query11	0.16	0.12	0.12
query12	0.16	0.12	0.12
query13	0.31	0.32	0.31
query14	0.46	0.45	0.45
query15	0.37	0.35	0.35
query16	0.24	0.22	0.23
query17	0.69	0.66	0.63
query18	0.18	0.16	0.16
query19	1.20	1.16	1.19
query20	0.01	0.02	0.02
query21	15.47	0.16	0.11
query22	5.05	0.04	0.05
query23	16.19	0.25	0.10
query24	3.02	0.32	0.23
query25	0.10	0.03	0.03
query26	0.74	0.16	0.12
query27	0.04	0.03	0.03
query28	3.67	0.53	0.29
query29	12.48	3.14	2.57
query30	0.26	0.11	0.12
query31	2.76	0.38	0.18
query32	3.52	0.33	0.23
query33	1.37	1.37	1.48
query34	15.41	2.18	1.77
query35	1.73	1.71	1.74
query36	0.47	0.28	0.28
query37	0.07	0.04	0.04
query38	0.04	0.03	0.03
query39	0.03	0.02	0.02
query40	0.11	0.09	0.08
query41	0.08	0.02	0.02
query42	0.04	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 90.56 s
Total hot run time: 14.61 s

@morrySnow
morrySnow marked this pull request as ready for review September 11, 2026 05:31
@morrySnow
morrySnow merged commit 103a0a7 into apache:master Sep 11, 2026
39 of 41 checks passed
@morrySnow
morrySnow deleted the fix/preserve-arithmetic-cast-semantics branch September 11, 2026 06:41
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.

3 participants