Skip to content

[feature](function) Add H3 cell and coordinate functions - #69018

Merged
Mryange merged 5 commits into
apache:masterfrom
Mryange:integrate-h3
Oct 19, 2026
Merged

Mryange merged 5 commits into
apache:masterfrom
Mryange:integrate-h3

Conversation

@Mryange

@Mryange Mryange commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: N/A

Problem Summary: Add h3_lat_lng_to_cell, h3_cell_to_lat_lng, and h3_cell_to_boundary using official H3 4.5.0. Coordinates use degrees in latitude/longitude order. Invalid inputs return NULL; centers contain two coordinates and boundaries preserve H3 vertex order without closing the ring. Input NULL propagation uses the default execution framework. FE has no separate Java H3 evaluator; constant folding through BE remains supported.

Build H3 as a static C library from its 18 upstream core sources. Generate its versioned API header in the build directory, export include paths through the target, enable PIC, and inherit Doris sanitizer flags. Only the H3 target relaxes third-party warning errors. The wrapper avoids upstream standalone tools and global build options. Include the upstream license attribution and NOTICE.

Release note

Add three H3 SQL functions for mapping coordinates to cells and retrieving cell centers and boundaries.

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:
  • Behavior changed:
    • No.
    • Yes. Add three SQL functions.
  • Does this need documentation?
    • No.
    • Yes. SQL function documentation is needed; no documentation PR yet.

Validation on Linux x86_64:

  • ASAN BE build and clean FE build passed; H3 objects carry ASAN/UBSAN flags.
  • run-be-ut.sh --run --filter=FunctionH3Test.* -j48: all three tests passed.
  • run-regression-test.sh --run -d query_p0/sql_functions/spatial_functions -s test_h3: generated results with -forceGenOut, inspected them, and reran successfully. Includes constant-folding modes, nullable/non-nullable table columns, all 16 resolutions, stored nested arrays, array expansion, filtering/grouping, and 35,000 mixed rows.
  • Compared 10,000 inputs per function against official C/Python H3 4.5.0: exact agreement. ClickHouse 26.3.9.8 (H3 3.7.1) matched cell IDs and coordinates within tolerance (maximum coordinate error 8.29e-8 degrees).
  • Clang-format 16 and targeted clang-tidy checks passed; no sanitizer diagnostics during these tests. ARM/macOS builds were not run.

Check List (For Reviewer who merge this PR)

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

### What problem does this PR solve?

Problem Summary: Add h3_lat_lng_to_cell, h3_cell_to_lat_lng, and
h3_cell_to_boundary using official H3 4.5.0. Register the functions in
Nereids and build H3 as a static dependency with sanitizer support.
Coordinates use degrees in latitude/longitude order; invalid inputs return
NULL. Center coordinates contain two elements, and boundaries preserve
H3 vertex order without repeating the first vertex. Use the default NULL
execution framework and allow constant folding through BE evaluation.

### Release note

Add H3 functions for mapping coordinates to cells and retrieving cell
centers and boundaries.

### Check List (For Author)

- Test: ASAN BE build, clean FE build, three FunctionH3Test unit tests,
  generated and rerun test_h3 regression, and clang-tidy checks passed.
  Compared 10,000 inputs per function against H3 4.5.0 and ClickHouse
  26.3.9.8; cell IDs matched and coordinate differences met tolerance.
- Behavior changed: Yes, add three SQL functions.
- Does this need documentation: Yes, SQL function documentation is needed.
### What problem does this PR solve?

Problem Summary: Include the upstream H3 4.5.0 attribution and NOTICE
for the newly linked static library in Doris distribution notices.

### Release note

None

### Check List (For Author)

- Test: Compared the attribution and NOTICE against contrib/h3; git diff --check passed.
- Behavior changed: No.
- Does this need documentation: No.
@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

Mryange commented Oct 13, 2026

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.

Request changes for one confirmed P1: the new mandatory H3 target is not initialized by the standalone BE unit-test entry point. On a fresh checkout/worktree, run-be-ut.sh reaches the H3 wrapper with contrib/h3 still empty and cannot configure any BE unit tests. The inline comment identifies the fix.

Reviewed commit c9a406b. Review converged after 2 rounds: all three reviewers returned NO_NEW_VALUABLE_FINDINGS in the latest round, all 18 changed paths were covered, and every candidate/risk was independently accepted, deduplicated or dismissed with evidence. There are no unresolved static candidates or uncovered changed paths. Existing inline threads were absent; no existing blocking comment IDs apply. No additional user focus was supplied.

Invocation chain reviewed:

FE signatures/registration -> generic translation or BE constant folding
 -> geo/H3 factory registration -> default constant/NULL dispatch
 -> ColumnView -> official H3 C API -> nullable results -> array consumers/storage

Critical checkpoint conclusions:

  1. Goal and evidence: the three H3 functions use degree-based latitude/longitude, NULL for invalid typed inputs, two-coordinate centers and unclosed variable-length boundaries. Implementation and inspected tests agree; standalone UT setup is incomplete as reported inline.
  2. Scope and reuse: focused changes reuse existing FE scalar/signature/visitor conventions, IFunction null/constant handling and ColumnView; no unrelated implementation change identified.
  3. Concurrency and locks: stateless wrappers, immutable H3 tables and caller-owned results; existing factory call_once handles registration. No new shared writes, locks or lock-order issue.
  4. Lifecycle and initialization: constexpr names, compile-time C tables and RAII/COW column ownership introduce no dynamic cross-TU initialization, ownership cycle or cleanup obligation.
  5. Configuration: no new configuration item or dynamic propagation requirement.
  6. Compatibility: additive builtins and standard BIGINT/ARRAY types; both FE and BE must support the new functions. Existing storage/wire layouts are unchanged. Static/PIC linkage and existing glibc policy were inspected; completed artifacts were not audited.
  7. Thrift/protobuf IDs: no gensrc definition changes, so cross-release field-ID checks do not apply.
  8. Parallel paths: ordinary vectors, mixed/all constants, nullable/only-NULL/empty inputs, FE/BE folding and nested array consumers were traced. Normal build.sh initializes H3; standalone run-be-ut.sh is the reported omission. Cloud/shared-nothing share the scalar path.
  9. Conditions and errors: finite/domain/cell checks handle concrete invalid inputs, and all H3 statuses affect NULL results. Ordinary cast overflow checks prevent wide integer wraparound. Intrinsic and input NULL maps merge correctly.
  10. Tests: inspected BE and regression coverage for all 16 resolutions, geographic bounds, NaN/Inf, invalid cells/modes, constants, NULLs, empty/multiple batches, pentagons, storage, array access/map/filter/explode and grouping. No tests were executed.
  11. Expected results: read all 36 golden blocks/269 rows; independently checked resolution bits, row/NULL/group counts, repeated folding outputs and array consistency. No static discrepancy found. Exact floating-point results and output-generation provenance were not independently executed.
  12. Observability: existing scalar/query/configuration error paths suffice; no new distributed operation or state calls for extra logs/metrics.
  13. Transactions and persistence: no visible-version, MoW bitmap, transaction, EditLog or replay path changes.
  14. Writes and crash recovery: production changes compute result columns and add no write/atomicity/crash-recovery protocol; tests exercise existing array storage.
  15. FE-BE values: generic builtin names/types cover runtime and folding. FE AlwaysNullable and nullable array elements match BE declarations; no new context variable or wire field.
  16. Performance, memory and failures: bounded per-row geometry with at most 10 vertices, tracked column storage and fixed stack outputs; constants evaluate once, input columns remain shared safely, and allocation exceptions use existing Status conversion. No additional concrete regression found.
  17. Other integration checks: pinned v4.5.0 agrees with the gitlink; upstream source list/header generation, include/link propagation, sanitizer flags and license/NOTICE were inspected. Documentation remains an acknowledged author follow-up without a documentation PR.

Validation limits: static review only, as required. No builds, tests, source modifications or submodule initialization were performed. Author-reported execution/CI comparisons are not this review's test evidence; runtime sanitizer behavior, other architectures and final ELF/shipped-library glibc versions remain unverified.

Review converged after 2 round(s).

Comment thread be/CMakeLists.txt Resolved
### What problem does this PR solve?

Problem Summary: The standalone BE unit-test script did not initialize
the newly required H3 submodule. A fresh checkout could fail during CMake
configuration when the H3 wrapper reads VERSION. Add the same H3
initialization used by build.sh before configuring unit tests.

### Release note

None

### Check List (For Author)

- Test: bash -n run-be-ut.sh and git diff --check passed; initialization
  matches build.sh. Fresh-checkout build validation was not run.
- Behavior changed: No SQL behavior change; fix standalone unit-test setup.
- Does this need documentation: No.
@Mryange

Mryange commented Oct 13, 2026

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.

Reviewed PR #69018 at head 35724e3 using the supplied aggregate diff and all 19 changed paths. No new verified code defect was found. The existing P1 comment 4257310464 is fixed on this head: run-be-ut.sh:263 now initializes contrib/h3 before CMake, matching build.sh:961. It is neither reposted nor retained as an existing blocker.

Critical checkpoint conclusions:

  1. Goal and evidence: the three degree-based H3 functions are registered through FE binding, existing scalar translation and BE geo registration. Cell conversion returns nullable BIGINT; center and boundary return nullable arrays with the expected nullable element layers. Added unit/regression tests cover the intended behavior, but this review did not execute them.
  2. Scope and reuse: changes are focused on H3 dependency integration, three scalar expressions, one stateless BE implementation and tests. Default IFunction constants/NULL handling and ColumnView are reused.
  3. Concurrency and locks: no new threads, locks or shared execution state. Registration remains under the existing factory call_once; output columns and H3 conversion temporaries are local to execution.
  4. Lifecycle/static initialization: constexpr names, ordinary function/context lifetime and local owned columns introduce no cross-translation-unit initializer dependency, owner cycle or custom cleanup.
  5. Configuration: no new runtime configuration.
  6. Compatibility: existing scalar/array types and serialization are reused; no existing function semantics or persisted format changes. These new function names require BEs that implement them during deployment.
  7. Thrift/protobuf IDs: no gensrc changes.
  8. Parallel paths: ordinary/selected block execution and BE constant folding use the same implementation; constant, nullable, only-NULL/Nothing and empty-column behavior follows the existing framework. Both BE build entry points initialize H3.
  9. Conditional/error handling: finite coordinate/geographic/resolution checks and official cell validation handle actual invalid inputs. H3 return codes are checked; invalid input produces the advertised SQL NULL. Repeated offsets preserve invalid rows, and boundaries preserve upstream vertex order without closing the ring.
  10. Test coverage: new BE tests exercise non-finite/out-of-domain inputs, constant combinations, Nothing, interleaved valid/invalid/NULL rows, empty blocks and 5-/10-vertex pentagons. Regressions cover both folding settings, all 16 resolutions, poles/dateline, nullable/non-nullable columns, nested storage/access/explode/composition, grouping/filtering and mixed batches. These are inspected coverage, not passing-test claims.
  11. Changed results: all 342 golden-file lines were reviewed. Static structure/arithmetic checks found 36 query blocks, 128 all-resolution rows with consistent encoded resolutions, matching stored/direct array results and consistent aggregate counts. Numerical coordinate equivalence and result generation were not independently executed.
  12. Observability: existing scalar error/NULL behavior is suitable; no new distributed operation or state transition requires logs/metrics.
  13. Transactions/persistence: no EditLog, transaction, visible-version or delete-bitmap mechanism changes.
  14. Writes/atomicity: production changes only compute scalar results; existing array columns/storage receive valid nested layouts. No new write protocol or crash-recovery mechanism.
  15. FE-BE parameters: names, fixed argument families, AlwaysNullable semantics and both array element-nullability levels agree. No new transmitted variable; generic translation and recursive folding serialization apply.
  16. Performance/memory: work is bounded per row by resolution 15 and at most 10 boundary vertices; all-constant input executes once. Column buffers use existing tracked allocators; reachable H3 APIs use stack temporaries/read-only tables. No repeated shared-input mutation or substantiated material performance regression found.
  17. Other integration checks: the wrapper lists all 18 pinned upstream core C sources, generates the matching versioned header, enables PIC and inherits sanitizer flags with warning relaxation limited to H3. GitHub tag v4.5.0 resolves to the gitlink revision. Licensing/NOTICE attribution matches the pinned upstream. BE header/gate-table/PCH/extern-template/unity-inclusion obligations introduce no additional issue. The author states SQL documentation is needed and has not linked a documentation PR.

User focus: no additional focus was supplied. The existing inline concern was independently checked and is addressed as described above.

Convergence: true after round 1. All three assigned reviewers returned NO_NEW_VALUABLE_FINDINGS; full assigned scope and both initial risk focuses were covered, independently verified and disposed with evidence. No unresolved candidate or static coverage gap remains.

Validation limits: static review only. No source edits, builds, Doris tests, benchmark, sanitizer runtime checks, ARM/macOS execution or final-ELF glibc 2.17 audit were performed. Source inspection found no specific new ABI incompatibility; it cannot certify a completed binary. Author-reported validation and supplied goldens were treated as context, not executed evidence.

Review converged after 1 round(s).

@Mryange

Mryange commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17574	5677	5582	5582
q2	2103	310	270	270
q3	10229	1432	864	864
q4	4673	477	347	347
q5	7430	816	537	537
q6	187	186	157	157
q7	782	817	609	609
q8	9265	1367	1137	1137
q9	5720	4526	4470	4470
q10	6853	1293	1012	1012
q11	446	258	232	232
q12	633	402	297	297
q13	18050	3092	2396	2396
q14	271	267	244	244
q15	q16	734	732	693	693
q17	1217	747	577	577
q18	7158	6248	6194	6194
q19	1114	961	607	607
q20	411	361	231	231
q21	5409	2630	2765	2630
q22	439	345	302	302
Total cold run time: 100698 ms
Total hot run time: 29388 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	6729	6660	6812	6660
q2	707	623	577	577
q3	5533	5824	5316	5316
q4	2104	2150	1724	1724
q5	5815	5613	5782	5613
q6	241	185	142	142
q7	2252	2033	1777	1777
q8	3321	2804	2841	2804
q9	8246	8087	8015	8015
q10	3674	3625	3260	3260
q11	613	405	372	372
q12	681	692	495	495
q13	2765	3116	2377	2377
q14	282	281	254	254
q15	q16	667	689	612	612
q17	7873	6984	6839	6839
q18	13065	12253	13101	12253
q19	920	806	821	806
q20	2188	2173	1953	1953
q21	5780	4855	4900	4855
q22	516	476	446	446
Total cold run time: 73972 ms
Total hot run time: 67150 ms

@hello-stephen

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

query5	4307	584	436	436
query6	420	201	193	193
query7	4799	455	228	228
query8	318	190	185	185
query9	8765	4026	4024	4024
query10	465	310	244	244
query11	5973	3429	3183	3183
query12	144	88	82	82
query13	1250	443	309	309
query14	6548	4857	4604	4604
query14_1	4320	4247	4258	4247
query15	208	197	187	187
query16	953	447	432	432
query17	856	656	539	539
query18	2417	425	316	316
query19	201	166	144	144
query20	85	81	89	81
query21	216	135	115	115
query22	12983	13085	12814	12814
query23	13226	12520	12271	12271
query23_1	12398	12389	12172	12172
query24	7075	809	457	457
query24_1	475	471	470	470
query25	510	385	336	336
query26	1292	255	138	138
query27	2771	442	281	281
query28	4608	1949	1954	1949
query29	1543	587	437	437
query30	297	254	186	186
query31	897	775	644	644
query32	141	88	92	88
query33	492	294	247	247
query34	919	843	497	497
query35	748	749	642	642
query36	805	822	720	720
query37	125	99	91	91
query38	1817	1739	1683	1683
query39	701	713	713	713
query39_1	690	661	687	661
query40	222	112	93	93
query41	65	64	62	62
query42	88	86	81	81
query43	370	373	327	327
query44	1318	712	711	711
query45	177	177	161	161
query46	842	979	563	563
query47	2872	3044	2918	2918
query48	298	312	213	213
query49	571	394	292	292
query50	671	272	221	221
query51	10773	10855	10436	10436
query52	76	82	74	74
query53	189	224	154	154
query54	227	191	186	186
query55	73	72	67	67
query56	215	207	213	207
query57	1625	1579	1572	1572
query58	267	260	247	247
query59	2373	2380	2104	2104
query60	275	223	223	223
query61	145	154	134	134
query62	396	340	285	285
query63	192	163	167	163
query64	2733	999	889	889
query65	3441	3373	3403	3373
query66	1783	406	298	298
query67	20188	20143	19939	19939
query68	2947	1006	634	634
query69	394	297	254	254
query70	922	848	826	826
query71	292	226	194	194
query72	2837	2550	2219	2219
query73	535	547	297	297
query74	4590	4467	4300	4300
query75	2332	2307	1954	1954
query76	2296	1006	608	608
query77	365	393	302	302
query78	8889	8954	8467	8467
query79	918	868	518	518
query80	482	409	335	335
query81	515	324	269	269
query82	206	142	113	113
query83	187	193	185	185
query84	282	115	100	100
query85	758	435	361	361
query86	257	244	236	236
query87	2010	1954	1817	1817
query88	3604	2693	2710	2693
query89	327	299	254	254
query90	2092	189	190	189
query91	160	148	122	122
query92	99	89	92	89
query93	979	995	576	576
query94	442	318	299	299
query95	582	403	314	314
query96	669	534	237	237
query97	2426	2498	2343	2343
query98	155	146	139	139
query99	768	764	651	651
Total cold run time: 233189 ms
Total hot run time: 152237 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.10	0.06	0.05
query3	0.26	0.11	0.11
query4	1.61	0.12	0.13
query5	0.25	0.22	0.23
query6	1.16	0.69	0.69
query7	0.04	0.01	0.00
query8	0.06	0.04	0.04
query9	0.44	0.37	0.37
query10	0.63	0.61	0.62
query11	0.22	0.15	0.14
query12	0.19	0.16	0.14
query13	0.50	0.52	0.50
query14	0.99	0.98	0.97
query15	0.64	0.61	0.61
query16	0.36	0.36	0.35
query17	1.17	1.15	1.13
query18	0.26	0.25	0.24
query19	2.13	2.03	1.95
query20	0.02	0.01	0.01
query21	15.49	0.23	0.14
query22	4.50	0.06	0.05
query23	16.26	0.32	0.13
query24	3.36	0.59	0.47
query25	0.10	0.05	0.04
query26	1.14	0.25	0.15
query27	0.05	0.05	0.04
query28	2.04	0.64	0.45
query29	12.54	4.31	3.39
query30	0.28	0.15	0.14
query31	2.78	0.61	0.35
query32	3.21	0.62	0.54
query33	3.10	3.27	3.20
query34	15.77	4.11	3.42
query35	3.37	3.37	3.38
query36	0.54	0.48	0.45
query37	0.09	0.06	0.06
query38	0.05	0.05	0.04
query39	0.04	0.03	0.03
query40	0.17	0.15	0.15
query41	0.08	0.04	0.03
query42	0.03	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.07 s
Total hot run time: 24.95 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 92.31% (36/39) 🎉
Increment coverage report
Complete coverage report

@Mryange

Mryange commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

### What problem does this PR solve?

Problem Summary: H3 coordinate functions grow output buffers repeatedly for large batches. Reserve the row offsets and the center point value capacity before processing rows.

### Release note

None

### Check List (For Author)

- Test: ASAN BE build and targeted clang-tidy passed; clang-format 16 and git diff --check passed.
- Behavior changed: No
- Does this need documentation: No
@Mryange

Mryange commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17618	5672	5550	5550
q2	2124	325	263	263
q3	10204	1381	843	843
q4	4683	470	341	341
q5	7430	803	546	546
q6	188	183	153	153
q7	780	815	615	615
q8	9250	1350	1099	1099
q9	5631	4246	4248	4246
q10	6808	1307	1019	1019
q11	439	255	245	245
q12	633	398	299	299
q13	18098	3552	3006	3006
q14	279	275	248	248
q15	q16	743	737	679	679
q17	1206	743	595	595
q18	7146	6269	6191	6191
q19	1130	961	598	598
q20	377	336	227	227
q21	5352	2566	2563	2563
q22	404	328	280	280
Total cold run time: 100523 ms
Total hot run time: 29606 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	6447	6528	6546	6528
q2	727	598	577	577
q3	5574	5688	5270	5270
q4	2313	2150	1564	1564
q5	5814	5647	5639	5639
q6	246	198	159	159
q7	2221	2066	1873	1873
q8	3085	2739	2675	2675
q9	8240	7838	7583	7583
q10	3663	3705	3242	3242
q11	595	402	387	387
q12	661	682	501	501
q13	3220	3599	3024	3024
q14	285	299	264	264
q15	q16	658	687	619	619
q17	7785	7058	6926	6926
q18	13175	12273	13138	12273
q19	939	810	800	800
q20	2200	2178	1938	1938
q21	5752	4714	4807	4714
q22	496	483	417	417
Total cold run time: 74096 ms
Total hot run time: 66973 ms

@hello-stephen

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

query5	4316	560	471	471
query6	434	207	198	198
query7	4819	461	239	239
query8	318	170	155	155
query9	8762	3984	3988	3984
query10	465	307	261	261
query11	6055	3812	3546	3546
query12	141	93	88	88
query13	1242	426	326	326
query14	6116	3990	3803	3803
query14_1	3540	3519	3537	3519
query15	209	203	182	182
query16	933	468	423	423
query17	879	664	543	543
query18	2429	422	319	319
query19	196	168	138	138
query20	87	87	84	84
query21	208	139	119	119
query22	12979	13054	12752	12752
query23	13407	12850	12632	12632
query23_1	12564	12633	12576	12576
query24	7095	837	478	478
query24_1	477	483	475	475
query25	537	428	372	372
query26	1340	262	149	149
query27	2760	446	268	268
query28	4595	1958	1971	1958
query29	1598	612	472	472
query30	300	224	188	188
query31	1015	937	812	812
query32	151	97	100	97
query33	533	312	265	265
query34	909	841	495	495
query35	746	775	659	659
query36	845	810	748	748
query37	131	104	93	93
query38	1824	1761	1730	1730
query39	799	818	757	757
query39_1	749	742	752	742
query40	220	121	101	101
query41	74	68	68	68
query42	90	87	83	83
query43	373	388	339	339
query44	1293	712	714	712
query45	182	182	169	169
query46	882	961	569	569
query47	2847	3029	2923	2923
query48	289	300	217	217
query49	576	399	300	300
query50	676	272	207	207
query51	10442	10542	10602	10542
query52	87	86	72	72
query53	191	207	152	152
query54	239	204	176	176
query55	72	68	64	64
query56	223	218	223	218
query57	1623	1601	1563	1563
query58	286	264	257	257
query59	2186	2208	2001	2001
query60	292	235	220	220
query61	145	146	143	143
query62	385	334	292	292
query63	194	168	172	168
query64	2768	944	794	794
query65	3309	3249	3254	3249
query66	1778	412	295	295
query67	20245	20228	20070	20070
query68	2997	1022	610	610
query69	386	293	250	250
query70	867	810	805	805
query71	306	221	213	213
query72	2728	2642	2320	2320
query73	513	527	297	297
query74	4627	4477	4318	4318
query75	2369	2313	1949	1949
query76	2291	1017	594	594
query77	321	373	288	288
query78	9719	9753	9249	9249
query79	1005	845	527	527
query80	782	439	359	359
query81	563	324	271	271
query82	574	133	113	113
query83	300	202	181	181
query84	326	120	105	105
query85	950	411	364	364
query86	345	240	230	230
query87	2013	1955	1822	1822
query88	3616	2701	2679	2679
query89	341	290	259	259
query90	1735	183	177	177
query91	163	151	122	122
query92	103	89	78	78
query93	1038	1008	585	585
query94	498	320	286	286
query95	586	355	317	317
query96	672	529	230	230
query97	2478	2439	2372	2372
query98	164	153	151	151
query99	783	773	651	651
Total cold run time: 234385 ms
Total hot run time: 153223 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.10	0.05	0.05
query3	0.26	0.12	0.11
query4	1.60	0.12	0.13
query5	0.27	0.25	0.21
query6	1.17	0.68	0.68
query7	0.04	0.01	0.00
query8	0.05	0.04	0.04
query9	0.41	0.34	0.35
query10	0.57	0.56	0.61
query11	0.21	0.14	0.13
query12	0.19	0.14	0.14
query13	0.50	0.51	0.49
query14	1.03	1.02	1.01
query15	0.63	0.61	0.62
query16	0.35	0.34	0.35
query17	1.16	1.13	1.17
query18	0.23	0.21	0.20
query19	2.16	1.99	2.01
query20	0.02	0.01	0.01
query21	15.48	0.29	0.14
query22	4.50	0.05	0.05
query23	16.24	0.31	0.13
query24	3.15	0.56	0.46
query25	0.12	0.06	0.05
query26	1.43	0.25	0.16
query27	0.05	0.03	0.04
query28	2.26	0.65	0.40
query29	12.56	4.16	3.28
query30	0.28	0.15	0.13
query31	2.77	0.58	0.34
query32	3.22	0.62	0.53
query33	3.20	3.16	3.21
query34	15.50	4.04	3.41
query35	3.38	3.40	3.36
query36	0.56	0.43	0.44
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.15	0.15
query41	0.09	0.04	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.18 s
Total hot run time: 24.59 s

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17614	5656	5567	5567
q2	2102	332	256	256
q3	10212	1373	857	857
q4	4679	474	347	347
q5	7441	796	542	542
q6	196	187	156	156
q7	776	802	613	613
q8	9242	1322	1080	1080
q9	5633	4291	4258	4258
q10	6823	1294	1010	1010
q11	429	254	238	238
q12	637	397	280	280
q13	18129	3576	3024	3024
q14	269	274	252	252
q15	q16	725	720	676	676
q17	1195	750	566	566
q18	7037	6247	6209	6209
q19	1100	962	626	626
q20	399	344	227	227
q21	5089	2266	2409	2266
q22	368	309	269	269
Total cold run time: 100095 ms
Total hot run time: 29319 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	6175	6132	6116	6116
q2	687	562	560	560
q3	5235	5385	4935	4935
q4	1995	2125	1558	1558
q5	5271	5302	5928	5302
q6	261	191	155	155
q7	2345	2061	1810	1810
q8	3201	2776	2882	2776
q9	8122	8058	8048	8048
q10	3818	3870	3340	3340
q11	653	451	422	422
q12	714	743	528	528
q13	3550	3935	3340	3340
q14	307	311	316	311
q15	q16	731	754	679	679
q17	8425	7557	7287	7287
q18	13171	12245	13050	12245
q19	944	800	782	782
q20	2190	2186	1938	1938
q21	5901	4741	5027	4741
q22	502	455	422	422
Total cold run time: 74198 ms
Total hot run time: 67295 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.95% (35529/46173)
Line Coverage 62.20% (402115/646443)
Region Coverage 58.54% (338993/579105)
Branch Coverage 59.48% (156251/262674)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 92.31% (36/39) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

query5	4328	582	451	451
query6	421	207	192	192
query7	4795	469	233	233
query8	319	169	157	157
query9	8728	3931	3900	3900
query10	450	318	261	261
query11	6029	3758	3518	3518
query12	142	96	87	87
query13	1251	446	346	346
query14	6139	4019	3793	3793
query14_1	3505	3464	3526	3464
query15	206	195	186	186
query16	936	445	374	374
query17	857	659	535	535
query18	2417	414	314	314
query19	199	167	151	151
query20	87	86	83	83
query21	208	140	110	110
query22	12942	12963	12823	12823
query23	13527	12741	12548	12548
query23_1	12678	12675	12620	12620
query24	7107	838	468	468
query24_1	476	476	473	473
query25	536	421	364	364
query26	1298	260	142	142
query27	2763	445	276	276
query28	4579	1937	1926	1926
query29	1591	603	476	476
query30	303	226	184	184
query31	1011	924	809	809
query32	148	100	92	92
query33	514	308	253	253
query34	883	857	511	511
query35	734	756	641	641
query36	806	799	723	723
query37	131	107	90	90
query38	1817	1725	1687	1687
query39	784	812	744	744
query39_1	736	744	745	744
query40	220	121	97	97
query41	72	69	69	69
query42	94	84	81	81
query43	364	389	327	327
query44	1302	694	702	694
query45	185	177	160	160
query46	828	966	563	563
query47	2947	2808	2944	2808
query48	342	305	213	213
query49	583	397	288	288
query50	672	268	206	206
query51	10454	10651	10462	10462
query52	76	74	68	68
query53	186	200	149	149
query54	235	199	173	173
query55	74	68	69	68
query56	242	209	206	206
query57	1611	1575	1531	1531
query58	283	264	254	254
query59	2121	2165	1903	1903
query60	284	241	225	225
query61	142	142	145	142
query62	393	344	290	290
query63	195	166	166	166
query64	2725	931	759	759
query65	3300	3244	3266	3244
query66	1794	428	305	305
query67	20496	19980	20270	19980
query68	3072	992	616	616
query69	380	290	260	260
query70	863	784	790	784
query71	284	229	235	229
query72	2766	2578	2277	2277
query73	522	528	307	307
query74	4611	4503	4316	4316
query75	2353	2301	1922	1922
query76	2315	1013	601	601
query77	337	375	273	273
query78	9691	9659	9103	9103
query79	962	856	546	546
query80	1219	442	333	333
query81	576	318	273	273
query82	615	140	114	114
query83	297	194	180	180
query84	308	123	100	100
query85	849	430	376	376
query86	388	239	228	228
query87	2005	1988	1812	1812
query88	3625	2703	2676	2676
query89	337	293	262	262
query90	1880	180	174	174
query91	157	149	122	122
query92	95	89	89	89
query93	1030	1010	575	575
query94	618	299	275	275
query95	592	338	382	338
query96	669	518	229	229
query97	2459	2438	2328	2328
query98	159	161	148	148
query99	774	767	654	654
Total cold run time: 235169 ms
Total hot run time: 151962 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.10	0.06	0.05
query3	0.26	0.11	0.12
query4	1.61	0.12	0.12
query5	0.25	0.25	0.24
query6	1.16	0.68	0.69
query7	0.04	0.01	0.00
query8	0.05	0.04	0.04
query9	0.42	0.33	0.33
query10	0.57	0.56	0.59
query11	0.20	0.14	0.13
query12	0.18	0.14	0.15
query13	0.51	0.48	0.50
query14	1.03	1.00	1.01
query15	0.63	0.61	0.60
query16	0.32	0.35	0.35
query17	1.17	1.14	1.17
query18	0.23	0.21	0.20
query19	2.12	1.98	2.02
query20	0.02	0.02	0.02
query21	15.48	0.29	0.15
query22	4.37	0.05	0.05
query23	16.26	0.32	0.11
query24	3.25	0.57	0.44
query25	0.11	0.08	0.04
query26	1.06	0.24	0.16
query27	0.05	0.03	0.04
query28	2.06	0.63	0.44
query29	12.49	4.17	3.33
query30	0.28	0.13	0.14
query31	2.77	0.57	0.34
query32	3.22	0.62	0.51
query33	3.13	3.21	3.36
query34	15.51	4.00	3.39
query35	3.34	3.32	3.33
query36	0.55	0.43	0.44
query37	0.10	0.06	0.06
query38	0.05	0.03	0.04
query39	0.04	0.03	0.03
query40	0.17	0.15	0.14
query41	0.09	0.03	0.03
query42	0.04	0.02	0.02
query43	0.05	0.03	0.03
Total cold run time: 95.34 s
Total hot run time: 24.59 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.73% (35450/46200)
Line Coverage 62.02% (400826/646287)
Region Coverage 58.34% (337531/578565)
Branch Coverage 59.26% (155664/262667)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 92.31% (36/39) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.71% (35460/46229)
Line Coverage 61.97% (400927/647017)
Region Coverage 58.23% (337591/579791)
Branch Coverage 59.19% (155692/263028)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.79% (35498/46229)
Line Coverage 62.04% (401431/647017)
Region Coverage 58.33% (338207/579791)
Branch Coverage 59.27% (155908/263028)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.80% (35503/46229)
Line Coverage 62.05% (401497/647017)
Region Coverage 58.33% (338178/579791)
Branch Coverage 59.28% (155934/263028)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 92.31% (36/39) 🎉
Increment coverage report
Complete coverage report

1 similar comment
@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 92.31% (36/39) 🎉
Increment coverage report
Complete coverage report

@HappenLee HappenLee 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.

Reviewed the current head. The earlier standalone UT initialization and output-capacity reservation concerns are addressed. No blocking implementation issue found in the reviewed changes.

@HappenLee
HappenLee dismissed github-actions[bot]’s stale review October 19, 2026 09:35

The requested H3 initialization fix is implemented in run-be-ut.sh. The same reviewer confirmed this in the subsequent review 5502341526; the current head d720235 has been independently rechecked and approved in review 5569536561.

@Mryange
Mryange merged commit 61179b6 into apache:master Oct 19, 2026
37 of 38 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

morningman added a commit that referenced this pull request Oct 19, 2026
…enum class (#69297)

### What problem does this PR solve?

Issue Number: None

Related PR: #69018, #69174

Problem Summary:

**In short.** BE UT fails with `BE BUILD FAIL` for every PR against
master: `be/test/exprs/function/function_h3_test.cpp`, added by #69018,
no longer compiles since #69174 made
`FunctionContext::FunctionStateScope` an `enum class`. This PR spells
the 8 affected calls with the scoped enumerators, so the test compiles
again. Nothing else changes.

**Background.** #69174 (merged 2026-10-18) turned
`FunctionContext::FunctionStateScope` into an `enum class` and rewrote
every caller from `FunctionContext::FRAGMENT_LOCAL` to
`FunctionContext::FunctionStateScope::FRAGMENT_LOCAL`, and the same for
`THREAD_LOCAL`. #69018 (merged 2026-10-19) added an H3 function test
written against the old, unscoped names. The two PRs were merged
independently; together they leave a test on master that does not
compile. The BE UT pipeline merges each PR into the latest master before
it builds `doris_be_test`, so the break hits every PR, whatever it
changes.

**The problem, and what it cost.** Since #69261 fixed the other test
break of the day (left by #68447), every BE UT build for a PR against
master stops at this file, for example [build
1073803](http://43.132.222.7:8111/viewLog.html?buildId=1073803) (#69257,
merged into master `41a58afba2e`):

```
FAILED: [code=1] test/CMakeFiles/doris_be_test.dir/exprs/function/function_h3_test.cpp.o
../test/exprs/function/function_h3_test.cpp:66:62: error: no member named 'FRAGMENT_LOCAL' in 'doris::FunctionContext'
../test/exprs/function/function_h3_test.cpp:67:62: error: no member named 'THREAD_LOCAL' in 'doris::FunctionContext'
...
8 errors generated.
ninja: build stopped: subcommand failed.
```

No BE unit test runs for those PRs, so their BE UT result says nothing
about the PR until this is fixed.

**How this PR fixes it.** The 8 `open` / `close` calls in
`function_h3_test.cpp` now use
`FunctionContext::FunctionStateScope::FRAGMENT_LOCAL` / `THREAD_LOCAL`,
as #69174 did for the other function tests. The test logic is unchanged.

**Results.** `-fsyntax-only` with the flags of each file's own entry in
`be/ut_build_ASAN/compile_commands.json` (clang 22, `-DBE_TEST`):

| File | master `41a58afba2e` | this PR |
|---|---|---|
| `function_h3_test.cpp` | the 8 errors CI reports | compiles |
| the 4 test files #69261 fixed (`data_type_serde_arrow_test.cpp`,
`data_type_variant_v2_serde_jsonb_test.cpp`,
`variant_v2_execution_test.cpp`, `vparquet_writer_test.cpp`) | compile |
compile (not touched) |
| `function_array_zip_test.cpp` (baseline, not touched) | compiles |
compiles |
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. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants