Skip to content

[Fix](nereids) Fix nullable date literal binding and date *_diff folding#64127

Merged
zclllyybb merged 2 commits into
apache:masterfrom
linrrzqqq:fix-ttz-nullable
Jun 9, 2026
Merged

[Fix](nereids) Fix nullable date literal binding and date *_diff folding#64127
zclllyybb merged 2 commits into
apache:masterfrom
linrrzqqq:fix-ttz-nullable

Conversation

@linrrzqqq

@linrrzqqq linrrzqqq commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Problem Summary

Two issues in the FE constant folding of date/time *_diff functions
(days_diff, weeks_diff, hours_diff, minutes_diff, seconds_diff,
milliseconds_diff, microseconds_diff). Both only affect FE folding — the BE
results were already correct — so debug_skip_fold_constant on/off could
disagree for the same query. (datediff / to_days already fold via
calc_daynr and are not changed here; this PR only brings the remaining
*_diff folding in line with them.)

1. Nullable string/date literals were resolved to TIMESTAMPTZ unexpectedly

During signature search an argument is only type-coerced when
argument.isLiteral() is true. A literal wrapped in nullable() /
non_nullable() is a function node, not a Literal, so the check fails: the
datetime coercion and the "no time zone → don't prefer TIMESTAMPTZ" scoring
are both skipped. With the scoring gone every candidate signature ties, and the
first one — the TIMESTAMPTZ overload — wins. So a plain, no-time-zone literal
that happens to be wrapped in nullable() is cast to timestamptz instead of
datetimev2.

The change unwraps nullable() / non_nullable() so the inner literal is
coerced exactly like a bare literal. Genuinely timezone-bearing literals
(e.g. '2021-12-31 00:30:00+08:00') still bind to TIMESTAMPTZ.

before:

explain select days_diff(nullable('2021-12-31 12:23:34'), nullable('0000-01-01 00:00:00'));

   0:VUNION(11)
      constant exprs:
          days_diff(CAST(nullable('2021-12-31 12:23:34') AS timestamptz(6)), CAST(nullable('0000-01-01 00:00:00') AS timestamptz(6)))

now:

   0:VUNION(11)
      constant exprs:
          days_diff(CAST(nullable('2021-12-31 12:23:34') AS datetimev2(6)), CAST(nullable('0000-01-01 00:00:00') AS datetimev2(6)))

2. Wrong day count when the range crosses year 0000

The folding used Java ChronoUnit.*.between(...). Java's java.time follows the
ISO proleptic Gregorian calendar in which year 0 is a leap year
(0000-02-29 exists). Doris/BE use the MySQL-style calc_daynr, in which year 0
is not a leap year. So whenever the interval crosses 0000-02-29, FE folding
was exactly one day larger than the BE result.

The change folds these functions from calc_daynr (DateLiteral.getTotalDays())
for the day count, plus the sub-day remainder for the time-aware units —
matching datediff / to_days and the BE. TimestampTzLiteral overloads are
added so timezone-bearing literals fold on the FE too.

before:

set debug_skip_fold_constant=false;  -- FE folds
select days_diff('0001-01-01 00:00:00', '0000-01-01 00:00:00');
+---------------------------------------------------------+
| days_diff('0001-01-01 00:00:00', '0000-01-01 00:00:00') |
+---------------------------------------------------------+
|                                                     366 |   -- wrong
+---------------------------------------------------------+

set debug_skip_fold_constant=true;   -- BE
select days_diff('0001-01-01 00:00:00', '0000-01-01 00:00:00');
+---------------------------------------------------------+
|                                                     365 |   -- correct
+---------------------------------------------------------+

now: FE folding matches BE, both return 365.

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

@linrrzqqq

Copy link
Copy Markdown
Collaborator Author

run buildall

@linrrzqqq

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found one blocking correctness issue in FE constant folding for days_diff. The new implementation diverges from BE/runtime semantics for DateTimeV2 cases that cross a date boundary but are less than a full day apart.

Critical checkpoint conclusions:

  • Goal/test coverage: The PR addresses nullable date literal binding and datediff folding, and adds regression coverage, but the new tests do not cover partial-day days_diff boundaries where folding must match runtime.
  • Scope/clarity: The change is mostly focused, but the days_diff folding change reuses to_days semantics where runtime uses full-day rounded-to-zero semantics.
  • Concurrency/lifecycle/config/compatibility/persistence: Not applicable; this is FE expression folding and tests only.
  • Parallel paths: BE runtime days_diff remains based on rounded full-day differences, so FE folding must stay aligned with it.
  • Tests/results: Added results are deterministic, but missing the boundary case that exposes this regression.
  • Observability/performance: Not applicable; no new runtime observability or hot-path performance concern found.
  • User focus: No additional user-provided focus points were supplied.

Please fix the folding implementation and add a regression case such as days_diff('2021-01-02 00:00:00', '2021-01-01 23:59:59'), which should fold to the same value as runtime evaluation.

@@ -1177,29 +1207,43 @@ public static Expression hoursDiff(DateV2Literal t1, DateV2Literal t2) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This changes days_diff folding for DateTimeV2 from whole-day duration semantics to calendar-day semantics, which no longer matches BE runtime. BE evaluates days_diff via datetime_diff<DAY> and date_diff_in_days_round_to_zero_by_time, so days_diff('2021-01-02 00:00:00', '2021-01-01 23:59:59') returns 0 at runtime because the difference is less than one full day. With this new toDays(t1) - toDays(t2) folding it returns 1, so enabling constant folding changes query results. The same issue applies to the overloads below where either argument is DateTimeV2Literal; only the pure DateV2 case is safe to compute from day numbers.

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 36.84% (14/38) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 73.68% (28/38) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17665	3979	3981	3979
q2	q3	10815	1361	796	796
q4	4683	478	355	355
q5	7554	890	584	584
q6	184	168	135	135
q7	767	858	630	630
q8	9380	1631	1600	1600
q9	5818	4516	4523	4516
q10	6801	1804	1514	1514
q11	430	268	262	262
q12	630	428	292	292
q13	18125	3325	2737	2737
q14	262	255	245	245
q15	q16	869	786	710	710
q17	987	974	937	937
q18	6782	5687	5677	5677
q19	1390	1368	1095	1095
q20	519	393	264	264
q21	6222	2727	2705	2705
q22	469	377	311	311
Total cold run time: 100352 ms
Total hot run time: 29344 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	5190	4737	4771	4737
q2	q3	4846	5283	4730	4730
q4	2132	2202	1386	1386
q5	4854	4883	4698	4698
q6	228	174	125	125
q7	1848	1781	1546	1546
q8	2380	2123	2080	2080
q9	7865	7646	7490	7490
q10	4752	4744	4261	4261
q11	530	382	349	349
q12	733	753	523	523
q13	3052	3351	2853	2853
q14	272	275	257	257
q15	q16	682	708	617	617
q17	1269	1244	1230	1230
q18	7532	6943	6755	6755
q19	1122	1090	1077	1077
q20	2220	2209	1932	1932
q21	5275	4550	4388	4388
q22	531	478	398	398
Total cold run time: 57313 ms
Total hot run time: 51432 ms

@hello-stephen

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

query5	4322	626	483	483
query6	452	196	176	176
query7	4817	563	289	289
query8	361	229	202	202
query9	8774	3947	4020	3947
query10	452	311	266	266
query11	5919	2337	2207	2207
query12	154	100	97	97
query13	1299	566	407	407
query14	6376	5339	5034	5034
query14_1	4371	4368	4358	4358
query15	202	199	174	174
query16	964	443	421	421
query17	918	688	582	582
query18	2443	465	329	329
query19	202	180	139	139
query20	119	107	105	105
query21	219	133	119	119
query22	13647	13640	13382	13382
query23	17363	16551	16155	16155
query23_1	16356	16316	16315	16315
query24	7571	1767	1324	1324
query24_1	1321	1330	1331	1330
query25	576	492	421	421
query26	1304	307	171	171
query27	2708	587	363	363
query28	4514	2050	2084	2050
query29	1105	636	508	508
query30	314	238	207	207
query31	1112	1085	956	956
query32	105	63	65	63
query33	514	327	259	259
query34	1210	1121	657	657
query35	760	782	704	704
query36	1393	1427	1235	1235
query37	163	107	94	94
query38	3210	3140	3055	3055
query39	932	921	914	914
query39_1	907	878	896	878
query40	221	131	107	107
query41	74	68	71	68
query42	100	98	97	97
query43	323	340	291	291
query44	
query45	201	188	183	183
query46	1086	1252	749	749
query47	2370	2391	2290	2290
query48	396	436	309	309
query49	642	519	358	358
query50	976	349	254	254
query51	4445	4309	4319	4309
query52	88	89	77	77
query53	244	264	207	207
query54	281	220	207	207
query55	83	80	68	68
query56	238	227	216	216
query57	1433	1423	1344	1344
query58	256	215	235	215
query59	1594	1688	1449	1449
query60	288	234	225	225
query61	160	153	155	153
query62	718	666	580	580
query63	225	187	186	186
query64	2548	761	622	622
query65	
query66	1778	454	330	330
query67	29830	29684	29786	29684
query68	
query69	426	302	267	267
query70	1001	979	926	926
query71	298	230	213	213
query72	2895	2671	2370	2370
query73	847	791	451	451
query74	5135	5015	4798	4798
query75	2648	2607	2271	2271
query76	2311	1148	750	750
query77	351	370	287	287
query78	12378	12356	11804	11804
query79	1253	1066	741	741
query80	528	457	387	387
query81	450	283	241	241
query82	241	158	121	121
query83	356	266	244	244
query84	302	142	109	109
query85	863	518	480	480
query86	349	301	290	290
query87	3338	3339	3206	3206
query88	3655	2782	2748	2748
query89	417	371	330	330
query90	2030	181	188	181
query91	188	170	139	139
query92	62	67	57	57
query93	1415	1486	920	920
query94	542	350	317	317
query95	688	459	346	346
query96	1057	798	319	319
query97	2690	2696	2547	2547
query98	214	206	204	204
query99	1173	1173	1023	1023
Total cold run time: 250602 ms
Total hot run time: 169204 ms

@linrrzqqq linrrzqqq force-pushed the fix-ttz-nullable branch 2 times, most recently from d00c6ad to 60668cb Compare June 5, 2026 11:55
@linrrzqqq

Copy link
Copy Markdown
Collaborator Author

run buildall

@linrrzqqq

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review summary:

No additional blocking issue found in this pass. I also considered the existing inline thread about days_diff DateTimeV2 folding and did not submit a duplicate comment.

Critical checkpoint conclusions:

  • Goal/test coverage: The PR targets FE constant folding and nullable literal signature binding for date/time diff functions. The added regression cases cover nullable string literals, timestamp-tz literals, time zone changes, and fold-constant checks.
  • Scope/clarity: The change is focused on FE Nereids expression folding/signature matching plus the corresponding regression outputs.
  • Concurrency/lifecycle/config: No new concurrency, lifecycle-sensitive static initialization, or configuration item is introduced.
  • Compatibility/protocol: No FE-BE protocol, storage format, or persisted metadata change is involved.
  • Parallel paths: I compared the FE folding paths with BE FunctionTimeDiff behavior for date/datetime/timestamptz. The current helper logic matches BE round-toward-zero behavior for day/week/hour/minute/second/millisecond/microsecond paths, and timestamp-tz overloads use the UTC-normalized literal representation.
  • Error handling/data correctness: No unchecked Status-like path applies in this FE Java code. I did not find a distinct constant-folding result mismatch beyond the already-known review context.
  • Performance/observability: The added work is constant-time literal evaluation only; no new observability appears necessary.
  • Tests: Regression tests are added in nereids_function_p0/scalar_function/D.groovy with output updates in D.out. I did not run the regression suite in this Actions review pass.

Focus points: The focus file says there were no additional user-provided review focus points.

@hello-stephen

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17830	4018	3984	3984
q2	q3	10742	1403	820	820
q4	4685	483	359	359
q5	7572	866	606	606
q6	184	176	138	138
q7	776	857	639	639
q8	9352	1662	1546	1546
q9	5776	4543	4525	4525
q10	6760	1803	1543	1543
q11	434	276	246	246
q12	626	423	289	289
q13	18111	3331	2794	2794
q14	267	262	243	243
q15	q16	820	773	709	709
q17	896	890	936	890
q18	6825	5802	5587	5587
q19	1360	1348	1049	1049
q20	514	396	276	276
q21	6210	2843	2707	2707
q22	454	370	321	321
Total cold run time: 100194 ms
Total hot run time: 29271 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	5189	4859	4786	4786
q2	q3	4988	5280	4701	4701
q4	2108	2212	1424	1424
q5	5060	4695	4677	4677
q6	255	178	125	125
q7	1955	1747	1539	1539
q8	2410	2098	2138	2098
q9	7865	7331	7418	7331
q10	4722	4670	4222	4222
q11	537	382	346	346
q12	736	736	527	527
q13	3051	3428	2789	2789
q14	270	276	256	256
q15	q16	677	696	604	604
q17	1283	1250	1236	1236
q18	7354	6821	6701	6701
q19	1150	1126	1136	1126
q20	2210	2234	1938	1938
q21	5272	4564	4402	4402
q22	502	475	415	415
Total cold run time: 57594 ms
Total hot run time: 51243 ms

@hello-stephen

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

query5	4342	646	480	480
query6	458	202	186	186
query7	4916	570	285	285
query8	369	215	210	210
query9	8791	4029	4025	4025
query10	472	313	263	263
query11	5899	2342	2148	2148
query12	158	103	99	99
query13	1294	640	452	452
query14	6395	5400	5086	5086
query14_1	4384	4394	4381	4381
query15	207	206	174	174
query16	1024	456	489	456
query17	1101	679	567	567
query18	2720	478	335	335
query19	205	186	141	141
query20	109	109	108	108
query21	220	144	121	121
query22	13598	13624	13388	13388
query23	17285	16443	16188	16188
query23_1	16383	16244	16386	16244
query24	7659	1794	1301	1301
query24_1	1283	1315	1303	1303
query25	540	452	384	384
query26	1308	330	170	170
query27	2722	559	329	329
query28	4442	2013	2004	2004
query29	1087	610	477	477
query30	308	234	196	196
query31	1127	1075	954	954
query32	102	60	60	60
query33	511	322	247	247
query34	1191	1122	660	660
query35	756	774	708	708
query36	1409	1453	1279	1279
query37	149	101	90	90
query38	3257	3157	3033	3033
query39	934	920	896	896
query39_1	879	911	877	877
query40	236	122	100	100
query41	65	62	65	62
query42	97	94	96	94
query43	317	316	274	274
query44	
query45	194	183	181	181
query46	1091	1191	717	717
query47	2397	2394	2315	2315
query48	387	437	302	302
query49	632	464	359	359
query50	959	351	261	261
query51	4295	4259	4217	4217
query52	87	87	77	77
query53	237	270	188	188
query54	266	217	194	194
query55	78	73	69	69
query56	244	232	225	225
query57	1443	1406	1332	1332
query58	236	215	216	215
query59	1573	1637	1441	1441
query60	280	239	228	228
query61	163	163	165	163
query62	700	655	590	590
query63	227	186	187	186
query64	2549	785	671	671
query65	
query66	1749	461	352	352
query67	29725	29673	28792	28792
query68	
query69	430	302	266	266
query70	939	987	943	943
query71	296	225	205	205
query72	3010	2652	2461	2461
query73	865	769	426	426
query74	5122	4954	4766	4766
query75	2671	2575	2270	2270
query76	2305	1139	798	798
query77	362	391	326	326
query78	12294	12333	12027	12027
query79	1228	1053	770	770
query80	555	488	396	396
query81	457	283	236	236
query82	236	159	121	121
query83	273	276	250	250
query84	265	146	109	109
query85	846	536	440	440
query86	313	309	284	284
query87	3323	3380	3206	3206
query88	3662	2740	2747	2740
query89	419	379	331	331
query90	2158	176	180	176
query91	176	173	137	137
query92	63	62	58	58
query93	1506	1418	901	901
query94	545	365	312	312
query95	683	457	353	353
query96	1063	817	364	364
query97	2708	2713	2584	2584
query98	211	207	201	201
query99	1187	1170	1030	1030
Total cold run time: 250753 ms
Total hot run time: 169382 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 16.48% (43/261) 🎉
Increment coverage report
Complete coverage report

}

private static int dateDiff(LocalDateTime date1, LocalDateTime date2) {
return ((int) ChronoUnit.DAYS.between(date2.toLocalDate(), date1.toLocalDate()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

以前的错误在哪?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ChronoUnit 认为0000 年 2 月是闰年,但是我们内部的行为应该是认为0000年是平年, 所以常量折叠如果覆盖到了 0000.2, 就会多一天出来

if (!argument.isNullLiteral() && argument.isLiteral() && realType.isStringLikeType()) {
realType = TypeCoercionUtils.characterLiteralTypeCoercion(((Literal) argument).getStringValue(),
Optional<Literal> literalAfterUnwrapNullable = ExpressionUtils.getLiteralAfterUnwrapNullable(argument);
if (!argument.isNullLiteral() && literalAfterUnwrapNullable.isPresent() && realType.isStringLikeType()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这个得优化器看下

@linrrzqqq

Copy link
Copy Markdown
Collaborator Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17835	4117	4122	4117
q2	q3	10797	1366	826	826
q4	4683	471	353	353
q5	7563	864	589	589
q6	184	174	138	138
q7	783	848	661	661
q8	9361	1576	1565	1565
q9	5752	4556	4515	4515
q10	6844	1862	1537	1537
q11	437	286	252	252
q12	622	432	304	304
q13	18129	3357	2765	2765
q14	276	256	247	247
q15	q16	820	776	708	708
q17	981	915	942	915
q18	6953	5646	5564	5564
q19	1336	1190	1086	1086
q20	523	409	269	269
q21	6253	2842	2638	2638
q22	463	384	315	315
Total cold run time: 100595 ms
Total hot run time: 29364 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	5129	4741	4728	4728
q2	q3	4898	5288	4775	4775
q4	2098	2176	1427	1427
q5	4733	4770	4671	4671
q6	237	178	123	123
q7	1837	1728	1584	1584
q8	2371	2122	2072	2072
q9	7942	7791	7409	7409
q10	4743	4660	4224	4224
q11	532	384	353	353
q12	723	738	523	523
q13	3026	3354	2825	2825
q14	273	276	261	261
q15	q16	682	705	632	632
q17	1268	1263	1251	1251
q18	7122	6736	6722	6722
q19	1138	1132	1112	1112
q20	2246	2205	1931	1931
q21	5294	4565	4458	4458
q22	506	455	399	399
Total cold run time: 56798 ms
Total hot run time: 51480 ms

@hello-stephen

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

query5	4316	627	483	483
query6	435	203	182	182
query7	4881	544	311	311
query8	369	225	203	203
query9	8758	4015	4060	4015
query10	445	315	266	266
query11	5929	2390	2139	2139
query12	158	103	97	97
query13	1279	628	454	454
query14	6307	5418	5066	5066
query14_1	4426	4384	4428	4384
query15	208	201	177	177
query16	1030	503	446	446
query17	1144	724	584	584
query18	2573	488	354	354
query19	224	190	149	149
query20	114	111	106	106
query21	217	144	124	124
query22	13747	13630	13344	13344
query23	17389	16411	16196	16196
query23_1	16176	16310	16466	16310
query24	7500	1773	1347	1347
query24_1	1350	1332	1339	1332
query25	578	497	431	431
query26	1349	316	168	168
query27	2618	525	342	342
query28	4416	2074	2024	2024
query29	1080	612	509	509
query30	319	233	207	207
query31	1113	1083	956	956
query32	113	63	60	60
query33	524	347	265	265
query34	1178	1152	688	688
query35	748	787	688	688
query36	1386	1475	1182	1182
query37	152	102	92	92
query38	3194	3150	3061	3061
query39	953	916	902	902
query39_1	869	884	869	869
query40	223	121	102	102
query41	65	62	63	62
query42	95	94	91	91
query43	318	319	280	280
query44	
query45	200	185	180	180
query46	1115	1219	773	773
query47	2392	2314	2239	2239
query48	397	375	280	280
query49	637	475	353	353
query50	944	370	257	257
query51	4319	4329	4273	4273
query52	88	88	85	85
query53	248	285	194	194
query54	285	222	192	192
query55	79	74	76	74
query56	241	222	245	222
query57	1440	1420	1322	1322
query58	246	226	212	212
query59	1611	1686	1464	1464
query60	286	259	250	250
query61	164	161	160	160
query62	697	654	578	578
query63	230	189	184	184
query64	2550	836	640	640
query65	
query66	1756	463	340	340
query67	29893	29772	29682	29682
query68	
query69	422	296	262	262
query70	980	944	936	936
query71	305	226	231	226
query72	2966	2673	2381	2381
query73	854	744	403	403
query74	5125	4985	4745	4745
query75	2646	2607	2242	2242
query76	2318	1138	773	773
query77	361	380	285	285
query78	12441	12492	12014	12014
query79	1410	1059	767	767
query80	647	469	382	382
query81	459	289	236	236
query82	581	158	123	123
query83	330	276	244	244
query84	260	135	109	109
query85	892	525	444	444
query86	376	294	292	292
query87	3371	3373	3161	3161
query88	3597	2773	2730	2730
query89	431	371	332	332
query90	1886	174	183	174
query91	175	168	146	146
query92	66	62	58	58
query93	1550	1420	898	898
query94	555	353	300	300
query95	685	485	344	344
query96	1019	772	348	348
query97	2709	2731	2593	2593
query98	214	210	203	203
query99	1114	1175	1079	1079
Total cold run time: 251280 ms
Total hot run time: 170016 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 17.74% (11/62) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 66.13% (41/62) 🎉
Increment coverage report
Complete coverage report

@zclllyybb zclllyybb self-assigned this Jun 8, 2026
@linrrzqqq

Copy link
Copy Markdown
Collaborator Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17627	4105	3998	3998
q2	q3	10761	1443	819	819
q4	4684	485	344	344
q5	7535	918	580	580
q6	202	173	139	139
q7	787	838	652	652
q8	9388	1611	1602	1602
q9	5862	4591	4565	4565
q10	6804	1826	1540	1540
q11	434	282	256	256
q12	634	430	294	294
q13	18152	3432	2845	2845
q14	267	257	239	239
q15	q16	827	778	719	719
q17	1003	903	973	903
q18	7213	5877	5561	5561
q19	2380	1302	1009	1009
q20	540	433	265	265
q21	6348	2942	2624	2624
q22	457	380	324	324
Total cold run time: 101905 ms
Total hot run time: 29278 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	5232	4856	5041	4856
q2	q3	4968	5341	4615	4615
q4	2142	2208	1397	1397
q5	4776	4952	4708	4708
q6	241	179	128	128
q7	1925	1807	1550	1550
q8	2525	2233	2141	2141
q9	7952	7665	7463	7463
q10	4745	4715	4206	4206
q11	554	408	371	371
q12	733	742	530	530
q13	3052	3399	2801	2801
q14	282	290	260	260
q15	q16	679	701	622	622
q17	1311	1284	1271	1271
q18	7255	6987	6726	6726
q19	1105	1073	1074	1073
q20	2237	2230	1948	1948
q21	5315	4637	4470	4470
q22	524	468	419	419
Total cold run time: 57553 ms
Total hot run time: 51555 ms

@hello-stephen

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

query5	4308	636	464	464
query6	442	209	187	187
query7	4849	588	315	315
query8	366	221	203	203
query9	8767	4042	4029	4029
query10	451	304	265	265
query11	5962	2328	2186	2186
query12	157	105	102	102
query13	1258	592	431	431
query14	6358	5381	5071	5071
query14_1	4390	4415	4360	4360
query15	201	200	178	178
query16	1058	475	442	442
query17	1124	705	571	571
query18	2479	466	332	332
query19	197	179	140	140
query20	113	109	112	109
query21	224	140	117	117
query22	13711	13694	13400	13400
query23	17384	16618	16254	16254
query23_1	16243	16290	16334	16290
query24	7699	1817	1306	1306
query24_1	1295	1297	1322	1297
query25	596	483	431	431
query26	1301	346	166	166
query27	2664	584	349	349
query28	4491	2042	2009	2009
query29	1088	631	511	511
query30	311	235	206	206
query31	1122	1091	967	967
query32	107	65	61	61
query33	551	345	266	266
query34	1179	1159	666	666
query35	762	786	684	684
query36	1409	1449	1228	1228
query37	159	110	95	95
query38	3235	3162	3099	3099
query39	947	917	898	898
query39_1	870	886	881	881
query40	226	135	108	108
query41	71	80	75	75
query42	98	97	97	97
query43	327	327	302	302
query44	
query45	203	191	184	184
query46	1125	1186	743	743
query47	2418	2379	2230	2230
query48	419	432	313	313
query49	651	490	376	376
query50	998	364	279	279
query51	4352	4324	4290	4290
query52	89	92	81	81
query53	250	290	200	200
query54	291	253	226	226
query55	82	77	76	76
query56	281	244	244	244
query57	1438	1414	1326	1326
query58	268	228	233	228
query59	1573	1672	1395	1395
query60	320	287	255	255
query61	201	159	160	159
query62	706	649	586	586
query63	233	182	191	182
query64	2554	787	637	637
query65	
query66	1793	453	347	347
query67	29718	29823	29591	29591
query68	
query69	413	325	261	261
query70	999	971	953	953
query71	306	221	215	215
query72	3115	2707	2451	2451
query73	865	756	421	421
query74	5111	4973	4800	4800
query75	2663	2603	2251	2251
query76	2294	1169	765	765
query77	359	385	280	280
query78	12425	12524	11985	11985
query79	1460	1058	753	753
query80	653	471	411	411
query81	480	286	246	246
query82	568	162	126	126
query83	319	276	251	251
query84	
query85	916	524	448	448
query86	377	296	308	296
query87	3377	3340	3181	3181
query88	3675	2756	2743	2743
query89	447	386	326	326
query90	1937	182	185	182
query91	178	161	137	137
query92	66	61	55	55
query93	1461	1461	948	948
query94	568	378	297	297
query95	703	383	349	349
query96	1041	790	357	357
query97	2695	2699	2608	2608
query98	214	210	209	209
query99	1155	1181	1047	1047
Total cold run time: 251763 ms
Total hot run time: 169681 ms

@924060929 924060929 changed the title [Fix](nereids) Fix nullable date literal binding and datediff folding [Fix](nereids) Fix nullable date literal binding and date *_diff folding Jun 9, 2026
@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 24.34% (37/152) 🎉
Increment coverage report
Complete coverage report

@zclllyybb

Copy link
Copy Markdown
Contributor

skip buildall

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@zclllyybb zclllyybb merged commit 43800f3 into apache:master Jun 9, 2026
35 checks passed
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.1.x dev/4.1.x-conflict reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants