Skip to content

[refactor](be) Remove unused JSON helpers#64002

Merged
mrhhsg merged 1 commit into
apache:masterfrom
mrhhsg:refactor/remove-unused-json-helpers
Jun 3, 2026
Merged

[refactor](be) Remove unused JSON helpers#64002
mrhhsg merged 1 commit into
apache:masterfrom
mrhhsg:refactor/remove-unused-json-helpers

Conversation

@mrhhsg
Copy link
Copy Markdown
Member

@mrhhsg mrhhsg commented Jun 2, 2026

What problem does this PR solve?

Issue Number: None

Problem Summary:

Remove dead helper code from BE JSON-related implementations:

  • Remove the unused ExecuteReducer template and its JsonParser/path parsing helper chain from function_json.cpp.
  • Remove the unused convert_jsonb_to_rapidjson declaration/definition after its only live dependency was removed.
  • Remove the commented-out test helper that referenced the deleted conversion helper.
  • Clean up now-unused includes and make small style cleanups around the touched code.

This is an internal cleanup only and does not change JSON function behavior.

Release note

None

Check List (For Author)

  • Test: Manual test
    • ninja -C be/ut_build_ASAN src/core/CMakeFiles/Core.dir/data_type_serde/data_type_jsonb_serde.cpp.o src/exprs/CMakeFiles/Exprs.dir/function/function_json.cpp.o test/CMakeFiles/doris_be_test.dir/core/column/column_variant_test.cpp.o
    • build-support/clang-format.sh
    • build-support/check-format.sh
    • git diff --check
  • Behavior changed: No
  • Does this need documentation: No

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Remove dead helper code from BE JSON-related implementations. ExecuteReducer and its JsonParser/path parsing helper chain in function_json.cpp had no live callers after the registered JSON functions were narrowed to json_quote, json_unquote, and json_valid. The Jsonb-to-RapidJSON conversion helper also became unused, so this removes its declaration/definition and the only commented-out test helper that referenced it. The remaining small changes clean up now-unneeded includes and const/range-loop style around the touched code.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - DORIS_HOME=/mnt/disk7/hushenggang/doris ninja -C be/ut_build_ASAN src/core/CMakeFiles/Core.dir/data_type_serde/data_type_jsonb_serde.cpp.o src/exprs/CMakeFiles/Exprs.dir/function/function_json.cpp.o test/CMakeFiles/doris_be_test.dir/core/column/column_variant_test.cpp.o
    - build-support/clang-format.sh
    - build-support/check-format.sh
    - git diff --check
- Behavior changed: No
- Does this need documentation: No
@mrhhsg
Copy link
Copy Markdown
Member Author

mrhhsg commented Jun 2, 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.

Review opinion: approve / no blocking issues found.

Critical checkpoint conclusions:

  • Goal and proof: The PR removes unused BE JSON helper code. I verified the removed symbols only had self-references or a commented-out test reference at the base commit, and live JSON function registrations remain in function_json.cpp / function_jsonb.cpp. Author-provided testing is object compilation plus format checks; I also ran git diff --check locally.
  • Scope: The change is small and focused on dead-code deletion plus minor style cleanup in touched code.
  • Concurrency/lifecycle: No new concurrency, shared state, static initialization, or lifecycle behavior is introduced.
  • Config/compatibility/protocol: No new configs, serialization formats, thrift/protobuf contracts, or FE-BE protocol changes.
  • Parallel code paths: Live JSON path/extract helpers remain in json_functions.cpp and JSONB implementations remain registered in function_jsonb.cpp; no missing parallel update found.
  • Error handling/data correctness: No runtime behavior path is changed by the removed unused helpers; remaining touched functions keep existing Status/null handling.
  • Tests/results: No new functional tests are needed for dead-code removal. I could not run BE object compilation in this runner because no be/ut_build_ASAN build directory exists.
  • Observability/performance: No observability need; removing dead code reduces compile surface and has no runtime performance risk.
  • User focus: No additional user-provided review focus was specified.

@mrhhsg
Copy link
Copy Markdown
Member Author

mrhhsg commented Jun 2, 2026

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/4) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 54.17% (21134/39014)
Line Coverage 37.71% (200754/532425)
Region Coverage 33.81% (157925/467158)
Branch Coverage 34.79% (68983/198291)

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (4/4) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.90% (28233/38204)
Line Coverage 57.87% (307292/531049)
Region Coverage 54.67% (257819/471579)
Branch Coverage 56.12% (111692/199037)

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 28774 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 2c42339747e8824cd5e46df739324632a746d418, 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	17599	3971	3955	3955
q2	q3	10804	1407	834	834
q4	4719	481	351	351
q5	7798	899	604	604
q6	241	178	137	137
q7	837	855	656	656
q8	10295	1597	1683	1597
q9	6656	4527	4484	4484
q10	6843	1819	1517	1517
q11	443	268	255	255
q12	635	424	287	287
q13	18139	3449	2780	2780
q14	267	266	242	242
q15	q16	819	769	700	700
q17	958	889	991	889
q18	6876	5749	5451	5451
q19	1314	1315	1060	1060
q20	520	417	262	262
q21	5600	2654	2414	2414
q22	434	357	299	299
Total cold run time: 101797 ms
Total hot run time: 28774 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	4325	4261	4282	4261
q2	q3	4479	4924	4293	4293
q4	2101	2190	1413	1413
q5	4427	4317	4350	4317
q6	228	173	130	130
q7	1731	1890	1809	1809
q8	2591	2167	2106	2106
q9	7946	7960	7790	7790
q10	4852	4790	4350	4350
q11	582	419	400	400
q12	752	764	532	532
q13	3514	3633	3069	3069
q14	325	314	291	291
q15	q16	739	727	650	650
q17	1374	1322	1333	1322
q18	7830	7737	6891	6891
q19	1130	1110	1137	1110
q20	2224	2183	1951	1951
q21	5284	4583	4417	4417
q22	512	453	397	397
Total cold run time: 56946 ms
Total hot run time: 51499 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

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

query5	4376	643	484	484
query6	452	213	181	181
query7	4809	582	316	316
query8	368	224	229	224
query9	8757	4108	4079	4079
query10	456	312	259	259
query11	5816	2345	2195	2195
query12	155	109	103	103
query13	1262	626	426	426
query14	6408	5432	5147	5147
query14_1	4379	4400	4388	4388
query15	201	194	179	179
query16	991	457	411	411
query17	1103	689	568	568
query18	2447	473	331	331
query19	203	179	141	141
query20	109	107	110	107
query21	217	136	121	121
query22	13591	13677	13379	13379
query23	17436	16518	16088	16088
query23_1	16309	16289	16201	16201
query24	7438	1765	1332	1332
query24_1	1300	1296	1333	1296
query25	552	450	402	402
query26	1321	323	163	163
query27	2675	548	335	335
query28	4524	2055	2079	2055
query29	1076	636	480	480
query30	301	236	198	198
query31	1117	1076	950	950
query32	112	62	59	59
query33	503	330	252	252
query34	1193	1174	650	650
query35	753	773	695	695
query36	1380	1435	1222	1222
query37	154	105	92	92
query38	3214	3156	3086	3086
query39	916	930	904	904
query39_1	890	878	897	878
query40	219	123	101	101
query41	64	62	62	62
query42	96	96	96	96
query43	332	337	282	282
query44	
query45	202	188	176	176
query46	1090	1190	758	758
query47	2317	2467	2229	2229
query48	397	424	287	287
query49	630	477	342	342
query50	1004	357	258	258
query51	4297	4324	4307	4307
query52	90	91	79	79
query53	250	275	193	193
query54	273	217	202	202
query55	86	80	70	70
query56	249	231	212	212
query57	1428	1404	1302	1302
query58	237	220	210	210
query59	1560	1625	1422	1422
query60	285	251	233	233
query61	163	170	187	170
query62	710	676	617	617
query63	227	181	189	181
query64	2567	804	620	620
query65	
query66	1823	468	334	334
query67	29874	29774	29558	29558
query68	
query69	425	310	265	265
query70	972	907	990	907
query71	300	221	215	215
query72	2945	2318	2426	2318
query73	868	783	436	436
query74	5179	4973	4792	4792
query75	2688	2615	2275	2275
query76	2295	1184	815	815
query77	375	384	284	284
query78	12582	12388	11945	11945
query79	1249	1030	739	739
query80	570	497	444	444
query81	452	284	239	239
query82	247	160	120	120
query83	280	280	250	250
query84	259	137	110	110
query85	847	524	440	440
query86	335	301	279	279
query87	3375	3388	3200	3200
query88	3710	2809	2748	2748
query89	419	385	328	328
query90	2164	185	187	185
query91	177	167	135	135
query92	64	63	55	55
query93	1461	1424	952	952
query94	539	334	331	331
query95	691	380	434	380
query96	1081	759	362	362
query97	2664	2706	2534	2534
query98	222	203	205	203
query99	1144	1178	1035	1035
Total cold run time: 250753 ms
Total hot run time: 170096 ms

Copy link
Copy Markdown
Member

@eldenmoon eldenmoon left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jun 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

PR approved by anyone and no changes requested.

@mrhhsg mrhhsg merged commit 52579cb into apache:master Jun 3, 2026
35 of 36 checks passed
@mrhhsg mrhhsg deleted the refactor/remove-unused-json-helpers branch June 3, 2026 03:04
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.

4 participants