Skip to content

[fix](function) fix map_contains_entry runtime error when TIMESTAMPTZ is map key or value#63124

Open
Mryange wants to merge 1 commit intoapache:masterfrom
Mryange:fix-map_contains_entry-TIMESTAMPTZ
Open

[fix](function) fix map_contains_entry runtime error when TIMESTAMPTZ is map key or value#63124
Mryange wants to merge 1 commit intoapache:masterfrom
Mryange:fix-map_contains_entry-TIMESTAMPTZ

Conversation

@Mryange
Copy link
Copy Markdown
Contributor

@Mryange Mryange commented May 11, 2026

What problem does this PR solve?

Issue Number: N/A

Problem Summary: map_contains_entry throws a RUNTIME_ERROR at BE execution time when the MAP column has TIMESTAMPTZ as its key or value type. Root cause: FunctionMapContainsEntry::is_equality_comparison_supported hard-coded a list of accepted primitive types (is_date_type, is_time_type, is_number, is_string_type, is_ip) but omitted TYPE_TIMESTAMPTZ. As a result, the pre-execution type guard always rejected TIMESTAMPTZ even though the underlying dispatch_switch_all + ColumnVector::compare_at path supports it correctly. The fix replaces the hand-maintained list with a direct call to dispatch_switch_all, which already covers TIMESTAMPTZ in its DATETIME branch, making the guard consistent with the actual dispatch layer.

Release note

None

Check List (For Author)

  • Test

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

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

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

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

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

@Mryange
Copy link
Copy Markdown
Contributor Author

Mryange commented May 11, 2026

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

No blocking issues found in this review.

Critical checkpoint conclusions:

  • Goal and proof: The PR fixes map_contains_entry rejecting TIMESTAMPTZ by aligning the guard with dispatch_switch_all; the added regression covers TIMESTAMPTZ as both map key and value, literals and table columns, hits/misses, and null search arguments.
  • Scope: The code change is small and focused on the BE support check plus targeted regression coverage.
  • Concurrency/lifecycle/config/storage compatibility: Not applicable; this is a scalar-function execution guard and regression test only.
  • Parallel code paths: The FE/Nereids signature already coerces map key/value search arguments to comparable types; BE dispatch already supports TYPE_TIMESTAMPTZ, so the guard now matches the downstream path.
  • Test coverage: Regression test output is deterministic for table queries via ORDER BY; scalar single-row queries do not need ordering. No additional user-provided focus points were supplied.
  • Performance/observability: No material performance or observability impact identified; the guard uses the same dispatch mechanism as execution.

I did not run the regression test in this review environment.

@Mryange
Copy link
Copy Markdown
Contributor Author

Mryange commented May 11, 2026

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 29355 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit dc96e46cadc6209de78101afe64f1d766551410f, 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	17660	3800	3811	3800
q2	q3	10710	876	607	607
q4	4658	453	353	353
q5	7433	1338	1146	1146
q6	194	169	137	137
q7	928	937	757	757
q8	10232	1399	1288	1288
q9	6402	5426	5357	5357
q10	6349	2088	1795	1795
q11	471	263	250	250
q12	698	418	299	299
q13	18251	3335	2751	2751
q14	286	285	261	261
q15	q16	907	863	789	789
q17	989	1007	696	696
q18	6437	5700	5642	5642
q19	1189	1197	1007	1007
q20	515	387	254	254
q21	4633	2281	1859	1859
q22	420	357	307	307
Total cold run time: 99362 ms
Total hot run time: 29355 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	4166	4073	4051	4051
q2	q3	4634	4760	4152	4152
q4	2084	2174	1388	1388
q5	4948	4982	5292	4982
q6	189	163	129	129
q7	2025	2008	1726	1726
q8	3379	3164	3101	3101
q9	8453	8453	8368	8368
q10	4476	4527	4260	4260
q11	629	411	409	409
q12	701	744	522	522
q13	3171	3591	2961	2961
q14	296	299	268	268
q15	q16	759	799	709	709
q17	1354	1308	1260	1260
q18	8224	7177	7069	7069
q19	1147	1178	1179	1178
q20	2299	2319	1935	1935
q21	6079	5378	4875	4875
q22	584	544	416	416
Total cold run time: 59597 ms
Total hot run time: 53759 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

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

query5	4311	644	516	516
query6	338	229	208	208
query7	4237	578	312	312
query8	323	226	215	215
query9	8776	4007	3995	3995
query10	451	340	287	287
query11	5966	2600	2176	2176
query12	184	128	131	128
query13	1282	592	429	429
query14	6688	5358	5054	5054
query14_1	4361	4312	4320	4312
query15	208	198	182	182
query16	997	471	418	418
query17	1153	760	614	614
query18	2735	498	346	346
query19	232	212	164	164
query20	138	132	129	129
query21	215	135	121	121
query22	13552	13486	13405	13405
query23	17092	16420	16595	16420
query23_1	16367	16268	16241	16241
query24	7840	1830	1447	1447
query24_1	1376	1403	1403	1403
query25	577	502	442	442
query26	1318	329	170	170
query27	2914	616	348	348
query28	4418	2053	1986	1986
query29	1084	657	541	541
query30	321	256	204	204
query31	1145	1056	922	922
query32	81	72	71	71
query33	553	347	285	285
query34	1158	1114	652	652
query35	760	774	676	676
query36	1327	1300	1199	1199
query37	161	109	87	87
query38	3220	3180	3083	3083
query39	920	929	887	887
query39_1	876	884	862	862
query40	249	156	138	138
query41	68	101	60	60
query42	107	104	106	104
query43	320	314	276	276
query44	
query45	215	203	190	190
query46	1083	1217	741	741
query47	2346	2330	2193	2193
query48	386	412	300	300
query49	639	522	418	418
query50	708	281	213	213
query51	4332	4231	4226	4226
query52	103	104	94	94
query53	247	273	199	199
query54	306	262	268	262
query55	96	88	86	86
query56	297	299	295	295
query57	1445	1399	1293	1293
query58	304	278	271	271
query59	1559	1562	1415	1415
query60	360	337	321	321
query61	154	152	154	152
query62	669	614	551	551
query63	241	196	204	196
query64	2175	814	669	669
query65	
query66	1661	507	390	390
query67	30197	29999	29952	29952
query68	
query69	478	341	308	308
query70	1081	974	922	922
query71	318	272	269	269
query72	2926	2772	2425	2425
query73	838	743	403	403
query74	5050	4917	4726	4726
query75	2758	2659	2325	2325
query76	2282	1122	761	761
query77	420	416	351	351
query78	13005	12857	12324	12324
query79	1292	963	704	704
query80	613	585	487	487
query81	447	277	241	241
query82	234	157	121	121
query83	366	283	251	251
query84	261	148	113	113
query85	930	591	551	551
query86	358	334	328	328
query87	3417	3336	3214	3214
query88	3495	2672	2664	2664
query89	401	381	340	340
query90	2088	183	175	175
query91	174	162	138	138
query92	75	72	71	71
query93	945	960	558	558
query94	519	340	298	298
query95	672	472	344	344
query96	1041	737	359	359
query97	2742	2699	2547	2547
query98	238	233	225	225
query99	1106	1134	991	991
Total cold run time: 253435 ms
Total hot run time: 170532 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants