Skip to content

Conversation

@JoverZhang
Copy link
Contributor

@JoverZhang JoverZhang commented Sep 12, 2025

What problem does this PR solve?

Issue Number: #38975

Problem Summary:

This PR reimplements REGR_SLOPE and REGR_INTERCEPT using the Youngs–Cramer algorithm to align with PostgreSQL.

It also extends AggregateFunctionRegrData<T> so it can be reused by all REGR_* functions (SXX, SYY, SXY, R2, etc.).

-- Copy from `regression-test/suites/query_p0/aggregate/support_type/regr_slope/regr_slope.groovy`
-- dataset (PostgreSQL)
drop table if exists d_table;
create table d_table (
    k1 int,
    k2 int not null,
    k3 bigint,
    col_tinyint smallint,
    col_smallint smallint,
    col_int int,
    col_bigint bigint,
    col_largeint numeric(38,0),
    col_float real,
    col_double double precision
);

insert into d_table values 
    (1, 1, 1, 100, 10000, 1000000, 10000000000, 100000000000000000000, 3.14, 2.718281828),
    (2, 2, 2, 101, 10001, 1000001, 10000000001, 100000000000000000001, 6.28, 3.141592653),
    (3, 3, 3, 102, 10002, 1000002, 10000000002, 100000000000000000002, 9.42, 1.618033988);

select regr_slope(col_tinyint, col_smallint) from d_table;
-- 1.0
select regr_slope(col_smallint, col_int) from d_table;
-- 1.0
select regr_slope(col_int, col_bigint) from d_table;
-- 1.0
select regr_slope(col_bigint, col_largeint) from d_table;
-- <null>
select regr_slope(col_largeint, col_float) from d_table;
-- 0.0
select regr_slope(col_float, col_double) from d_table;
-- -2.7928921351549283
select regr_slope(col_double, col_tinyint) from d_table;
-- -0.5501239200000003


select regr_intercept(col_tinyint, col_smallint) from d_table;
-- -9900.0
select regr_intercept(col_smallint, col_int) from d_table;
-- -990000.0
select regr_intercept(col_int, col_bigint) from d_table;
-- -9999000000.0
select regr_intercept(col_bigint, col_largeint) from d_table;
-- <null>
select regr_intercept(col_largeint, col_float) from d_table;
-- 1e+20
select regr_intercept(col_float, col_double) from d_table;
-- 13.241664047161668
select regr_intercept(col_double, col_tinyint) from d_table;
-- 58.055152076333364

Next step:

Refactor REGR_SXX/REGR_SYY/REGR_SXY/REGR_R2 to reuse the same AggregateFunctionRegrData<T> state (n, sx, sy, sxx, syy, sxy) and Youngs–Cramer merge. This ensures consistent numerics and associative merges across all REGR_* functions, and aligns results with PostgreSQL.

  • regr_sxx = sxx
  • regr_syy = syy
  • regr_sxy = sxy
  • regr_r2 = (sxy * sxy) / (sxx * syy)

Seeking feedback

Should we use the if constexpr to skip unused updates?
Now, all REGR_* functions share the same state (n, sx, sy, sxx, syy, sxy) for Youngs–Cramer. For consumers that don’t need certain terms (e.g., REGR_SLOPE doesn’t need syy, REGR_SXX only needs sxx), we could add compile-time flags to skip updates for unused accumulators:

        if constexpr (NeedSXX) sxx += tmp_x * tmp_x * scale;
        if constexpr (NeedSYY) syy += tmp_y * tmp_y * scale;
        if constexpr (NeedSXY) sxy += tmp_x * tmp_y * scale;

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.
      • REGR_SLOPE/REGR_INTERCEPT now follow PostgreSQL / SQL:2003 semantics:
        • Use slope = sxy / sxx, intercept = (sy - sx * sxy/sxx) / n.
  • 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 Sep 12, 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?

@zclllyybb zclllyybb self-assigned this Sep 12, 2025
Comment on lines 8 to +9
-- !regr_intercept_int --
1000001.0
-9.999E9
Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to

REGR_INTERCEPT(y, x) = AVG(y) - REGR_SLOPE(y, x) * AVG(x)
REGR_SLOPE(y, x) = COVAR_POP(x, y) / VAR_POP(x)

Verification

select regr_intercept(col_int, col_bigint) from d_table;

PostgreSQL

select avg(col_int) - regr_slope(col_int, col_bigint) * avg(col_bigint) from d_table;
+---------------+
| ?column?      |
|---------------|
| -9999000000.0 |
+---------------+

Clickhouse (stable covariance/variance)

SELECT avg(col_int) - ((covarPopStable(col_bigint, col_int) / varPopStable(col_bigint)) * avg(col_bigint))
FROM d_table
   ┌─minus(avg(co⋯l_bigint)))─┐
1. │              -9999000000-- -10.00 billion
   └──────────────────────────┘

Comment on lines 8 to +9
-- !regr_slope_int --
-0.0
1.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verification

PostgreSQL

select regr_slope(col_int, col_bigint) from d_table;
+------------+
| regr_slope |
|------------|
| 1.0        |
+------------+
select covar_pop(col_bigint, col_int) / var_pop(col_bigint) from d_table;
+----------+
| ?column? |
|----------|
| 1.0      |
+----------+

Clickhouse (stable covariance/variance)

SELECT covarPopStable(col_bigint, col_int) / varPopStable(col_bigint)
FROM d_table
   ┌─divide(covar⋯ol_bigint))─┐
1. │                        1 │
   └──────────────────────────┘

Comment on lines 14 to +15
-- !regr_slope_largeint --
17725.127617654194
0.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verification

PostgreSQL

select regr_slope(col_largeint, col_float) from d_table;
+------------+
| regr_slope |
|------------|
| 0.0        |
+------------+
select covar_pop(col_float, col_largeint) / var_pop(col_float) from d_table;
+----------+
| ?column? |
|----------|
| 0.0      |
+----------+

Clickhouse (stable covariance/variance)

SELECT covarPopStable(col_float, col_largeint) / varPopStable(col_float)
FROM d_table
   ┌─divide(covar⋯col_float))─┐
1. │                        0 │
   └──────────────────────────┘

@JoverZhang
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17610	5222	5131	5131
q2	1993	312	211	211
q3	10276	1283	689	689
q4	10253	1028	511	511
q5	7568	2415	2359	2359
q6	176	166	137	137
q7	918	757	646	646
q8	9346	1325	1060	1060
q9	6965	5128	5146	5128
q10	6956	2360	1994	1994
q11	515	300	298	298
q12	345	367	244	244
q13	17821	3702	3014	3014
q14	244	251	221	221
q15	563	480	494	480
q16	1000	1000	955	955
q17	601	858	364	364
q18	7420	7095	7149	7095
q19	1400	936	578	578
q20	345	339	230	230
q21	3774	3228	2304	2304
q22	1076	1045	986	986
Total cold run time: 107165 ms
Total hot run time: 34635 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5150	5067	5074	5067
q2	246	325	229	229
q3	2182	2642	2270	2270
q4	1365	1753	1362	1362
q5	4224	4440	4598	4440
q6	208	186	143	143
q7	2051	2074	1837	1837
q8	2813	2549	2503	2503
q9	7429	7365	7439	7365
q10	3082	3314	2838	2838
q11	596	546	512	512
q12	671	820	658	658
q13	3532	4044	3205	3205
q14	283	287	262	262
q15	521	487	513	487
q16	1071	1083	1035	1035
q17	1235	1592	1373	1373
q18	8080	7717	7527	7527
q19	846	860	841	841
q20	2056	2054	1897	1897
q21	4724	4434	4274	4274
q22	1083	1061	1030	1030
Total cold run time: 53448 ms
Total hot run time: 51155 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 188040 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 2e1375c6bf6668ac7b0bce2e3e8c0898621df5a8, data reload: false

query1	1061	435	407	407
query2	6551	1702	1706	1702
query3	6767	219	220	219
query4	26630	23569	22865	22865
query5	4395	601	497	497
query6	354	229	224	224
query7	4654	498	302	302
query8	320	277	272	272
query9	8683	2647	2648	2647
query10	493	363	275	275
query11	15662	15009	14869	14869
query12	188	119	116	116
query13	1700	573	436	436
query14	11501	9246	9330	9246
query15	203	196	181	181
query16	7700	688	507	507
query17	1592	793	640	640
query18	2048	447	345	345
query19	258	199	173	173
query20	132	126	123	123
query21	217	134	116	116
query22	4128	4172	4141	4141
query23	34091	32854	32970	32854
query24	8466	2369	2450	2369
query25	558	515	439	439
query26	1236	272	162	162
query27	2723	502	364	364
query28	4396	2206	2187	2187
query29	790	625	490	490
query30	294	233	206	206
query31	930	813	745	745
query32	77	74	70	70
query33	589	385	326	326
query34	828	847	524	524
query35	800	841	747	747
query36	965	1023	938	938
query37	121	107	84	84
query38	3547	3512	3457	3457
query39	1509	1424	1408	1408
query40	216	139	116	116
query41	64	64	66	64
query42	123	111	117	111
query43	530	509	490	490
query44	1328	838	837	837
query45	188	178	168	168
query46	845	1031	657	657
query47	1764	1811	1724	1724
query48	384	416	305	305
query49	765	509	414	414
query50	652	700	411	411
query51	3936	3924	3875	3875
query52	114	111	104	104
query53	242	264	193	193
query54	600	582	526	526
query55	92	80	85	80
query56	320	318	312	312
query57	1186	1208	1132	1132
query58	270	263	259	259
query59	2602	2671	2605	2605
query60	363	326	346	326
query61	165	163	163	163
query62	810	743	700	700
query63	229	190	188	188
query64	4466	1175	818	818
query65	4034	3982	3985	3982
query66	1103	451	337	337
query67	15649	15069	14994	14994
query68	8759	930	583	583
query69	474	327	286	286
query70	1397	1278	1356	1278
query71	564	351	300	300
query72	6051	5061	5210	5061
query73	727	696	373	373
query74	9183	9123	8615	8615
query75	4326	3334	2856	2856
query76	3716	1160	750	750
query77	804	491	322	322
query78	9452	9774	8827	8827
query79	1914	827	589	589
query80	680	575	601	575
query81	488	256	235	235
query82	370	164	138	138
query83	295	262	265	262
query84	312	115	91	91
query85	864	461	434	434
query86	340	328	325	325
query87	3765	3740	3652	3652
query88	2911	2272	2236	2236
query89	422	331	296	296
query90	2099	224	229	224
query91	167	167	138	138
query92	81	72	60	60
query93	1230	1013	641	641
query94	691	432	341	341
query95	394	313	302	302
query96	500	578	287	287
query97	2935	2998	2868	2868
query98	243	214	215	214
query99	1450	1430	1317	1317
Total cold run time: 277801 ms
Total hot run time: 188040 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.04
query2	0.10	0.06	0.05
query3	0.25	0.08	0.08
query4	1.61	0.12	0.12
query5	0.28	0.28	0.26
query6	1.16	0.66	0.65
query7	0.03	0.03	0.03
query8	0.05	0.04	0.04
query9	0.63	0.52	0.52
query10	0.58	0.58	0.58
query11	0.17	0.11	0.12
query12	0.16	0.12	0.12
query13	0.64	0.63	0.64
query14	1.04	1.05	1.04
query15	0.86	0.85	0.85
query16	0.41	0.42	0.39
query17	1.04	1.05	1.06
query18	0.22	0.20	0.23
query19	1.94	1.89	1.85
query20	0.02	0.02	0.02
query21	15.40	0.94	0.58
query22	0.75	1.19	0.67
query23	14.95	1.42	0.62
query24	7.18	1.55	0.85
query25	0.50	0.11	0.09
query26	0.63	0.17	0.14
query27	0.06	0.06	0.06
query28	9.35	0.89	0.45
query29	12.56	4.03	3.25
query30	0.29	0.14	0.11
query31	2.84	0.58	0.39
query32	3.26	0.56	0.46
query33	3.02	3.16	3.13
query34	15.94	5.54	4.88
query35	4.91	4.96	4.93
query36	0.70	0.51	0.50
query37	0.11	0.07	0.08
query38	0.07	0.05	0.04
query39	0.03	0.03	0.03
query40	0.19	0.14	0.14
query41	0.09	0.04	0.03
query42	0.03	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 104.15 s
Total hot run time: 30.12 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/60) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.21% (17436/33398)
Line Coverage 37.42% (158418/423404)
Region Coverage 32.00% (120825/377625)
Branch Coverage 33.36% (53016/158912)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 90.00% (54/60) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 70.83% (23129/32654)
Line Coverage 57.22% (241692/422375)
Region Coverage 52.71% (201689/382610)
Branch Coverage 54.32% (86704/159611)

@zclllyybb
Copy link
Contributor

Thanks for your contribution. we are busy in these few days. When I have time I will prioritize reviewing it.

@JoverZhang
Copy link
Contributor Author

Thanks for your contribution. we are busy in these few days. When I have time I will prioritize reviewing it.

Got it, thanks!

@JoverZhang
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-DS: Total hot run time: 182964 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 0fec036d7d1dea54950f473933a688f2d3c7b5c0, data reload: false

query5	5303	643	486	486
query6	345	226	215	215
query7	4243	472	295	295
query8	321	266	260	260
query9	8785	2634	2655	2634
query10	548	384	334	334
query11	15329	14772	15691	14772
query12	197	129	131	129
query13	1421	553	461	461
query14	6417	3448	3240	3240
query14_1	3029	3091	3099	3091
query15	237	210	185	185
query16	809	508	528	508
query17	1497	751	678	678
query18	2934	492	393	393
query19	275	266	236	236
query20	125	150	131	131
query21	256	148	117	117
query22	4463	4539	4481	4481
query23	16872	16315	16289	16289
query23_1	16566	16530	15980	15980
query24	7375	1613	1217	1217
query24_1	1219	1259	1244	1244
query25	559	460	399	399
query26	1232	256	152	152
query27	2752	458	308	308
query28	4433	2164	2150	2150
query29	826	584	435	435
query30	313	246	205	205
query31	817	683	615	615
query32	72	64	61	61
query33	530	319	282	282
query34	899	914	544	544
query35	805	819	712	712
query36	873	906	802	802
query37	128	86	76	76
query38	3879	3872	3843	3843
query39	742	740	707	707
query39_1	711	712	694	694
query40	219	133	118	118
query41	60	63	60	60
query42	102	101	101	101
query43	431	419	397	397
query44	1350	747	746	746
query45	194	187	181	181
query46	875	971	612	612
query47	1629	1669	1611	1611
query48	316	323	252	252
query49	607	442	371	371
query50	666	294	229	229
query51	3879	4026	3811	3811
query52	106	119	98	98
query53	330	367	301	301
query54	284	260	255	255
query55	80	73	72	72
query56	306	297	301	297
query57	1151	1119	1085	1085
query58	273	258	258	258
query59	2300	2456	2359	2359
query60	319	301	288	288
query61	163	156	159	156
query62	702	720	623	623
query63	330	295	298	295
query64	4976	1287	1003	1003
query65	4025	3955	3982	3955
query66	1389	432	352	352
query67	15329	14808	14917	14808
query68	8348	1044	747	747
query69	499	347	316	316
query70	1101	977	1023	977
query71	388	312	288	288
query72	6047	5031	5127	5031
query73	746	655	310	310
query74	8965	8771	8593	8593
query75	3744	3513	3203	3203
query76	4076	1126	783	783
query77	815	397	293	293
query78	9539	9783	8840	8840
query79	1596	884	604	604
query80	730	651	556	556
query81	496	269	235	235
query82	512	133	104	104
query83	257	255	247	247
query84	258	124	96	96
query85	983	535	481	481
query86	353	301	271	271
query87	4080	4083	4032	4032
query88	4187	2257	2242	2242
query89	471	418	387	387
query90	2158	161	153	153
query91	180	171	142	142
query92	80	68	60	60
query93	1539	894	563	563
query94	442	298	291	291
query95	570	329	305	305
query96	579	479	217	217
query97	2597	2650	2561	2561
query98	213	196	193	193
query99	1316	1331	1194	1194
Total cold run time: 268322 ms
Total hot run time: 182964 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.10	0.05	0.05
query3	0.26	0.09	0.09
query4	1.60	0.11	0.11
query5	0.29	0.27	0.26
query6	1.17	0.66	0.63
query7	0.04	0.03	0.03
query8	0.06	0.04	0.04
query9	0.58	0.52	0.51
query10	0.56	0.57	0.56
query11	0.14	0.11	0.11
query12	0.14	0.11	0.11
query13	0.64	0.60	0.60
query14	0.99	0.98	1.00
query15	0.81	0.79	0.80
query16	0.41	0.39	0.39
query17	1.05	1.05	1.06
query18	0.23	0.21	0.21
query19	1.97	1.77	1.85
query20	0.02	0.01	0.01
query21	15.44	0.27	0.15
query22	4.96	0.05	0.05
query23	16.12	0.29	0.10
query24	0.90	0.25	0.57
query25	0.07	0.06	0.05
query26	0.14	0.14	0.13
query27	0.07	0.05	0.05
query28	3.69	1.24	1.02
query29	12.58	4.01	3.21
query30	0.28	0.15	0.12
query31	2.84	0.64	0.39
query32	3.24	0.56	0.46
query33	3.02	3.02	3.13
query34	16.93	5.21	4.54
query35	4.53	4.62	4.59
query36	0.68	0.49	0.49
query37	0.11	0.07	0.08
query38	0.08	0.05	0.04
query39	0.05	0.03	0.03
query40	0.16	0.14	0.14
query41	0.09	0.03	0.03
query42	0.04	0.04	0.03
query43	0.04	0.04	0.04
Total cold run time: 97.18 s
Total hot run time: 27.35 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 0.00% (0/140) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.33% (18709/35080)
Line Coverage 39.05% (172973/442974)
Region Coverage 33.72% (134127/397777)
Branch Coverage 34.64% (57643/166424)

@zclllyybb
Copy link
Contributor

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17595	5048	4852	4852
q2	2000	369	232	232
q3	10192	1346	757	757
q4	10222	831	323	323
q5	7527	2165	2073	2073
q6	192	173	141	141
q7	997	862	720	720
q8	9363	1450	1158	1158
q9	6968	5366	5302	5302
q10	6836	2386	1971	1971
q11	534	319	295	295
q12	639	740	572	572
q13	17785	3699	3043	3043
q14	304	289	287	287
q15	600	520	512	512
q16	949	911	864	864
q17	721	859	511	511
q18	7881	6983	7056	6983
q19	1094	960	617	617
q20	421	370	250	250
q21	4295	3983	3790	3790
q22	1069	1007	966	966
Total cold run time: 108184 ms
Total hot run time: 36219 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5067	4948	4927	4927
q2	332	391	335	335
q3	2123	2722	2311	2311
q4	1321	1742	1318	1318
q5	4986	4622	4538	4538
q6	222	171	131	131
q7	1980	1984	1857	1857
q8	2656	2649	2530	2530
q9	7508	7442	7542	7442
q10	3031	3240	3015	3015
q11	609	515	497	497
q12	715	761	604	604
q13	3594	4027	3412	3412
q14	315	311	270	270
q15	568	513	519	513
q16	919	916	906	906
q17	1244	1415	1439	1415
q18	7922	7702	7305	7305
q19	861	809	830	809
q20	1941	1957	1805	1805
q21	4712	4331	4338	4331
q22	1069	1040	1008	1008
Total cold run time: 53695 ms
Total hot run time: 51279 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 179217 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 00b41899d51fec67d14cc2dac99cf1510bfa94df, data reload: false

query5	4852	625	508	508
query6	342	236	219	219
query7	4218	481	289	289
query8	311	254	243	243
query9	8775	2638	2643	2638
query10	530	380	341	341
query11	15188	15184	14580	14580
query12	180	119	117	117
query13	1269	522	409	409
query14	6488	3332	3119	3119
query14_1	2917	2961	3011	2961
query15	217	201	189	189
query16	829	454	484	454
query17	1152	726	622	622
query18	2693	431	341	341
query19	225	224	204	204
query20	125	116	110	110
query21	220	137	112	112
query22	3944	3939	3826	3826
query23	16559	16209	15965	15965
query23_1	15935	15933	15960	15933
query24	7341	1658	1232	1232
query24_1	1261	1254	1250	1250
query25	560	477	423	423
query26	1256	273	160	160
query27	2757	478	317	317
query28	4453	2158	2146	2146
query29	779	569	443	443
query30	317	246	214	214
query31	824	702	620	620
query32	79	76	76	76
query33	557	338	287	287
query34	912	899	538	538
query35	767	835	744	744
query36	883	905	820	820
query37	136	97	85	85
query38	3855	3852	3833	3833
query39	752	736	729	729
query39_1	708	701	687	687
query40	224	135	129	129
query41	67	67	62	62
query42	113	106	108	106
query43	430	447	415	415
query44	1355	775	756	756
query45	197	192	183	183
query46	883	985	615	615
query47	1699	1705	1614	1614
query48	319	328	255	255
query49	646	435	348	348
query50	682	291	231	231
query51	3920	3914	3795	3795
query52	107	110	96	96
query53	328	352	305	305
query54	310	285	258	258
query55	78	83	78	78
query56	308	316	310	310
query57	1142	1134	1092	1092
query58	274	256	250	250
query59	2347	2438	2323	2323
query60	316	308	282	282
query61	158	160	176	160
query62	713	665	626	626
query63	333	297	302	297
query64	5010	1413	1133	1133
query65	4009	3942	3977	3942
query66	1430	467	344	344
query67	15061	14977	14553	14553
query68	5853	1031	747	747
query69	511	362	339	339
query70	1107	1011	1004	1004
query71	383	318	301	301
query72	6299	2683	5321	2683
query73	781	742	322	322
query74	8794	8737	8790	8737
query75	3584	3561	3156	3156
query76	3929	1151	760	760
query77	522	404	306	306
query78	9558	9693	8805	8805
query79	1438	874	602	602
query80	745	653	564	564
query81	530	273	241	241
query82	201	132	108	108
query83	259	267	240	240
query84	266	128	101	101
query85	910	520	470	470
query86	385	303	286	286
query87	4051	4047	4001	4001
query88	3153	2278	2236	2236
query89	467	441	386	386
query90	2016	158	158	158
query91	180	178	146	146
query92	77	75	70	70
query93	1141	939	573	573
query94	477	313	281	281
query95	587	332	365	332
query96	586	449	212	212
query97	2576	2651	2579	2579
query98	215	197	193	193
query99	1320	1284	1233	1233
Total cold run time: 260412 ms
Total hot run time: 179217 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.05
query2	0.09	0.04	0.05
query3	0.26	0.09	0.09
query4	1.61	0.11	0.11
query5	0.29	0.25	0.26
query6	1.18	0.64	0.63
query7	0.03	0.03	0.02
query8	0.06	0.05	0.04
query9	0.57	0.50	0.51
query10	0.56	0.56	0.55
query11	0.15	0.12	0.11
query12	0.14	0.11	0.12
query13	0.62	0.62	0.60
query14	1.00	0.99	0.99
query15	0.82	0.81	0.82
query16	0.39	0.39	0.40
query17	0.97	1.08	1.07
query18	0.23	0.20	0.21
query19	1.83	1.73	1.87
query20	0.02	0.01	0.01
query21	15.45	0.26	0.14
query22	4.92	0.06	0.04
query23	15.98	0.28	0.10
query24	1.11	0.25	0.21
query25	0.06	0.06	0.05
query26	0.14	0.13	0.13
query27	0.06	0.07	0.06
query28	3.15	1.22	1.02
query29	12.63	4.01	3.22
query30	0.27	0.14	0.12
query31	2.82	0.63	0.40
query32	3.23	0.55	0.47
query33	3.08	3.06	3.05
query34	16.79	5.24	4.53
query35	4.56	4.57	4.59
query36	0.67	0.52	0.49
query37	0.10	0.07	0.07
query38	0.06	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.14	0.14
query41	0.10	0.04	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.35 s
Total hot run time: 27.26 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 0.00% (0/140) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.34% (18715/35084)
Line Coverage 39.06% (173047/443015)
Region Coverage 33.75% (134261/397794)
Branch Coverage 34.67% (57698/166434)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 97.14% (136/140) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 72.23% (24837/34386)
Line Coverage 58.97% (260985/442537)
Region Coverage 53.97% (217227/402517)
Branch Coverage 55.45% (92777/167309)

@JoverZhang
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17668	5057	4877	4877
q2	2036	361	237	237
q3	10159	1327	729	729
q4	10216	856	322	322
q5	7531	2191	1885	1885
q6	192	174	134	134
q7	1005	863	708	708
q8	9348	1425	1217	1217
q9	7000	5314	5323	5314
q10	6803	2384	1969	1969
q11	534	310	297	297
q12	638	739	598	598
q13	17768	3668	3007	3007
q14	294	290	270	270
q15	571	518	496	496
q16	971	920	850	850
q17	701	827	490	490
q18	7517	7150	6972	6972
q19	1092	953	601	601
q20	401	363	245	245
q21	4249	3967	3557	3557
q22	1074	1004	919	919
Total cold run time: 107768 ms
Total hot run time: 35694 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4954	4968	4912	4912
q2	315	406	313	313
q3	2153	2719	2262	2262
q4	1313	1743	1302	1302
q5	4696	4820	4541	4541
q6	226	176	127	127
q7	2035	1999	1809	1809
q8	2746	2593	2767	2593
q9	7513	7543	7541	7541
q10	3072	3262	2819	2819
q11	587	516	493	493
q12	712	751	575	575
q13	3555	3847	3317	3317
q14	305	292	285	285
q15	552	511	516	511
q16	883	923	895	895
q17	1195	1594	1431	1431
q18	8022	7645	7513	7513
q19	864	858	893	858
q20	1958	2096	1962	1962
q21	4992	4275	4102	4102
q22	1090	998	1001	998
Total cold run time: 53738 ms
Total hot run time: 51159 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 181004 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 00b41899d51fec67d14cc2dac99cf1510bfa94df, data reload: false

query5	4934	610	473	473
query6	323	244	216	216
query7	4210	459	276	276
query8	313	240	237	237
query9	8769	2617	2643	2617
query10	545	394	342	342
query11	15482	15092	14528	14528
query12	179	116	116	116
query13	1264	510	439	439
query14	6317	3279	2968	2968
query14_1	2887	2845	2916	2845
query15	204	196	180	180
query16	849	460	459	459
query17	1088	703	574	574
query18	2634	433	344	344
query19	231	221	213	213
query20	125	113	109	109
query21	216	135	112	112
query22	4007	4033	4004	4004
query23	16538	16153	15944	15944
query23_1	15945	15986	16000	15986
query24	7368	1660	1205	1205
query24_1	1240	1252	1259	1252
query25	589	492	446	446
query26	1252	274	171	171
query27	2740	464	309	309
query28	4475	2161	2151	2151
query29	816	599	474	474
query30	326	255	218	218
query31	827	703	636	636
query32	84	76	82	76
query33	560	360	288	288
query34	905	910	554	554
query35	807	831	739	739
query36	883	900	800	800
query37	132	100	78	78
query38	3912	3881	3762	3762
query39	930	804	730	730
query39_1	695	880	861	861
query40	232	145	124	124
query41	73	71	83	71
query42	110	107	107	107
query43	431	429	409	409
query44	1325	760	759	759
query45	195	188	187	187
query46	885	990	616	616
query47	1649	1742	1609	1609
query48	319	334	262	262
query49	683	444	359	359
query50	674	310	220	220
query51	3861	3880	3792	3792
query52	112	114	100	100
query53	323	358	306	306
query54	315	278	273	273
query55	79	77	75	75
query56	316	312	312	312
query57	1157	1152	1085	1085
query58	280	267	254	254
query59	2334	2462	2267	2267
query60	319	312	289	289
query61	163	158	154	154
query62	698	674	608	608
query63	327	288	295	288
query64	4990	1293	973	973
query65	4030	4000	3939	3939
query66	1409	438	318	318
query67	15209	14760	14742	14742
query68	8406	1001	725	725
query69	492	347	309	309
query70	1096	975	958	958
query71	359	317	284	284
query72	6109	4929	5080	4929
query73	713	623	309	309
query74	8791	8704	8570	8570
query75	3609	3540	3144	3144
query76	3931	1138	770	770
query77	575	397	296	296
query78	9428	9583	8809	8809
query79	1379	848	619	619
query80	704	669	554	554
query81	510	274	244	244
query82	239	127	105	105
query83	266	255	238	238
query84	267	113	104	104
query85	915	511	463	463
query86	338	297	300	297
query87	4027	4000	4046	4000
query88	3727	2278	2246	2246
query89	471	424	395	395
query90	2224	157	152	152
query91	174	170	144	144
query92	82	70	69	69
query93	1433	926	575	575
query94	467	327	270	270
query95	575	381	322	322
query96	582	472	208	208
query97	2565	2623	2557	2557
query98	212	196	189	189
query99	1273	1276	1293	1276
Total cold run time: 263816 ms
Total hot run time: 181004 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.05
query2	0.10	0.05	0.05
query3	0.25	0.09	0.09
query4	1.61	0.11	0.11
query5	0.29	0.26	0.25
query6	1.16	0.64	0.63
query7	0.03	0.02	0.02
query8	0.05	0.04	0.04
query9	0.55	0.52	0.51
query10	0.56	0.54	0.56
query11	0.15	0.11	0.11
query12	0.15	0.11	0.12
query13	0.62	0.60	0.61
query14	0.98	0.98	0.99
query15	0.80	0.80	0.79
query16	0.42	0.39	0.43
query17	1.07	1.07	1.05
query18	0.22	0.20	0.21
query19	1.87	1.78	1.86
query20	0.02	0.01	0.02
query21	15.44	0.28	0.14
query22	4.89	0.06	0.05
query23	16.15	0.29	0.10
query24	0.92	0.40	0.18
query25	0.06	0.08	0.07
query26	0.14	0.14	0.13
query27	0.05	0.06	0.05
query28	3.44	1.24	1.02
query29	12.55	4.05	3.35
query30	0.30	0.15	0.12
query31	2.83	0.61	0.40
query32	3.23	0.56	0.47
query33	3.12	3.02	3.03
query34	16.96	5.19	4.49
query35	4.56	4.55	4.61
query36	0.66	0.50	0.49
query37	0.10	0.06	0.07
query38	0.07	0.05	0.04
query39	0.05	0.03	0.03
query40	0.17	0.15	0.14
query41	0.09	0.03	0.03
query42	0.05	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.82 s
Total hot run time: 27.3 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 0.00% (0/140) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.34% (18716/35088)
Line Coverage 39.05% (173047/443118)
Region Coverage 33.72% (134156/397901)
Branch Coverage 34.65% (57689/166486)

@JoverZhang
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17595	4264	4103	4103
q2	2036	347	262	262
q3	10160	1299	757	757
q4	10219	863	308	308
q5	7524	2137	1910	1910
q6	191	174	136	136
q7	1023	864	703	703
q8	9373	1414	1108	1108
q9	6929	5371	5287	5287
q10	6841	2396	1952	1952
q11	518	304	290	290
q12	648	716	559	559
q13	17817	3731	3001	3001
q14	288	319	281	281
q15	608	536	521	521
q16	938	904	862	862
q17	712	790	562	562
q18	7335	7132	6933	6933
q19	1100	985	629	629
q20	401	371	249	249
q21	4301	3956	3699	3699
q22	1071	1018	955	955
Total cold run time: 107628 ms
Total hot run time: 35067 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4168	4078	4044	4044
q2	336	413	326	326
q3	2162	2680	2329	2329
q4	1326	1772	1297	1297
q5	4213	4590	4718	4590
q6	228	174	129	129
q7	2068	1928	1795	1795
q8	2595	2550	2591	2550
q9	7519	7604	7424	7424
q10	3032	3198	2907	2907
q11	590	491	523	491
q12	644	896	634	634
q13	3617	3915	3649	3649
q14	283	294	266	266
q15	562	508	507	507
q16	890	944	891	891
q17	1181	1532	1429	1429
q18	7788	7779	7680	7680
q19	925	850	860	850
q20	1988	2082	1828	1828
q21	4586	4219	4098	4098
q22	1081	1048	979	979
Total cold run time: 51782 ms
Total hot run time: 50693 ms

@doris-robot
Copy link

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

query5	4993	611	489	489
query6	340	231	236	231
query7	4225	467	278	278
query8	317	260	243	243
query9	8777	2607	2597	2597
query10	533	395	330	330
query11	15435	14768	14999	14768
query12	205	121	117	117
query13	1257	515	418	418
query14	6314	3352	3044	3044
query14_1	2897	2905	2956	2905
query15	217	197	180	180
query16	866	474	462	462
query17	1135	733	627	627
query18	2713	450	354	354
query19	238	236	221	221
query20	131	117	115	115
query21	218	143	119	119
query22	3887	3917	3768	3768
query23	16484	16130	15885	15885
query23_1	16000	16198	16006	16006
query24	7376	1644	1260	1260
query24_1	1230	1249	1265	1249
query25	594	514	448	448
query26	1245	273	165	165
query27	2748	473	308	308
query28	4446	2178	2170	2170
query29	847	568	467	467
query30	316	248	217	217
query31	845	732	621	621
query32	82	72	73	72
query33	553	355	307	307
query34	896	915	552	552
query35	808	809	739	739
query36	896	969	822	822
query37	129	95	80	80
query38	3883	3786	3765	3765
query39	747	746	717	717
query39_1	704	700	703	700
query40	223	133	120	120
query41	67	63	61	61
query42	104	106	105	105
query43	430	427	391	391
query44	1346	750	767	750
query45	190	192	188	188
query46	891	974	626	626
query47	1674	1684	1606	1606
query48	313	320	245	245
query49	613	441	356	356
query50	647	300	218	218
query51	3851	3898	3952	3898
query52	104	107	97	97
query53	323	349	294	294
query54	292	267	253	253
query55	78	73	70	70
query56	290	308	288	288
query57	1138	1130	1048	1048
query58	264	254	247	247
query59	2330	2373	2350	2350
query60	311	309	332	309
query61	159	157	162	157
query62	707	700	611	611
query63	331	302	305	302
query64	5033	1301	1006	1006
query65	4022	3972	3920	3920
query66	1407	438	322	322
query67	14970	15200	15054	15054
query68	8489	1019	744	744
query69	489	361	310	310
query70	1093	989	995	989
query71	378	321	280	280
query72	6223	4963	5165	4963
query73	693	645	321	321
query74	8762	8743	8704	8704
query75	3686	3528	3176	3176
query76	4022	1147	798	798
query77	697	409	295	295
query78	9388	9703	8818	8818
query79	1671	879	643	643
query80	748	648	552	552
query81	536	277	239	239
query82	205	149	115	115
query83	272	257	240	240
query84	260	120	98	98
query85	940	506	475	475
query86	391	295	267	267
query87	4028	4119	4021	4021
query88	3219	2304	2297	2297
query89	474	452	391	391
query90	2166	163	159	159
query91	173	167	144	144
query92	79	65	70	65
query93	1853	886	586	586
query94	461	301	265	265
query95	574	389	304	304
query96	583	468	218	218
query97	2536	2674	2556	2556
query98	212	193	195	193
query99	1306	1292	1197	1197
Total cold run time: 263835 ms
Total hot run time: 181646 ms

@doris-robot
Copy link

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

query1	0.06	0.06	0.05
query2	0.11	0.06	0.05
query3	0.26	0.10	0.09
query4	1.61	0.12	0.11
query5	0.27	0.26	0.27
query6	1.17	0.65	0.63
query7	0.04	0.03	0.03
query8	0.06	0.05	0.05
query9	0.59	0.50	0.51
query10	0.58	0.56	0.56
query11	0.16	0.11	0.12
query12	0.15	0.11	0.12
query13	0.63	0.61	0.60
query14	0.99	1.01	0.99
query15	0.81	0.81	0.80
query16	0.40	0.38	0.40
query17	0.99	1.06	1.03
query18	0.23	0.22	0.21
query19	1.95	1.89	1.88
query20	0.02	0.02	0.02
query21	15.45	0.31	0.14
query22	4.54	0.05	0.05
query23	16.13	0.28	0.11
query24	1.52	0.54	0.26
query25	0.07	0.08	0.09
query26	0.14	0.14	0.14
query27	0.08	0.05	0.05
query28	4.08	1.24	1.02
query29	12.60	3.98	3.17
query30	0.30	0.16	0.13
query31	2.83	0.64	0.40
query32	3.25	0.55	0.47
query33	3.00	3.05	3.07
query34	16.61	5.25	4.51
query35	4.51	4.56	4.64
query36	0.65	0.51	0.49
query37	0.12	0.07	0.07
query38	0.07	0.04	0.04
query39	0.05	0.03	0.04
query40	0.18	0.15	0.14
query41	0.08	0.03	0.04
query42	0.05	0.04	0.03
query43	0.05	0.04	0.04
Total cold run time: 97.44 s
Total hot run time: 27.47 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 0.00% (0/140) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.34% (18717/35092)
Line Coverage 39.05% (173065/443183)
Region Coverage 33.74% (134254/397919)
Branch Coverage 34.66% (57702/166502)

@JoverZhang
Copy link
Contributor Author

I’m seeing a CI failure that seems related to an OSS download in the pipeline.

Error snippet:

16:54:14   ++ ossutil stat oss://opensource-pipeline/compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz -i ******* -k *******
16:54:14   + res='Error: oss: service returned error: StatusCode=404, ErrorCode=NoSuchKey, ErrorMessage="The specified key does not exist.", RequestId=69393536D21EAA3436AE2138, Bucket=opensource-pipeline, Object=compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz'
16:54:14   + '[' 1 -eq 0 ']'
16:54:14   + echo Error: oss: service returned error: StatusCode=404, ErrorCode=NoSuchKey, 'ErrorMessage="The' specified key does not 'exist.",' RequestId=69393536D21EAA3436AE2138, Bucket=opensource-pipeline, Object=compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz
16:54:14   + echo 'ERROR: oss://opensource-pipeline/compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz File not exits.'
16:54:14   + exit 1
16:54:14   Error: oss: service returned error: StatusCode=404, ErrorCode=NoSuchKey, ErrorMessage="The specified key does not exist.", RequestId=69393536D21EAA3436AE2138, Bucket=opensource-pipeline, Object=compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz
16:54:14   ERROR: oss://opensource-pipeline/compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz File not exits.
16:54:14   Process exited with code 1

I tried updating the branch several times, but the CI still fails with the same 404 error.

It looks like the OSS object compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz cannot be found.

Any guidance would be appreciated. Thanks!

Copy link
Contributor

@linrrzqqq linrrzqqq left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@zclllyybb zclllyybb requested a review from Copilot December 10, 2025 13:09
@zclllyybb
Copy link
Contributor

I’m seeing a CI failure that seems related to an OSS download in the pipeline.

Error snippet:

16:54:14   ++ ossutil stat oss://opensource-pipeline/compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz -i ******* -k *******
16:54:14   + res='Error: oss: service returned error: StatusCode=404, ErrorCode=NoSuchKey, ErrorMessage="The specified key does not exist.", RequestId=69393536D21EAA3436AE2138, Bucket=opensource-pipeline, Object=compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz'
16:54:14   + '[' 1 -eq 0 ']'
16:54:14   + echo Error: oss: service returned error: StatusCode=404, ErrorCode=NoSuchKey, 'ErrorMessage="The' specified key does not 'exist.",' RequestId=69393536D21EAA3436AE2138, Bucket=opensource-pipeline, Object=compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz
16:54:14   + echo 'ERROR: oss://opensource-pipeline/compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz File not exits.'
16:54:14   + exit 1
16:54:14   Error: oss: service returned error: StatusCode=404, ErrorCode=NoSuchKey, ErrorMessage="The specified key does not exist.", RequestId=69393536D21EAA3436AE2138, Bucket=opensource-pipeline, Object=compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz
16:54:14   ERROR: oss://opensource-pipeline/compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz File not exits.
16:54:14   Process exited with code 1

I tried updating the branch several times, but the CI still fails with the same 404 error.

It looks like the OSS object compile_result/55940_7af61913fc789b5aa9542add9e4463652bd0c0e8.tar.gz cannot be found.

Any guidance would be appreciated. Thanks!

I will look into it.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 97.14% (136/140) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 72.23% (24842/34394)
Line Coverage 58.95% (260948/442696)
Region Coverage 53.81% (216647/402627)
Branch Coverage 55.36% (92646/167361)

Copy link
Contributor

@zclllyybb zclllyybb left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Dec 10, 2025
@zclllyybb zclllyybb merged commit e06abed into apache:master Dec 10, 2025
35 of 36 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 10, 2025
…PG (#55940)

This PR reimplements `REGR_SLOPE` and `REGR_INTERCEPT` using the
Youngs–Cramer algorithm to align with PostgreSQL.

It also extends `AggregateFunctionRegrData<T>` so it can be reused by
all `REGR_*` functions (`SXX`, `SYY`, `SXY`, `R2`, etc.).

```sql
-- Copy from `regression-test/suites/query_p0/aggregate/support_type/regr_slope/regr_slope.groovy`
-- dataset (PostgreSQL)
drop table if exists d_table;
create table d_table (
    k1 int,
    k2 int not null,
    k3 bigint,
    col_tinyint smallint,
    col_smallint smallint,
    col_int int,
    col_bigint bigint,
    col_largeint numeric(38,0),
    col_float real,
    col_double double precision
);

insert into d_table values 
    (1, 1, 1, 100, 10000, 1000000, 10000000000, 100000000000000000000, 3.14, 2.718281828),
    (2, 2, 2, 101, 10001, 1000001, 10000000001, 100000000000000000001, 6.28, 3.141592653),
    (3, 3, 3, 102, 10002, 1000002, 10000000002, 100000000000000000002, 9.42, 1.618033988);

select regr_slope(col_tinyint, col_smallint) from d_table;
-- 1.0
select regr_slope(col_smallint, col_int) from d_table;
-- 1.0
select regr_slope(col_int, col_bigint) from d_table;
-- 1.0
select regr_slope(col_bigint, col_largeint) from d_table;
-- <null>
select regr_slope(col_largeint, col_float) from d_table;
-- 0.0
select regr_slope(col_float, col_double) from d_table;
-- -2.7928921351549283
select regr_slope(col_double, col_tinyint) from d_table;
-- -0.5501239200000003


select regr_intercept(col_tinyint, col_smallint) from d_table;
-- -9900.0
select regr_intercept(col_smallint, col_int) from d_table;
-- -990000.0
select regr_intercept(col_int, col_bigint) from d_table;
-- -9999000000.0
select regr_intercept(col_bigint, col_largeint) from d_table;
-- <null>
select regr_intercept(col_largeint, col_float) from d_table;
-- 1e+20
select regr_intercept(col_float, col_double) from d_table;
-- 13.241664047161668
select regr_intercept(col_double, col_tinyint) from d_table;
-- 58.055152076333364
```
starocean999 pushed a commit that referenced this pull request Dec 11, 2025
…PG (#55940)

This PR reimplements `REGR_SLOPE` and `REGR_INTERCEPT` using the
Youngs–Cramer algorithm to align with PostgreSQL.

It also extends `AggregateFunctionRegrData<T>` so it can be reused by
all `REGR_*` functions (`SXX`, `SYY`, `SXY`, `R2`, etc.).

```sql
-- Copy from `regression-test/suites/query_p0/aggregate/support_type/regr_slope/regr_slope.groovy`
-- dataset (PostgreSQL)
drop table if exists d_table;
create table d_table (
    k1 int,
    k2 int not null,
    k3 bigint,
    col_tinyint smallint,
    col_smallint smallint,
    col_int int,
    col_bigint bigint,
    col_largeint numeric(38,0),
    col_float real,
    col_double double precision
);

insert into d_table values 
    (1, 1, 1, 100, 10000, 1000000, 10000000000, 100000000000000000000, 3.14, 2.718281828),
    (2, 2, 2, 101, 10001, 1000001, 10000000001, 100000000000000000001, 6.28, 3.141592653),
    (3, 3, 3, 102, 10002, 1000002, 10000000002, 100000000000000000002, 9.42, 1.618033988);

select regr_slope(col_tinyint, col_smallint) from d_table;
-- 1.0
select regr_slope(col_smallint, col_int) from d_table;
-- 1.0
select regr_slope(col_int, col_bigint) from d_table;
-- 1.0
select regr_slope(col_bigint, col_largeint) from d_table;
-- <null>
select regr_slope(col_largeint, col_float) from d_table;
-- 0.0
select regr_slope(col_float, col_double) from d_table;
-- -2.7928921351549283
select regr_slope(col_double, col_tinyint) from d_table;
-- -0.5501239200000003


select regr_intercept(col_tinyint, col_smallint) from d_table;
-- -9900.0
select regr_intercept(col_smallint, col_int) from d_table;
-- -990000.0
select regr_intercept(col_int, col_bigint) from d_table;
-- -9999000000.0
select regr_intercept(col_bigint, col_largeint) from d_table;
-- <null>
select regr_intercept(col_largeint, col_float) from d_table;
-- 1e+20
select regr_intercept(col_float, col_double) from d_table;
-- 13.241664047161668
select regr_intercept(col_double, col_tinyint) from d_table;
-- 58.055152076333364
```
yiguolei pushed a commit that referenced this pull request Dec 11, 2025
… align with PG #55940 (#58920)

Cherry-picked from #55940

Co-authored-by: Jover <joverzh@gmail.com>
nagisa-kunhah pushed a commit to nagisa-kunhah/doris that referenced this pull request Dec 14, 2025
…PG (apache#55940)

This PR reimplements `REGR_SLOPE` and `REGR_INTERCEPT` using the
Youngs–Cramer algorithm to align with PostgreSQL.

It also extends `AggregateFunctionRegrData<T>` so it can be reused by
all `REGR_*` functions (`SXX`, `SYY`, `SXY`, `R2`, etc.).

```sql
-- Copy from `regression-test/suites/query_p0/aggregate/support_type/regr_slope/regr_slope.groovy`
-- dataset (PostgreSQL)
drop table if exists d_table;
create table d_table (
    k1 int,
    k2 int not null,
    k3 bigint,
    col_tinyint smallint,
    col_smallint smallint,
    col_int int,
    col_bigint bigint,
    col_largeint numeric(38,0),
    col_float real,
    col_double double precision
);

insert into d_table values 
    (1, 1, 1, 100, 10000, 1000000, 10000000000, 100000000000000000000, 3.14, 2.718281828),
    (2, 2, 2, 101, 10001, 1000001, 10000000001, 100000000000000000001, 6.28, 3.141592653),
    (3, 3, 3, 102, 10002, 1000002, 10000000002, 100000000000000000002, 9.42, 1.618033988);

select regr_slope(col_tinyint, col_smallint) from d_table;
-- 1.0
select regr_slope(col_smallint, col_int) from d_table;
-- 1.0
select regr_slope(col_int, col_bigint) from d_table;
-- 1.0
select regr_slope(col_bigint, col_largeint) from d_table;
-- <null>
select regr_slope(col_largeint, col_float) from d_table;
-- 0.0
select regr_slope(col_float, col_double) from d_table;
-- -2.7928921351549283
select regr_slope(col_double, col_tinyint) from d_table;
-- -0.5501239200000003


select regr_intercept(col_tinyint, col_smallint) from d_table;
-- -9900.0
select regr_intercept(col_smallint, col_int) from d_table;
-- -990000.0
select regr_intercept(col_int, col_bigint) from d_table;
-- -9999000000.0
select regr_intercept(col_bigint, col_largeint) from d_table;
-- <null>
select regr_intercept(col_largeint, col_float) from d_table;
-- 1e+20
select regr_intercept(col_float, col_double) from d_table;
-- 13.241664047161668
select regr_intercept(col_double, col_tinyint) from d_table;
-- 58.055152076333364
```
zclllyybb pushed a commit that referenced this pull request Dec 29, 2025
…onRegrData (#59224)

### What problem does this PR solve?

Issue Number: close #38977

Problem Summary:

This PR migrates regr_sxx/syy/sxy onto the shared
Moment(AggregateFunctionRegrData) introduced in #55940.

The original implementation and tests were done in #39187 by @wyxxxcat.
This PR builds on top of that work, refactoring it to reuse the same
state and merge logic.

---------

Co-authored-by: wyxxxcat <1520358997@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.0.2-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants