Skip to content

[fix](be) Fix macOS BE compilation errors#65783

Open
morningman wants to merge 1 commit into
apache:masterfrom
morningman:fix-macos
Open

[fix](be) Fix macOS BE compilation errors#65783
morningman wants to merge 1 commit into
apache:masterfrom
morningman:fix-macos

Conversation

@morningman

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Clang 20 fails the macOS BE build because the Linux-only PHDR cache state is unused on macOS and Parquet boolean column-index values are represented by std::vector proxy references. Restrict the PHDR state field to supported Linux builds and materialize Parquet page bounds as their physical C++ value types before decoding.

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Clang 20 fails the macOS BE build because the Linux-only PHDR cache state is unused on macOS and Parquet boolean column-index values are represented by std::vector<bool> proxy references. Restrict the PHDR state field to supported Linux builds and materialize Parquet page bounds as their physical C++ value types before decoding.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - sh build.sh --be
- Behavior changed: No
- Does this need documentation: No
@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

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

@morningman

Copy link
Copy Markdown
Contributor 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.

No blocking findings. Review opinion: approve.

Critical checkpoint conclusions:

  • Goal and proof: The change addresses the two stated Clang 20/macOS compilation failures. The PHDR state member now exists only where its constructor/destructor use it, and Parquet page-index bounds are materialized as Arrow's declared physical C++ type before decoded-field access, removing the std::vector<bool> proxy. The code accomplishes the stated goal.
  • Scope and clarity: The four changed lines are small, focused, and reuse the existing platform predicate and Parquet native-type contract. No unrelated behavior or interface is changed.
  • Concurrency and lifecycle: The Linux-glibc PHDR path still saves/restores the thread-local cache flag, including nested scopes. Linux TSan, Linux musl, and non-Linux paths keep the existing no-op special members. The header and implementation predicates match exactly; the Parquet values are synchronous stack locals with no shared-state or ownership change. No lock-order, deadlock, static-initialization, or resource-lifetime issue was found.
  • Compatibility and parallel paths: Enabled PHDR builds retain their existing layout and behavior; disabled builds use an internal empty RAII object with no ABI boundary. The Parquet helper is instantiated only for boolean, int32, int64, float, and double; binary types use their separate owning paths. Footer statistics, timestamp monotonicity, NaN/inverted-bound fallback, page-range intersection, and residual filtering semantics remain unchanged. There is no storage-format, protocol, FE-BE, rolling-upgrade, config, transaction, persistence, or data-write change.
  • Error handling and data correctness: No Status or exception is discarded by the patch. Unsupported or unsafe page-index metadata still conservatively keeps candidate ranges, so the change cannot introduce false page pruning.
  • Tests and results: Existing PHDR tests cover enabled-path save/restore and cache refresh, while existing Parquet tests cover numeric page-index decoding, NaN/inverted bounds, intersections, skip plans, and unavailable-index fallback. A dedicated Boolean ColumnIndex runtime assertion is absent, but the production translation unit instantiates that template and the fix is specifically a compile-portability correction. Per the review-run instructions, I did not run local builds or tests. The current macOS BE UT workflow failed before compilation because the runner selected JDK 25 instead of the required JDK 17, so that red job neither validates nor contradicts this patch.
  • Performance and observability: Two trivial scalar copies per inspected page add no allocation, I/O, locking, or meaningful hot-path cost. No new logging or metrics are warranted.
  • User focus: No additional focus points were supplied; the full PR and its upstream/downstream paths were reviewed.

No actionable correctness, build-configuration, lifecycle, compatibility, performance, or coverage defect was found.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17605	4356	4289	4289
q2	2037	331	205	205
q3	10248	1467	840	840
q4	4684	481	340	340
q5	7579	869	576	576
q6	191	180	141	141
q7	792	809	607	607
q8	9311	1590	1573	1573
q9	5598	4339	4328	4328
q10	6790	1756	1474	1474
q11	567	360	321	321
q12	736	594	457	457
q13	18125	3531	2733	2733
q14	267	261	253	253
q15	q16	798	776	712	712
q17	1019	913	1040	913
q18	7297	5829	5528	5528
q19	1370	1275	1096	1096
q20	808	678	587	587
q21	5940	2703	2486	2486
q22	443	373	309	309
Total cold run time: 102205 ms
Total hot run time: 29768 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4615	4505	4543	4505
q2	299	342	225	225
q3	4668	4986	4440	4440
q4	2088	2246	1378	1378
q5	4540	4369	4392	4369
q6	253	190	134	134
q7	2367	1954	1777	1777
q8	2739	2391	2422	2391
q9	8269	7923	7863	7863
q10	4674	4645	4194	4194
q11	604	464	416	416
q12	771	783	576	576
q13	3429	3790	2953	2953
q14	302	321	274	274
q15	q16	745	750	648	648
q17	1383	1352	1487	1352
q18	8227	7649	7521	7521
q19	1136	1059	1116	1059
q20	2237	2203	1936	1936
q21	5445	4756	4666	4666
q22	528	468	412	412
Total cold run time: 59319 ms
Total hot run time: 53089 ms

@hello-stephen

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

query5	4314	635	471	471
query6	462	224	222	222
query7	4852	619	339	339
query8	349	191	175	175
query9	8749	4089	4112	4089
query10	499	382	328	328
query11	5872	2336	2126	2126
query12	157	101	102	101
query13	1269	582	421	421
query14	6266	5267	4956	4956
query14_1	4321	4266	4254	4254
query15	211	215	182	182
query16	1026	473	460	460
query17	1137	729	583	583
query18	2452	483	356	356
query19	213	193	154	154
query20	113	108	110	108
query21	238	164	143	143
query22	13580	13503	13340	13340
query23	17520	16575	16136	16136
query23_1	16216	16328	16323	16323
query24	7492	1820	1283	1283
query24_1	1317	1330	1294	1294
query25	570	471	398	398
query26	1353	371	223	223
query27	2556	616	391	391
query28	4425	1986	2000	1986
query29	1179	641	502	502
query30	349	277	232	232
query31	1116	1099	986	986
query32	105	64	65	64
query33	535	325	265	265
query34	1160	1162	634	634
query35	771	803	679	679
query36	1194	1183	1063	1063
query37	164	128	94	94
query38	1894	1668	1655	1655
query39	877	887	864	864
query39_1	842	876	852	852
query40	245	171	142	142
query41	66	68	61	61
query42	93	92	92	92
query43	328	347	289	289
query44	1462	779	762	762
query45	193	189	182	182
query46	1089	1223	695	695
query47	2123	2084	1983	1983
query48	399	425	300	300
query49	571	422	319	319
query50	1059	437	334	334
query51	10520	10437	10457	10437
query52	84	89	76	76
query53	258	295	202	202
query54	277	231	218	218
query55	75	72	67	67
query56	321	312	304	304
query57	1288	1269	1173	1173
query58	303	263	253	253
query59	1594	1668	1453	1453
query60	313	275	254	254
query61	156	147	151	147
query62	545	496	427	427
query63	254	202	208	202
query64	2807	1062	879	879
query65	4704	4668	4658	4658
query66	1854	501	379	379
query67	29429	28722	29201	28722
query68	3274	1562	1023	1023
query69	416	299	277	277
query70	1086	999	1026	999
query71	385	342	313	313
query72	3014	2729	2399	2399
query73	863	812	441	441
query74	5107	4890	4738	4738
query75	2545	2505	2144	2144
query76	2354	1213	779	779
query77	346	388	291	291
query78	11820	11888	11475	11475
query79	1384	1220	758	758
query80	670	566	464	464
query81	492	342	287	287
query82	608	163	126	126
query83	428	348	302	302
query84	289	157	131	131
query85	934	615	520	520
query86	360	288	291	288
query87	1868	1824	1769	1769
query88	3720	2812	2774	2774
query89	442	379	326	326
query90	1972	210	206	206
query91	212	196	169	169
query92	70	61	59	59
query93	1587	1501	1056	1056
query94	545	355	317	317
query95	771	602	490	490
query96	1042	821	343	343
query97	2640	2609	2485	2485
query98	218	210	203	203
query99	1085	1117	976	976
Total cold run time: 262940 ms
Total hot run time: 178889 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.10	0.05	0.05
query3	0.26	0.14	0.13
query4	1.60	0.14	0.14
query5	0.30	0.23	0.22
query6	1.27	1.11	1.08
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.39	0.31	0.31
query10	0.55	0.54	0.55
query11	0.20	0.13	0.14
query12	0.18	0.16	0.14
query13	0.47	0.48	0.47
query14	1.03	1.00	1.00
query15	0.63	0.61	0.62
query16	0.31	0.34	0.32
query17	1.15	1.13	1.12
query18	0.24	0.21	0.23
query19	2.06	2.04	2.05
query20	0.02	0.01	0.01
query21	15.45	0.23	0.13
query22	4.86	0.05	0.05
query23	16.13	0.32	0.12
query24	2.99	0.44	0.33
query25	0.11	0.05	0.04
query26	0.74	0.20	0.16
query27	0.05	0.04	0.03
query28	3.50	0.96	0.56
query29	12.49	4.14	3.28
query30	0.27	0.15	0.17
query31	2.77	0.64	0.31
query32	3.22	0.60	0.50
query33	3.13	3.22	3.30
query34	15.67	4.22	3.51
query35	3.54	3.53	3.53
query36	0.57	0.44	0.43
query37	0.08	0.06	0.07
query38	0.04	0.04	0.04
query39	0.03	0.04	0.03
query40	0.18	0.17	0.17
query41	0.08	0.03	0.04
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.85 s
Total hot run time: 25.31 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (2/2) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.97% (30488/40666)
Line Coverage 59.10% (336005/568500)
Region Coverage 55.90% (282205/504839)
Branch Coverage 57.20% (125235/218926)

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