Skip to content

[feat](inverted-index) Support configurable ngram size difference - #67917

Open
airborne12 wants to merge 6 commits into
apache:masterfrom
airborne12:feature/ngram-max-diff
Open

[feat](inverted-index) Support configurable ngram size difference#67917
airborne12 wants to merge 6 commits into
apache:masterfrom
airborne12:feature/ngram-max-diff

Conversation

@airborne12

@airborne12 airborne12 commented Sep 13, 2026

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number:

Related PR: None

Problem Summary:

Custom ngram tokenizers hard-code the allowed difference between max_gram and min_gram to 1. This prevents valid wider ngram ranges while offering no explicit override.

This PR adds max_ngram_diff, keeps 1 as the backward-compatible default, requires ASCII integer syntax, and validates the same 0 through 255 range in FE and BE. The upper bound limits per-position token fan-out. Newly created policies also cap absolute custom ngram sizes at 1024, while an explicit persisted compatibility marker preserves marker-less policies accepted before that cap during rolling upgrades. Invalid replayed policies cannot block valid replacements. Because max_ngram_diff controls policy admission but does not affect emitted tokens, valid policies exclude it from analyzer identity so equivalent analyzers cannot bypass duplicate-index detection.

Release note

Allow custom ngram tokenizers to configure the maximum difference between max_gram and min_gram with max_ngram_diff values from 0 through 255.

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test
  • Behavior changed:

    • No.
    • Yes. New custom ngram tokenizers can opt into a wider gram-size range up to a bounded difference of 255 and an absolute gram size of 1024. Existing marker-less policies retain their pre-upgrade absolute-size behavior.
  • Does this need documentation?

    • No.
    • Yes. Add max_ngram_diff, its 0 through 255 range, and the 1024 limit for newly created policies to the custom analyzer documentation.

Validation:

  • ./build.sh --be -j8 (ASAN, Java extensions, build hygiene, and glibc compatibility)
  • ./build.sh --fe -j8 (Checkstyle passed)
  • NGramTokenizerTest: 19/19 passed across the final suite; focused legacy/current compatibility cases: 3/3 passed
  • AnalyzerIdentityBuilderTest and PolicyValidatorTests: 35/35 passed
  • test_ngram_max_diff_custom_analyzer: runner-generated golden and clean comparison passed against an isolated local FE/BE
  • clang-tidy passed on all changed C++ lines
  • Full PR English gate passed with no exceptions
  • Exact merge-tree clang-format 16 and full-reactor Checkstyle preflight passed

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary:

Custom ngram tokenizers hard-code the allowed difference between `max_gram` and `min_gram` to 1. This prevents valid wider ngram ranges while offering no explicit override.

This change adds the `max_ngram_diff` tokenizer property, keeps 1 as the backward-compatible default, validates non-negative values in FE and BE, and adds unit and regression coverage for a 1-to-8 tokenizer.

### Release note

Allow custom ngram tokenizers to configure the maximum difference between `max_gram` and `min_gram` with `max_ngram_diff`.

### Check List (For Author)

- Test
    - [ ] Regression test (coverage added; execution is pending CI)
    - [x] Unit Test
    - [ ] Manual test
- Behavior changed:
    - [ ] No.
    - [x] Yes. Custom ngram tokenizers can opt into a wider gram-size range.
- Does this need documentation?
    - [ ] No.
    - [x] Yes. The new tokenizer property should be added to the custom analyzer documentation.

Validation:
- `./build.sh --be -j48` (ASAN)
- `./run-be-ut.sh --run --filter='NGramTokenizerTest.*' -j48` (14 tests passed)
- `./run-fe-ut.sh --run org.apache.doris.indexpolicy.PolicyValidatorTests` (20 tests passed)
- `build-support/run-clang-tidy.sh --base origin/master --build-dir be/build_ASAN`
- C++ format and build-hygiene checks
@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?

@airborne12

Copy link
Copy Markdown
Member Author

/review

@airborne12

Copy link
Copy Markdown
Member Author

run buildall

@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 result: request changes. This static review converged after two rounds on commit f418b9582533510b8195e5e1b9077a6554f3e059. Two P2 issues remain: the newly configurable range has no practical token-fan-out bound, and the regression does not verify the complete deterministic result.

Critical checkpoint conclusions:

  • Goal and proof: The FE validator, persisted policy map, FE-to-BE transport, and BE factory implement configurable max_ngram_diff; the added cases exercise normal 1..8 use. The goal is not safely complete because extreme newly valid widths can generate denial-of-service-scale work, and the end-to-end regression proves only two members of the result.
  • Scope and clarity: The production diff is small and focused. The missing resource policy and incomplete regression oracle are the two material gaps.
  • Concurrency: No new thread, shared mutable state, lock acquisition, lock-order dependency, or atomic protocol is introduced. Existing policy distribution and lazy analyzer construction retain their established synchronization.
  • Lifecycle/static initialization: No new owning lifecycle, release path, circular reference, or cross-translation-unit static-initialization dependency is introduced. Policies persist the property and analyzers consume it lazily through the existing lifecycle.
  • Configuration behavior: This is persisted per-policy metadata, not a dynamically mutable process setting. Omitting it preserves the old default of 1; FE and BE agree on default, zero/positive acceptance, and negative rejection. A practical resource ceiling is still required.
  • Compatibility: Existing policies without the property keep the old behavior, and same-version FE/BE validation is aligned. Doris's supported upgrade flow upgrades all BEs before FEs, with the Master FE last, so no compatibility issue survives under the documented order: https://doris.apache.org/docs/4.x/admin-manual/cluster-management/upgrade/.
  • Parallel paths: TOKENIZE, classic/SNII indexing, and query analysis reconstruct the same custom-analyzer configuration and converge on the same ngram factory; no parallel path drops the property.
  • Conditional checks: The new nonnegative and difference checks are understandable and mirrored across FE/BE, but they validate only arithmetic relation, not downstream work. The accepted resource-bound comment covers that omission.
  • Test coverage: FE tests cover the default limit, configured success, and a negative limit; the BE test proves configured construction/output for a four-character input; the regression covers DDL, propagation, and lazy BE resolution. Upper/resource boundaries and the full 1..8 output are not adequately covered.
  • Test results: The BE expected vector is correct for abcd, but cannot emit sizes 5..8. The deterministic abcdefgh regression should use qt_* plus a generated .out result instead of two substring assertions.
  • Observability: This change does not add a distributed operation or state transition that needs new metrics/logs; existing validation errors identify the invalid property. Resource prevention, rather than extra logging, is needed for the accepted fan-out issue.
  • Persistence/transactions: The generic Gson/EditLog policy representation preserves the property, replay uses the same map, and no new transaction or failover protocol is introduced.
  • Data writes: There is no storage-format or atomicity change. Index writes consume the shared tokenizer factory, so the resource issue also applies to indexing, but no separate correctness/transaction issue was found.
  • FE-to-BE propagation: PushIndexPolicyTask copies the complete properties map into TIndexPolicy, and BE policy installation retains it; no scattered transport path was missed.
  • Performance and memory: Wide low-minimum ranges make token work grow with both input length and configured width; the first inline comment gives a concrete 1.25-billion-token case. No separate allocation, CPU, or redundant-work issue remains after deduplication.
  • Other issues/user focus: No additional user-provided focus was present, and the final changed-file/duplicate-fence sweep found no further substantiated issue.

No builds or tests were run because the review contract prohibits them; all conclusions are static, and any author/CI test claims were not independently reproduced.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17585	3093	3079	3079
q2	2051	249	216	216
q3	10279	875	515	515
q4	4667	244	198	198
q5	7694	568	380	380
q6	133	112	92	92
q7	517	489	383	383
q8	9237	883	892	883
q9	3424	2411	2364	2364
q10	6536	859	694	694
q11	399	190	179	179
q12	612	259	197	197
q13	18131	1516	1149	1149
q14	157	152	138	138
q15	q16	436	394	365	365
q17	1355	872	752	752
q18	3064	2262	2239	2239
q19	1256	923	745	745
q20	371	295	203	203
q21	5581	1644	1805	1644
q22	332	264	220	220
Total cold run time: 93817 ms
Total hot run time: 16635 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3474	3366	3392	3366
q2	509	395	367	367
q3	2214	2276	2217	2217
q4	1174	1161	898	898
q5	2176	2111	2116	2111
q6	166	119	86	86
q7	1010	917	853	853
q8	1596	1398	1393	1393
q9	3123	3092	3083	3083
q10	1840	1762	1618	1618
q11	358	267	250	250
q12	445	427	339	339
q13	1470	1533	1151	1151
q14	177	171	157	157
q15	q16	392	400	351	351
q17	3613	3270	3133	3133
q18	4810	4382	4752	4382
q19	821	813	873	813
q20	1018	971	814	814
q21	3847	3091	3318	3091
q22	405	347	320	320
Total cold run time: 34638 ms
Total hot run time: 30793 ms

@hello-stephen

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

query5	4245	410	325	325
query6	388	136	125	125
query7	4966	409	228	228
query8	287	123	117	117
query9	8693	2868	2889	2868
query10	396	215	181	181
query11	5381	1017	889	889
query12	119	73	68	68
query13	1194	444	317	317
query14	6034	2193	2071	2071
query14_1	1969	1950	1944	1944
query15	175	125	112	112
query16	940	321	342	321
query17	801	446	365	365
query18	2336	334	237	237
query19	174	133	110	110
query20	79	71	70	70
query21	211	103	88	88
query22	5307	5428	5281	5281
query23	6839	6050	5990	5990
query23_1	6041	6192	6054	6054
query24	7319	1075	771	771
query24_1	770	757	773	757
query25	433	301	245	245
query26	1242	241	128	128
query27	2784	433	245	245
query28	4678	1500	1510	1500
query29	978	433	353	353
query30	254	155	129	129
query31	853	399	327	327
query32	127	78	76	76
query33	469	230	177	177
query34	975	796	504	504
query35	392	405	368	368
query36	569	564	534	534
query37	127	84	75	75
query38	1022	843	815	815
query39	464	500	470	470
query39_1	479	453	467	453
query40	199	92	77	77
query41	58	56	59	56
query42	76	73	71	71
query43	241	244	213	213
query44	1001	524	539	524
query45	113	108	101	101
query46	772	826	523	523
query47	755	755	692	692
query48	343	299	231	231
query49	538	236	188	188
query50	786	258	190	190
query51	8124	8016	7966	7966
query52	66	65	59	59
query53	192	193	145	145
query54	210	164	140	140
query55	72	58	60	58
query56	194	155	152	152
query57	657	647	682	647
query58	218	164	170	164
query59	1276	1228	1108	1108
query60	225	196	169	169
query61	107	104	106	104
query62	355	215	179	179
query63	168	138	141	138
query64	2819	680	599	599
query65	1630	1667	1580	1580
query66	1860	280	212	212
query67	9804	9625	9406	9406
query68	2725	1171	739	739
query69	338	238	192	192
query70	670	605	601	601
query71	238	178	157	157
query72	2269	1668	1464	1464
query73	609	555	333	333
query74	1573	1213	1120	1120
query75	1162	1073	943	943
query76	2280	706	558	558
query77	262	254	207	207
query78	3886	3820	3201	3201
query79	2861	792	586	586
query80	1625	338	273	273
query81	492	157	134	134
query82	625	133	92	92
query83	272	209	196	196
query84	295	113	86	86
query85	809	341	285	285
query86	400	187	172	172
query87	1015	970	901	901
query88	2885	2106	2103	2103
query89	277	197	172	172
query90	1930	128	119	119
query91	128	123	92	92
query92	76	71	60	60
query93	1975	1038	693	693
query94	657	248	189	189
query95	509	245	228	228
query96	829	574	261	261
query97	1078	1050	967	967
query98	174	133	132	132
query99	428	343	302	302
Total cold run time: 178225 ms
Total hot run time: 81086 ms

### What problem does this PR solve?

Problem Summary:

The configured ngram range test covered only a short input, and the regression assertion sampled two tokens without detecting missing, duplicate, or reordered output. Compare the complete deterministic 36-token sequence for sizes 1 through 8 in both BE unit and regression coverage.

### Release note

None

### Check List (For Author)

- Test
    - [x] Unit Test
    - [ ] Regression test
- Behavior changed:
    - [x] No.
- Does this need documentation?
    - [x] No.
@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.08	0.04	0.04
query3	0.26	0.12	0.10
query4	1.60	0.09	0.10
query5	0.17	0.15	0.15
query6	1.29	0.69	0.69
query7	0.03	0.01	0.00
query8	0.04	0.03	0.03
query9	0.28	0.22	0.21
query10	0.34	0.35	0.36
query11	0.17	0.12	0.11
query12	0.14	0.12	0.12
query13	0.31	0.31	0.30
query14	0.45	0.44	0.45
query15	0.36	0.35	0.36
query16	0.21	0.22	0.25
query17	0.67	0.73	0.68
query18	0.17	0.17	0.17
query19	1.20	1.05	1.15
query20	0.02	0.01	0.01
query21	15.44	0.15	0.11
query22	5.08	0.05	0.04
query23	16.17	0.25	0.10
query24	2.99	0.31	0.25
query25	0.10	0.04	0.04
query26	0.83	0.16	0.13
query27	0.04	0.02	0.02
query28	3.68	0.61	0.27
query29	12.42	3.16	2.57
query30	0.26	0.12	0.12
query31	2.76	0.37	0.17
query32	3.53	0.32	0.24
query33	1.43	1.53	1.50
query34	15.34	2.16	1.77
query35	1.74	1.76	1.71
query36	0.46	0.29	0.28
query37	0.06	0.04	0.04
query38	0.05	0.03	0.03
query39	0.03	0.03	0.02
query40	0.12	0.07	0.07
query41	0.08	0.03	0.03
query42	0.04	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 90.48 s
Total hot run time: 14.67 s

@airborne12

Copy link
Copy Markdown
Member Author

run buildall

@airborne12

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

Static review of e3f68c19ec66a9740e6435fc998879da10227a6d against 2573820600eb178150a35710a94fd58b478df96d is complete. I found two new P2 correctness/invariant issues and request changes. I treated the existing token-fan-out and deterministic-output discussions as hard duplicate fences.

Critical checkpoints

  • Goal and proof: The default ceiling of 1 and configured 1..8 path are wired from FE validation through policy persistence/Thrift into the BE factory, and the changed tests check the complete 36-token sequence. The feature is not yet correct because analyzer identity includes a validation-only property and FE/BE disagree on accepted numeric text.
  • Scope and design: The five-file implementation is otherwise focused. Runtime-effective analyzer identity needs canonicalization rather than hashing the complete tokenizer-policy map.
  • Concurrency: No new threads or shared mutable state are introduced. Existing policy-manager locking, per-call TOKENIZE/query streams, writer-local stream reuse, and matcher call_once initialization are unchanged; no lock-order or deadlock issue was found.
  • Lifecycle: Analyzer/factory ownership and static matcher lifetime are unchanged. No new circular ownership, cleanup, or cross-TU initialization issue was found.
  • Configuration: This is an immutable tokenizer-policy property, not a dynamically mutable process configuration. The default is consistently 1 in FE and BE; dynamic-reload concerns do not apply.
  • Compatibility: The supported BE-first rolling order is safe: old FE rejects the property, upgraded BE preserves the old default, and new FE enables it only after BE upgrade. No symbol or storage-format change is introduced. The Unicode parsing mismatch in the second inline comment is nevertheless a value-level FE/BE incompatibility.
  • Parallel paths: TOKENIZE, index writers, and query analysis all resolve the same policy and BE tokenizer factory. The property reaches all of them through the generic map path; no separate consumer was missed.
  • Conditions and errors: Missing, ASCII zero/negative, valid-boundary, and range behavior align across FE and BE. Unicode decimal text is accepted by FE and rejected later by BE. Error conversion is otherwise unchanged.
  • Tests and expected results: BE tests cover the configured range and all 36 ordered tokens; FE tests cover configured/default/negative validation; the regression case exercises DDL-to-BE propagation and full semantic output. Missing analyzer-identity and Unicode-parity cases correspond to the inline findings. The result-format concern is already covered by discussion r4000105184 and is not duplicated.
  • Observability: No new distributed or asynchronous operation is added, and existing analyzer-construction errors are surfaced; no new metric or logging requirement was identified.
  • Persistence, failover, and transactions: Edit-log/image serialization and Thrift push preserve the generic property map. Policies are immutable create/drop objects with fresh IDs, so ID-based reconciliation does not retain an older value for the same policy. No transaction, atomicity, delete-bitmap, or storage-version path changes.
  • Data writes: The new range affects token generation for inverted-index writes but does not change write transactionality or storage format. Writer/query analyzer parity was traced through the shared factory.
  • FE/BE propagation: All generic property-map paths carry max_ngram_diff; that unchanged-string propagation is exactly why the second finding fails late rather than at DDL validation.
  • Performance: The validation-only identity dimension can allow redundant indexes and their write/storage cost. The unbounded fan-out/resource concern is already raised in discussion r4000105182 and is not duplicated here.
  • Other: The user-visible property still needs documentation, as the PR description notes; no documentation file is included in this diff.

No additional user-provided focus was supplied, so I reviewed the full PR scope. Per the review contract I did not run builds or tests; this is a static review. The author's reported BE test and current CI formatting/checkstyle results are supporting evidence only, while BE UT, FE UT, and compile checks were still pending at submission time.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17558	3084	3072	3072
q2	2079	256	225	225
q3	10251	884	508	508
q4	4670	248	203	203
q5	7684	567	390	390
q6	137	112	92	92
q7	516	491	383	383
q8	9235	863	825	825
q9	3386	2369	2373	2369
q10	6505	853	698	698
q11	395	198	180	180
q12	623	256	196	196
q13	18123	1508	1168	1168
q14	156	147	139	139
q15	q16	443	395	368	368
q17	1339	919	794	794
q18	3052	2281	2218	2218
q19	1290	913	797	797
q20	380	280	200	200
q21	5578	1677	1785	1677
q22	331	268	225	225
Total cold run time: 93731 ms
Total hot run time: 16727 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3418	3385	3373	3373
q2	485	382	374	374
q3	2162	2319	2172	2172
q4	1176	1157	883	883
q5	2157	2119	2067	2067
q6	168	119	84	84
q7	1010	899	832	832
q8	1598	1393	1390	1390
q9	3105	3096	3102	3096
q10	1812	1768	1596	1596
q11	348	267	246	246
q12	450	424	339	339
q13	1468	1528	1154	1154
q14	185	178	161	161
q15	q16	389	407	357	357
q17	3576	3306	3197	3197
q18	4782	4389	4707	4389
q19	863	799	843	799
q20	1063	954	801	801
q21	3874	3121	3270	3121
q22	394	347	332	332
Total cold run time: 34483 ms
Total hot run time: 30763 ms

@hello-stephen

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

query5	4242	414	336	336
query6	369	135	128	128
query7	4964	427	236	236
query8	290	130	122	122
query9	8711	2864	2833	2833
query10	409	223	184	184
query11	5389	1035	928	928
query12	119	71	71	71
query13	1197	456	308	308
query14	6050	2178	2072	2072
query14_1	1978	1945	1932	1932
query15	177	120	107	107
query16	913	359	348	348
query17	808	451	361	361
query18	2330	323	239	239
query19	168	136	113	113
query20	74	70	70	70
query21	199	103	90	90
query22	5252	5288	5203	5203
query23	6775	6165	5983	5983
query23_1	6078	5932	6032	5932
query24	7320	1092	763	763
query24_1	761	775	774	774
query25	425	296	254	254
query26	1230	229	132	132
query27	2795	427	256	256
query28	4660	1517	1478	1478
query29	927	453	347	347
query30	249	154	133	133
query31	831	403	328	328
query32	126	75	70	70
query33	465	217	183	183
query34	991	833	491	491
query35	404	400	336	336
query36	586	558	554	554
query37	124	80	73	73
query38	1015	831	803	803
query39	482	482	454	454
query39_1	455	445	465	445
query40	203	96	76	76
query41	57	55	54	54
query42	74	72	70	70
query43	245	246	214	214
query44	999	529	545	529
query45	112	107	111	107
query46	780	846	542	542
query47	752	736	696	696
query48	316	301	262	262
query49	540	231	185	185
query50	767	257	194	194
query51	8027	7999	8177	7999
query52	66	66	58	58
query53	187	203	149	149
query54	224	155	136	136
query55	74	58	55	55
query56	194	178	168	168
query57	659	658	659	658
query58	204	176	226	176
query59	1204	1199	1094	1094
query60	247	175	181	175
query61	119	126	109	109
query62	361	200	176	176
query63	169	152	148	148
query64	2672	706	572	572
query65	1736	1689	1582	1582
query66	1785	264	240	240
query67	10043	9513	9675	9513
query68	2998	1141	702	702
query69	347	228	195	195
query70	662	630	604	604
query71	250	183	160	160
query72	2268	1640	1506	1506
query73	647	613	342	342
query74	2031	1222	1130	1130
query75	1175	1088	947	947
query76	2380	698	503	503
query77	264	246	212	212
query78	3826	3620	3187	3187
query79	2758	849	599	599
query80	1676	309	270	270
query81	554	152	132	132
query82	628	122	91	91
query83	280	202	185	185
query84	292	110	89	89
query85	845	325	288	288
query86	387	177	175	175
query87	1003	971	890	890
query88	2750	2104	2095	2095
query89	280	195	176	176
query90	1967	129	125	125
query91	128	119	94	94
query92	72	67	68	67
query93	1442	1105	692	692
query94	652	266	229	229
query95	533	250	292	250
query96	814	573	266	266
query97	1037	1081	1014	1014
query98	165	137	136	136
query99	433	335	304	304
Total cold run time: 178139 ms
Total hot run time: 81183 ms

@hello-stephen

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

query1	0.01	0.00	0.00
query2	0.08	0.03	0.04
query3	0.25	0.11	0.11
query4	1.63	0.09	0.10
query5	0.18	0.17	0.16
query6	1.27	0.71	0.72
query7	0.03	0.00	0.01
query8	0.05	0.03	0.03
query9	0.28	0.22	0.21
query10	0.34	0.33	0.34
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.31	0.32	0.30
query14	0.45	0.45	0.43
query15	0.36	0.36	0.35
query16	0.23	0.22	0.23
query17	0.71	0.66	0.69
query18	0.19	0.17	0.17
query19	1.20	1.16	1.22
query20	0.01	0.01	0.00
query21	15.45	0.17	0.13
query22	5.07	0.04	0.05
query23	16.20	0.25	0.10
query24	3.01	0.32	0.25
query25	0.10	0.04	0.04
query26	0.82	0.16	0.13
query27	0.03	0.03	0.03
query28	3.72	0.56	0.27
query29	12.43	3.18	2.57
query30	0.28	0.13	0.12
query31	2.76	0.38	0.17
query32	3.52	0.31	0.22
query33	1.34	1.52	1.34
query34	15.36	2.11	1.75
query35	1.74	1.77	1.72
query36	0.47	0.29	0.29
query37	0.06	0.04	0.04
query38	0.04	0.03	0.03
query39	0.03	0.03	0.03
query40	0.12	0.07	0.08
query41	0.08	0.03	0.02
query42	0.04	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 90.59 s
Total hot run time: 14.6 s

Issue Number: close apache#67916

Related PR: apache#67917

Problem Summary:
The max_ngram_diff creation limit incorrectly changed analyzer identity, allowing equivalent custom analyzers to bypass duplicate-index detection. FE also accepted non-ASCII digits that the BE integer parser rejects.

Exclude max_ngram_diff from ngram tokenizer identity and require its value to use ASCII integer syntax.

Release note:
None

Validation:
- ./run-fe-ut.sh --run org.apache.doris.analysis.invertedindex.AnalyzerIdentityBuilderTest,org.apache.doris.indexpolicy.PolicyValidatorTests (27 tests passed)
- FE Checkstyle passed as part of the targeted test run

Behavior changed:
Equivalent ngram analyzers now share an identity regardless of max_ngram_diff, and FE rejects non-ASCII max_ngram_diff values.

Documentation impact:
None
@airborne12

Copy link
Copy Markdown
Member Author

run buildall

@airborne12

Copy link
Copy Markdown
Member Author

/review

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17575	3047	3011	3011
q2	2081	262	224	224
q3	10245	876	516	516
q4	4674	252	199	199
q5	7679	573	387	387
q6	133	114	97	97
q7	525	509	383	383
q8	9245	891	853	853
q9	3494	2414	2401	2401
q10	6528	871	715	715
q11	408	199	179	179
q12	645	261	193	193
q13	18116	1528	1158	1158
q14	163	148	142	142
q15	q16	425	394	368	368
q17	1330	914	781	781
q18	3123	2257	2252	2252
q19	1284	926	789	789
q20	380	285	198	198
q21	5656	1774	1851	1774
q22	326	267	228	228
Total cold run time: 94035 ms
Total hot run time: 16848 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3410	3336	3327	3327
q2	502	396	375	375
q3	2235	2261	2173	2173
q4	1199	1161	905	905
q5	2192	2137	2101	2101
q6	163	118	86	86
q7	1026	931	859	859
q8	1588	1414	1412	1412
q9	3145	3158	3118	3118
q10	1894	1792	1610	1610
q11	359	271	249	249
q12	451	430	343	343
q13	1491	1544	1160	1160
q14	163	184	160	160
q15	q16	392	403	366	366
q17	3632	3314	3183	3183
q18	4812	4432	4773	4432
q19	856	889	883	883
q20	1012	965	832	832
q21	3872	3211	3245	3211
q22	396	355	316	316
Total cold run time: 34790 ms
Total hot run time: 31101 ms

@hello-stephen

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

query5	4263	416	340	340
query6	374	141	123	123
query7	4949	424	217	217
query8	305	124	121	121
query9	8675	2920	2904	2904
query10	391	227	185	185
query11	5378	1049	914	914
query12	120	73	75	73
query13	1201	428	319	319
query14	6156	2211	2098	2098
query14_1	1984	1990	1970	1970
query15	178	128	112	112
query16	907	379	349	349
query17	803	479	343	343
query18	2309	324	230	230
query19	156	131	104	104
query20	75	70	73	70
query21	216	97	88	88
query22	5486	5478	5300	5300
query23	6871	6326	6025	6025
query23_1	6005	6063	6157	6063
query24	7309	1084	761	761
query24_1	758	748	775	748
query25	406	276	244	244
query26	1230	225	127	127
query27	2804	414	246	246
query28	4685	1497	1502	1497
query29	908	417	341	341
query30	255	150	131	131
query31	819	404	339	339
query32	123	82	78	78
query33	465	206	179	179
query34	1002	835	475	475
query35	394	397	332	332
query36	568	570	546	546
query37	123	80	73	73
query38	1002	842	830	830
query39	486	481	474	474
query39_1	461	473	474	473
query40	205	90	78	78
query41	54	57	58	57
query42	78	74	74	74
query43	244	247	212	212
query44	1000	547	538	538
query45	110	109	99	99
query46	818	862	544	544
query47	761	739	736	736
query48	303	323	231	231
query49	551	245	213	213
query50	732	256	203	203
query51	8223	8157	8220	8157
query52	66	69	61	61
query53	185	197	148	148
query54	210	156	156	156
query55	95	66	61	61
query56	183	172	176	172
query57	666	670	629	629
query58	195	157	177	157
query59	1244	1242	1101	1101
query60	246	176	171	171
query61	114	134	138	134
query62	356	207	177	177
query63	170	134	138	134
query64	2745	665	571	571
query65	1614	1588	1650	1588
query66	1780	251	200	200
query67	9755	9882	9689	9689
query68	2721	1172	726	726
query69	360	231	187	187
query70	677	620	625	620
query71	253	179	156	156
query72	2315	1656	1685	1656
query73	639	598	331	331
query74	1576	1229	1148	1148
query75	1187	1099	974	974
query76	2297	728	517	517
query77	259	247	210	210
query78	3849	3718	3220	3220
query79	1285	839	585	585
query80	1303	325	259	259
query81	461	157	142	142
query82	611	125	96	96
query83	315	217	191	191
query84	290	125	89	89
query85	935	339	290	290
query86	406	170	172	170
query87	1040	983	902	902
query88	2820	2119	2130	2119
query89	292	199	176	176
query90	1881	132	127	127
query91	134	122	100	100
query92	82	65	62	62
query93	1242	1097	697	697
query94	675	249	207	207
query95	526	249	251	249
query96	802	566	284	284
query97	1058	1071	971	971
query98	143	133	129	129
query99	421	341	308	308
Total cold run time: 175599 ms
Total hot run time: 82222 ms

@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 result: request changes; no new inline findings.

This static review converged after two rounds on exact head 89137eab9b7acc1b55534a6ea5dec8fc95304980 against base 2573820600eb178150a35710a94fd58b478df96d. The current head resolves the analyzer-identity and new-property Unicode-parsing findings, and the final seven-file sweep found no further distinct PR-introduced issue. Existing discussions r4000105182 and r4000105184 remain the authoritative blocking feedback, so I did not duplicate either inline comment.

Critical checkpoint conclusions:

  • Goal and proof: The FE validator, persisted policy map, FE-to-BE delivery, and BE factory consistently implement configurable max_ngram_diff, with the old default of 1. The implementation correctly treats the ceiling as validation-only for analyzer identity. Safe completion is still blocked by the already-raised resource-bound concern.
  • Scope and design: The seven changed files are focused on validation, factory construction, identity, and tests. Excluding only max_ngram_diff from ngram-tokenizer identity preserves every runtime-effective tokenizer property.
  • Concurrency and lifecycle: No thread, lock-order, shared-mutable-state, ownership, cleanup, static-initialization, or reusable-stream lifecycle change is introduced. Fresh TOKENIZE/query streams and reusable writer streams construct the same factory, and tokenizer reset behavior is unchanged.
  • Configuration and compatibility: This is immutable per-policy metadata rather than a dynamically reloadable process setting. Missing values preserve the default; FE and BE align on the configured comparison and negative rejection, and FE now rejects non-ASCII text for the new field before persistence. Existing policies retain old behavior. The mechanically risky new-FE/old-BE topology is outside Doris's documented BE-first upgrade order: https://doris.apache.org/docs/4.x/admin-manual/cluster-management/upgrade/.
  • Propagation and parallel paths: The generic property map is preserved through EditLog/image replay, report-driven PushIndexPolicyTask delivery, and BE policy storage. TOKENIZE, classic/SNII index writers, and query analyzers all converge on NGramTokenizerFactory; no consumer drops or reinterprets the property.
  • Conditions and errors: Default, configured, negative, non-ASCII, and range checks are understandable and aligned for the new field. The Round 1 Unicode min/max and leading-zero identity candidates are concrete older gaps, but authoritative base/head comparison confirms this PR neither introduces nor worsens them.
  • Tests and result correctness: The BE unit case checks the full ordered 36-token sequence for sizes 1..8. FE cases cover default rejection, configured acceptance, negative/non-ASCII input, and identity behavior; the regression covers asynchronous policy arrival plus lazy BE construction through TOKENIZE. Its deterministic result still uses assertEquals instead of the repository-required qt_* plus generated .out, which remains covered by r4000105184. No separate writer/search-only failure mechanism was found.
  • Persistence, failover, transactions, and writes: The existing generic policy serialization/replay format already carries the new property, with no schema or storage-format change. No transaction, atomicity, delete-bitmap, or failover protocol changes. Index writes share the tokenizer factory; no distinct write-correctness issue was found.
  • Performance and memory: Very wide low-minimum ranges can still cause quadratic token work, TOKENIZE materialization, and synchronous postings work. That exact issue remains hard-fenced by r4000105182; no distinct new overflow, cancellation, or allocation finding survived deduplication.
  • Observability: Existing validation/analyzer-construction errors identify invalid policy values, and this patch adds no new distributed state transition requiring metrics or logging. Prevention, rather than added observability, is the relevant response to the existing resource concern.
  • Other and user focus: No additional user-provided focus was supplied. The PR describes user-visible syntax and still marks documentation as needed, but no documentation file is included in this diff.

No builds or tests were run because the review contract prohibits them. The author reports 14 BE tokenizer tests and 27 focused FE tests passing; those claims were not independently reproduced. At submission time, Checkstyle, Clang Formatter, license, title, and secret checks pass, while BE UT, FE UT, compile, and performance checks remain pending.

Review completion: complete after two rounds. Every candidate is dismissed with concrete evidence or fenced by existing GitHub feedback; there are no accepted new inline comments. The request-changes opinion remains solely because r4000105182 and r4000105184 are unresolved.

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.07	0.03	0.04
query3	0.25	0.11	0.10
query4	1.60	0.10	0.09
query5	0.18	0.15	0.16
query6	1.27	0.67	0.68
query7	0.03	0.00	0.01
query8	0.05	0.04	0.03
query9	0.29	0.21	0.22
query10	0.37	0.40	0.36
query11	0.16	0.12	0.12
query12	0.15	0.12	0.11
query13	0.31	0.30	0.32
query14	0.47	0.45	0.45
query15	0.36	0.36	0.34
query16	0.23	0.21	0.23
query17	0.70	0.68	0.68
query18	0.16	0.17	0.16
query19	1.24	1.21	1.14
query20	0.02	0.01	0.01
query21	15.50	0.16	0.13
query22	5.08	0.05	0.04
query23	16.23	0.26	0.11
query24	2.97	0.33	0.29
query25	0.14	0.03	0.02
query26	0.81	0.18	0.11
query27	0.03	0.04	0.03
query28	3.70	0.58	0.27
query29	12.45	3.20	2.58
query30	0.25	0.10	0.11
query31	2.75	0.36	0.17
query32	3.53	0.32	0.23
query33	1.36	1.48	1.53
query34	15.41	2.23	1.76
query35	1.76	1.76	1.72
query36	0.47	0.29	0.30
query37	0.06	0.04	0.04
query38	0.05	0.03	0.03
query39	0.03	0.02	0.02
query40	0.11	0.08	0.07
query41	0.08	0.02	0.03
query42	0.03	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 90.74 s
Total hot run time: 14.72 s

### What problem does this PR solve?

Issue Number: close apache#67916

Related PR: apache#67917

Problem Summary:

An arbitrarily large max_ngram_diff could multiply token output without a hard fan-out bound, and the deterministic regression assertion was not stored as a runner-generated golden.

Cap max_ngram_diff at 255 consistently in FE and BE, cover the accepted and rejected boundaries, and replace the manual token-list assertion with a named golden query generated by the regression runner.

### Release note

The max_ngram_diff tokenizer setting accepts values from 0 through 255.

### Check List (For Author)

- Test
    - [x] Regression test
    - [x] Unit Test
    - [x] Manual test
- Behavior changed:
    - [ ] No.
    - [x] Yes. max_ngram_diff values above 255 are rejected to bound per-position token fan-out.
- Does this need documentation?
    - [ ] No.
    - [x] Yes. Document the supported max_ngram_diff range.

Validation:

- ./build.sh --be -j8 (ASAN, Java extensions, build hygiene, and glibc compatibility)
- ./build.sh --fe -j8
- NGramTokenizerTest: 16/16 passed
- AnalyzerIdentityBuilderTest and PolicyValidatorTests: 29/29 passed
- test_ngram_max_diff_custom_analyzer: runner-generated golden and clean comparison passed on an isolated local FE/BE
- clang-format 16, clang-tidy, and Checkstyle passed
@airborne12

Copy link
Copy Markdown
Member Author

/review

@airborne12

Copy link
Copy Markdown
Member Author

run buildall

@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 result: request changes. This static review converged after three bounded rounds on exact head c52bb7f1e59cd37992f4f48ba08cf90e926c1232 against base 2573820600eb178150a35710a94fd58b478df96d. Two distinct P2 issues remain: newly admitted small-width policies can reach unsafe absolute-size allocation, and analyzer identity collapses a usable replacement with replayed legacy-invalid state. Existing discussions about width-driven fan-out, deterministic output, valid-policy identity, and Unicode parsing were treated as hard duplicate fences.

Critical checkpoints

  • Goal and proof: FE and BE both implement max_ngram_diff, preserve the old default of 1, and accept the intended 1..8 configuration with an explicit limit of 7. The complete 36-token unit and regression expectations prove the normal emitted sequence statically. The goal is not safely complete because M-1 admits absolute gram sizes that fail on first use and M-2 blocks repair of legacy persisted state.
  • Scope and design: The nine-file patch is focused on validation, identity, and tests. The cross-language ceiling is clear, but absolute-size safety and legacy-state-aware identity canonicalization are missing.
  • Concurrency: No new thread, lock acquisition, lock order, shared mutable setting, or atomic protocol is introduced. Existing policy-manager locking and function-local once_flag matcher initialization are unchanged.
  • Lifecycle and static initialization: Policy installation remains lazy; analyzer/factory ownership and tokenizer stream lifetimes are unchanged. No circular ownership, release-path, or cross-translation-unit initialization issue was found. That lazy lifecycle is relevant to M-1 because DDL and synchronization succeed before tokenizer allocation.
  • Configuration behavior: This is immutable persisted per-policy metadata, not a dynamically reloadable process setting. FE and current BE align on absence/default 1, ASCII syntax for the new field, and inclusive 0..255 bounds. The duplicated limit has corresponding boundary coverage.
  • Compatibility: Existing valid policies without the property preserve width-one behavior. The documented supported rolling procedure upgrades all BEs before FEs, so the unsupported new-FE/old-BE topology is not reported: https://doris.apache.org/docs/4.x/admin-manual/cluster-management/upgrade/. Supported replay can still retain base-FE-created wide policies without the property; M-2 covers that separate persisted-state defect.
  • Parallel paths: TOKENIZE, classic inverted-index writing, SNII writing, and query analysis all resolve the same custom analyzer and NGramTokenizerFactory; no path drops or reinterprets the new property.
  • Conditions and error handling: Normal default, configured, negative, non-ASCII, 255, 256, and ordered-range checks are understandable and aligned. No absolute gram bound, checked size_t calculation, or allocation-safe boundary exists before NGramTokenizer::init; replay also does not mark legacy-invalid n-gram policies.
  • Tests and expected results: The BE unit vector and generated regression golden contain the complete deterministic 36-token result. FE/BE tests cover configured success, default rejection, negative/non-ASCII input, and 255/256. Missing oversized-allocation and replay-plus-replacement cases map directly to M-1 and M-2. The identity test's no-limit 1..8 control is not runtime-valid and masks M-2. No separate writer test is required to expose another path because all writers share the factory.
  • Observability: Existing validation and analyzer-construction errors are adequate for ordinary failures, and this patch adds no new distributed state transition requiring metrics. Replayed invalid policy state lacks a diagnostic/marker, as covered by M-2.
  • Persistence and transactions: The generic Gson/EditLog/image and Thrift property maps preserve max_ngram_diff; no new transaction or failover protocol is added. Replay without current validation is the compatibility exception in M-2.
  • Data writes and storage: There is no storage-format, data-version, atomicity, delete-bitmap, or merge-on-write change. Index writers consume the same lazy tokenizer, so M-1 applies to writes without creating a separate data-correctness finding.
  • FE-to-BE propagation: PushIndexPolicyTask, report reconciliation, and BE policy storage carry the complete property map. New FE/current BE semantics agree; no capability gate exists, but supported BE-first order handles mixed versions.
  • Performance and memory: M-1 is the remaining resource defect. Its exact width-two cases are newly reachable even though the underlying width-zero/one absolute-size weakness predates this PR. The earlier width-driven token fan-out issue is already covered by r4000105182 and is not duplicated.
  • Other issues and user focus: No additional user-provided focus was supplied. The user-visible property has no documentation change in this diff, but no separate correctness issue was substantiated.

Per the review contract, I did not run builds or tests and did not modify repository source. These conclusions are static; author and CI test claims were not independently reproduced.

### What problem does this PR solve?

Problem Summary:

Large absolute ngram sizes could allocate an excessive tokenizer buffer even when max_ngram_diff was small. Persisted ngram policies that became invalid under current validation could also collide with a valid replacement analyzer identity.

Cap custom ngram tokenizer sizes at 1024 in FE and BE, use overflow-safe buffer sizing, reject references to invalid replayed tokenizer policies, and give those policies stable policy-specific identities.

### Release note

None

### Check List (For Author)

- Test
    - [x] Regression test
    - [x] Unit Test
- Behavior changed:
    - [x] Yes. Unsafe or currently invalid ngram tokenizer policies are rejected before analyzer construction.
- Does this need documentation?
    - [x] No.
@airborne12

Copy link
Copy Markdown
Member Author

run buildall

@airborne12

Copy link
Copy Markdown
Member Author

/review

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17614	3050	3051	3050
q2	2063	255	218	218
q3	10282	888	515	515
q4	4673	257	205	205
q5	7665	575	393	393
q6	136	114	94	94
q7	544	501	397	397
q8	9246	870	924	870
q9	3504	2399	2406	2399
q10	6525	867	715	715
q11	387	205	180	180
q12	615	261	204	204
q13	18156	1518	1166	1166
q14	159	155	144	144
q15	q16	454	402	370	370
q17	1305	853	789	789
q18	3131	2250	2279	2250
q19	1120	890	695	695
q20	365	288	205	205
q21	5271	1790	1885	1790
q22	341	266	234	234
Total cold run time: 93556 ms
Total hot run time: 16883 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3442	3365	3338	3338
q2	510	390	379	379
q3	2238	2326	2150	2150
q4	1208	1170	903	903
q5	2173	2116	2122	2116
q6	168	122	86	86
q7	1035	919	862	862
q8	1596	1391	1390	1390
q9	3154	3148	3118	3118
q10	1871	1821	1623	1623
q11	359	274	251	251
q12	470	429	345	345
q13	1479	1553	1162	1162
q14	167	180	156	156
q15	q16	388	400	363	363
q17	3627	3353	3183	3183
q18	4844	4437	4794	4437
q19	838	902	889	889
q20	1000	941	828	828
q21	3783	3071	3209	3071
q22	409	341	326	326
Total cold run time: 34759 ms
Total hot run time: 30976 ms

@hello-stephen

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

query5	4250	421	341	341
query6	372	137	120	120
query7	4954	405	212	212
query8	287	122	133	122
query9	8684	2894	2883	2883
query10	386	221	187	187
query11	5387	1036	935	935
query12	119	74	71	71
query13	1209	436	309	309
query14	6010	2219	2109	2109
query14_1	1998	1976	1987	1976
query15	173	120	114	114
query16	909	352	277	277
query17	789	454	374	374
query18	2324	325	237	237
query19	168	138	108	108
query20	72	71	71	71
query21	203	103	90	90
query22	5368	5364	5347	5347
query23	6710	6254	6009	6009
query23_1	6217	6100	6100	6100
query24	7292	1103	776	776
query24_1	786	778	786	778
query25	409	283	233	233
query26	1245	238	126	126
query27	2789	416	254	254
query28	4695	1479	1499	1479
query29	912	419	333	333
query30	256	156	139	139
query31	814	403	327	327
query32	127	88	73	73
query33	464	208	160	160
query34	994	841	473	473
query35	392	398	342	342
query36	579	547	545	545
query37	117	78	70	70
query38	994	849	848	848
query39	488	497	460	460
query39_1	476	455	448	448
query40	204	93	75	75
query41	54	52	50	50
query42	73	75	71	71
query43	240	243	211	211
query44	992	535	534	534
query45	106	106	103	103
query46	756	834	558	558
query47	765	772	724	724
query48	311	310	229	229
query49	536	253	181	181
query50	739	265	199	199
query51	8286	8119	8090	8090
query52	66	65	57	57
query53	191	201	153	153
query54	244	157	156	156
query55	70	61	57	57
query56	307	169	168	168
query57	702	658	668	658
query58	224	170	170	170
query59	1247	1218	1103	1103
query60	232	185	179	179
query61	115	118	114	114
query62	345	198	176	176
query63	174	143	135	135
query64	2732	699	571	571
query65	1617	1604	1615	1604
query66	1880	303	217	217
query67	9972	9553	9691	9553
query68	2765	1150	739	739
query69	341	230	191	191
query70	687	627	616	616
query71	242	180	174	174
query72	2253	1682	1487	1487
query73	663	604	335	335
query74	1574	1229	1167	1167
query75	1169	1105	950	950
query76	2302	702	504	504
query77	240	251	210	210
query78	3906	3590	3195	3195
query79	1160	831	587	587
query80	1102	317	281	281
query81	454	153	131	131
query82	577	125	97	97
query83	282	211	191	191
query84	290	112	89	89
query85	1006	360	280	280
query86	337	174	186	174
query87	1025	990	918	918
query88	2753	2107	2116	2107
query89	283	198	175	175
query90	1775	131	132	131
query91	130	119	97	97
query92	80	73	71	71
query93	1198	1064	702	702
query94	544	250	226	226
query95	509	258	304	258
query96	820	610	272	272
query97	1095	1081	1015	1015
query98	143	137	133	133
query99	427	349	314	314
Total cold run time: 175137 ms
Total hot run time: 82016 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.07	0.03	0.03
query3	0.25	0.12	0.11
query4	1.60	0.10	0.10
query5	0.17	0.16	0.16
query6	1.26	0.72	0.68
query7	0.03	0.01	0.00
query8	0.04	0.03	0.03
query9	0.30	0.23	0.22
query10	0.36	0.34	0.35
query11	0.16	0.12	0.12
query12	0.15	0.13	0.12
query13	0.31	0.32	0.31
query14	0.46	0.46	0.46
query15	0.35	0.34	0.35
query16	0.21	0.20	0.24
query17	0.72	0.69	0.71
query18	0.18	0.18	0.17
query19	1.22	1.08	1.21
query20	0.02	0.01	0.01
query21	15.43	0.15	0.12
query22	5.07	0.05	0.04
query23	16.21	0.26	0.11
query24	3.04	0.34	0.26
query25	0.10	0.04	0.03
query26	0.73	0.18	0.12
query27	0.04	0.03	0.03
query28	3.62	0.54	0.28
query29	12.51	3.20	2.55
query30	0.25	0.11	0.12
query31	2.76	0.37	0.17
query32	3.53	0.32	0.23
query33	1.49	1.53	1.43
query34	15.37	2.18	1.81
query35	1.76	1.75	1.72
query36	0.46	0.30	0.29
query37	0.07	0.04	0.03
query38	0.04	0.03	0.03
query39	0.03	0.03	0.02
query40	0.12	0.07	0.08
query41	0.07	0.02	0.02
query42	0.03	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 90.64 s
Total hot run time: 14.7 s

@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: one P1 backward-compatibility defect remains.

The configurable max_ngram_diff path is otherwise focused and internally consistent, but the new absolute gram-size ceiling is applied to metadata that was valid under the previous release. That makes the feature unsafe for a supported rolling upgrade until legacy policies are preserved or migrated.

Checkpoint conclusions:

  • Goal and proof: FE and BE implement the default limit of 1 and configured range through 255, and the unit/regression changes cover validation boundaries and the complete deterministic 36-token result. The goal is not fully achieved because the accepted size cap breaks existing policies during upgrade.
  • Scope and clarity: the implementation is localized to tokenizer validation/allocation, policy validity/identity, and focused tests. All 13 changed files and their producer/consumer paths were reviewed.
  • Concurrency: no new threads or shared mutable state are introduced. Existing IndexPolicyMgr map access remains under its read/write lock, with no new heavy operation under lock, lock-order change, or deadlock path.
  • Lifecycle and static initialization: tokenizer factories remain immutable after initialization and no cross-TU static dependency or ownership cycle was added. Image/edit-log replay recomputes validity with the current binary; that lifecycle choice is the accepted compatibility defect.
  • Configuration: max_ngram_diff is persisted policy metadata rather than a dynamic process configuration, so live config propagation is not applicable.
  • Compatibility and protocol: the existing generic FE-to-BE property map needs no schema change, and the documented BE-first upgrade order prevents new-FE/old-BE wider-range DDL. It does not protect already persisted fixed-size policies above 1024: upgraded BEs reject lazy reconstruction before FE upgrade, and upgraded FEs then reject analyzer references.
  • Parallel paths and conditions: CREATE ANALYZER, CREATE TABLE, ALTER ADD INDEX, direct TOKENIZE, classic/SNII writers, query analyzer creation, policy report/push, and identity fallback were traced. Head FE/BE validation agrees; the unchanged unbounded edge_ngram path is a pre-existing hardening gap, not a distinct regression.
  • Error handling, memory, and nullability: invalid head policies fail with explicit validation/construction errors; no unchecked Status, new ownership problem, column-nullability path, or unsafe bounded arithmetic was found. With the new cap, the n-gram buffer is bounded to 5120 code-point slots.
  • Tests and results: the added boundary, invalid-input, identity/replay, and end-to-end golden coverage is internally consistent. The missing case is an image/edit-log upgrade test for an existing valid fixed-size policy above 1024 and its dependent index. No builds or tests were run in this static-only review; test claims in the PR and thread replies are author-provided.
  • Observability: replay warnings contain policy name, ID, and type; no additional metric is warranted for this DDL path. Logging does not preserve availability for the incompatible metadata.
  • Persistence, transactions, and data writes: policy create/drop journaling, replay, image rebuild, and generic BE synchronization were reviewed. No storage-format, transaction, visible-version, delete-bitmap, atomicity, or data-write logic changes are involved; failover is otherwise symmetric.
  • FE/BE variables and performance: the property reaches BE through every discovered policy path. The 255 difference cap bounds per-position fan-out and the 1024 cap bounds allocation; earlier fan-out/allocation/output concerns are already covered by existing threads. No additional distinct performance defect survived review.
  • Documentation and user focus: the new policy property and limits should be documented after compatibility is resolved. No additional user-provided focus was supplied.

Review status: complete static review at exact head 8de9abb95d0c17da0588b2196ccf8ea135477801. Two full review rounds converged with every candidate accepted, duplicate-fenced, or dismissed with evidence.

### What problem does this PR solve?

Problem Summary:

The absolute ngram size limit was applied during replay and BE reconstruction, so policies accepted before the limit existed could become unusable during a supported rolling upgrade.

Persist an explicit compatibility marker on newly created ngram policies and enforce the absolute size limit only for marked policies. Preserve the former validation and construction behavior for marker-less legacy metadata. Cover serialized replay, dependent analyzer validation, marker persistence, and BE factory construction.

### Release note

None

### Check List (For Author)

- Test
    - [x] Unit Test
- Behavior changed:
    - [x] Yes. Legacy ngram policies remain usable after upgrade while newly created policies retain the absolute size limit.
- Does this need documentation?
    - [x] No.
@airborne12

Copy link
Copy Markdown
Member Author

run buildall

@airborne12

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

Automated static review conclusion: no new distinct blocking issue at head 035a049 against base 2573820. Two bounded review rounds converged, all existing inline discussions were used as hard duplicate fences, and no new inline comment remains.

Critical checkpoint conclusions:

  • Goal and proof: The patch implements configurable max_ngram_diff with the prior default of 1, a 0..255 fan-out limit, a 1024 absolute-size bound for newly created policies, and marker-less compatibility for policies persisted by an older FE. The BE unit, FE unit, replay/identity, and regression changes statically cover the intended 1..8 sequence, validation boundaries, marker persistence, legacy 2048 reconstruction, and deterministic output.
  • Scope and clarity: All 13 changed files are focused on tokenizer validation/allocation, policy compatibility and identity, and their tests. No unrelated production behavior was added.
  • Concurrency: No new thread, atomic, or lock order is introduced. IndexPolicyMgr continues to protect its policy map with the existing read/write lock; the added property parsing and map insertion under creation are bounded, lightweight operations, and no deadlock path was found.
  • Lifecycle and static initialization: No new ownership cycle, cleanup protocol, reusable-stream lifecycle change, or cross-translation-unit static dependency is introduced. The relevant lifecycle is persisted policy creation, image/EditLog replay, FE report/push, BE storage, and lazy analyzer reconstruction; the compatibility marker survives that complete path.
  • Configuration behavior: max_ngram_diff is immutable per-policy metadata, not a dynamically reloadable process configuration, so dynamic-change handling is not applicable.
  • Compatibility: The generic property map requires no Thrift or storage-schema change. New FE policies always carry the marker and are capped; replay does not synthesize it, so policies created before upgrade retain the former fixed-width behavior. This is consistent through the supported BE-first rolling-upgrade order.
  • Parallel paths: TOKENIZE, query analysis, and classic/SNII index writers converge on the same ngram factory and property map. The separate edge_ngram validator/factory remains uncapped, but exact base/head arithmetic shows the same multi-GiB request was already reachable before this PR; it is a pre-existing parallel instance of the absolute-size mechanism already fenced by discussion 4000732693, not a distinct PR finding.
  • Conditions and errors: Default, explicit, ASCII syntax, positivity/order, 0, 255, 256, marker-presence, and 1024 boundary conditions align between FE and BE. Existing analyzer-validation and construction errors are propagated; no unchecked Status, nullability path, or speculative recovery branch was added.
  • Test coverage: The patch includes focused BE and FE unit coverage plus an end-to-end regression path. Negative cases cover malformed and out-of-range input, marked oversized metadata, invalid replayed state, and valid replacement identity. The complete 36-token sequence supplies a deterministic oracle for the newly enabled range.
  • Test-result correctness: The checked-in unit expectations and generated regression result are internally consistent with the tokenizer loop and ordered sequence. A trailing blank line in the generated result is the only git diff-check warning and does not change the oracle.
  • Observability: This patch adds no new distributed state transition or long-running background operation. Existing validation, replay, and analyzer-construction diagnostics are sufficient; no additional metric or INFO log is warranted.
  • Persistence, failover, and transactions: The policy map is written and replayed through the existing Gson/EditLog/image mechanisms, and replay preserves marker presence exactly. Master failover reconstructs the same state. No transaction protocol is changed.
  • Data writes: There is no storage-format, visible-version, delete-bitmap, atomicity, or data-mutation protocol change. Index writers use the same validated factory; no separate write-correctness defect was found.
  • FE-to-BE propagation: ReportHandler and PushIndexPolicyTask carry the complete generic property map, BE stores it unchanged, and analyzer reconstruction observes the same marker and numeric values on every discovered path.
  • Performance and memory: The 255 difference bound limits per-position fan-out, marked policies cap gram size at 1024, and the allocation arithmetic is widened to size_t. Legacy marker-less behavior is intentionally preserved for compatibility. No new distinct CPU, allocation, overflow, or cancellation issue survived the PR-scope and duplicate fences.
  • Other issues and user focus: No additional user-provided review focus was supplied. The user-visible property still needs its planned documentation, but no separate code-correctness issue was found.

No builds or tests were run because the review contract prohibits them. The author reports focused BE/FE tests and full ASAN builds; those claims were not independently reproduced. At the pre-submission check, CheckStyle, Clang Formatter, license, title, secret, and Cloud UT checks pass, while BE UT, FE UT, compile, performance, and the automated code-review checks remain pending.

Review status: complete static review after two rounds. No new inline findings.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17679	3079	3055	3055
q2	2066	260	239	239
q3	10235	912	503	503
q4	4672	248	202	202
q5	7678	560	393	393
q6	138	116	96	96
q7	539	489	394	394
q8	9250	929	901	901
q9	3413	2379	2392	2379
q10	6489	841	702	702
q11	385	193	178	178
q12	610	255	202	202
q13	18149	1531	1147	1147
q14	155	150	139	139
q15	q16	445	402	364	364
q17	1434	873	765	765
q18	3129	2286	2257	2257
q19	1257	908	790	790
q20	401	283	195	195
q21	5601	1605	1738	1605
q22	330	272	228	228
Total cold run time: 94055 ms
Total hot run time: 16734 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3436	3380	3361	3361
q2	519	385	378	378
q3	2168	2664	2239	2239
q4	1200	1164	904	904
q5	2171	2122	2117	2117
q6	167	118	87	87
q7	1017	948	876	876
q8	1590	1414	1421	1414
q9	3149	3116	3103	3103
q10	1861	1812	1644	1644
q11	369	265	253	253
q12	453	430	343	343
q13	1475	1551	1179	1179
q14	165	169	162	162
q15	q16	394	394	368	368
q17	3604	3382	3270	3270
q18	4833	4406	4727	4406
q19	888	919	844	844
q20	994	955	821	821
q21	3765	3084	3191	3084
q22	384	342	318	318
Total cold run time: 34602 ms
Total hot run time: 31171 ms

@hello-stephen

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

query5	4257	413	329	329
query6	381	133	123	123
query7	4961	426	235	235
query8	289	121	121	121
query9	8700	2908	2906	2906
query10	399	235	182	182
query11	5405	1043	915	915
query12	128	71	70	70
query13	1189	425	324	324
query14	6167	2221	2100	2100
query14_1	2012	1948	1963	1948
query15	178	117	110	110
query16	919	359	346	346
query17	789	454	354	354
query18	2327	331	231	231
query19	158	143	122	122
query20	75	71	77	71
query21	202	102	88	88
query22	5404	5470	5308	5308
query23	6662	6181	6095	6095
query23_1	6232	6117	6168	6117
query24	7253	1093	766	766
query24_1	769	797	779	779
query25	429	300	289	289
query26	1220	241	127	127
query27	2777	428	242	242
query28	4702	1492	1499	1492
query29	905	419	334	334
query30	255	155	130	130
query31	807	391	330	330
query32	134	83	82	82
query33	441	210	169	169
query34	970	834	494	494
query35	395	406	346	346
query36	548	557	552	552
query37	120	78	74	74
query38	1023	849	830	830
query39	481	500	502	500
query39_1	438	461	469	461
query40	200	89	80	80
query41	54	51	50	50
query42	76	71	70	70
query43	240	242	208	208
query44	998	533	526	526
query45	110	106	102	102
query46	785	828	548	548
query47	750	774	705	705
query48	292	303	227	227
query49	532	240	186	186
query50	741	264	195	195
query51	8127	8095	8196	8095
query52	70	69	57	57
query53	187	196	148	148
query54	216	159	145	145
query55	74	59	56	56
query56	192	200	151	151
query57	689	649	654	649
query58	195	163	162	162
query59	1219	1265	1113	1113
query60	230	197	171	171
query61	113	132	109	109
query62	359	222	175	175
query63	167	140	142	140
query64	2812	684	705	684
query65	1656	1575	1599	1575
query66	1831	277	219	219
query67	10068	9681	9563	9563
query68	2744	1266	746	746
query69	341	213	199	199
query70	676	620	631	620
query71	250	177	177	177
query72	2315	1652	1454	1454
query73	645	583	338	338
query74	1569	1232	1144	1144
query75	1170	1105	955	955
query76	2288	739	520	520
query77	264	262	205	205
query78	3971	3794	3192	3192
query79	2558	819	589	589
query80	1576	332	266	266
query81	486	157	136	136
query82	617	126	94	94
query83	270	209	197	197
query84	293	111	89	89
query85	762	334	278	278
query86	385	168	188	168
query87	1033	979	897	897
query88	2782	2104	2108	2104
query89	279	194	175	175
query90	1988	137	134	134
query91	131	125	103	103
query92	77	65	70	65
query93	1453	1085	720	720
query94	633	265	211	211
query95	507	243	289	243
query96	827	575	285	285
query97	1052	1072	995	995
query98	165	144	134	134
query99	419	349	314	314
Total cold run time: 177445 ms
Total hot run time: 82100 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.08	0.04	0.04
query3	0.25	0.11	0.10
query4	1.62	0.09	0.10
query5	0.18	0.17	0.15
query6	1.28	0.70	0.68
query7	0.04	0.01	0.00
query8	0.05	0.03	0.03
query9	0.28	0.22	0.21
query10	0.37	0.33	0.34
query11	0.15	0.11	0.12
query12	0.15	0.12	0.12
query13	0.31	0.31	0.30
query14	0.46	0.45	0.47
query15	0.36	0.35	0.35
query16	0.22	0.24	0.23
query17	0.71	0.66	0.66
query18	0.18	0.18	0.17
query19	1.20	1.17	1.16
query20	0.01	0.02	0.02
query21	15.42	0.15	0.12
query22	5.08	0.05	0.04
query23	16.21	0.26	0.11
query24	3.00	0.32	0.25
query25	0.11	0.04	0.03
query26	0.84	0.16	0.11
query27	0.04	0.03	0.02
query28	3.68	0.54	0.28
query29	12.46	3.16	2.58
query30	0.26	0.10	0.12
query31	2.75	0.38	0.17
query32	3.51	0.34	0.23
query33	1.58	1.50	1.40
query34	15.36	2.16	1.79
query35	1.77	1.74	1.72
query36	0.46	0.28	0.28
query37	0.05	0.03	0.04
query38	0.05	0.03	0.03
query39	0.03	0.03	0.03
query40	0.11	0.07	0.07
query41	0.08	0.03	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 90.83 s
Total hot run time: 14.66 s

@airborne12

Copy link
Copy Markdown
Member Author

run buildall

@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.35% (34637/45365)
Line Coverage 61.31% (389448/635229)
Region Coverage 57.70% (327728/567980)
Branch Coverage 58.40% (149126/255369)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 44.07% (26/59) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17598	3064	3043	3043
q2	2108	299	224	224
q3	10209	844	529	529
q4	4681	260	210	210
q5	7659	591	383	383
q6	139	116	95	95
q7	532	513	387	387
q8	9240	892	919	892
q9	3537	2424	2415	2415
q10	6518	877	708	708
q11	402	203	175	175
q12	625	260	202	202
q13	18121	1530	1170	1170
q14	159	151	144	144
q15	q16	452	411	372	372
q17	1354	881	770	770
q18	3112	2307	2290	2290
q19	1259	853	727	727
q20	379	289	204	204
q21	5591	1626	1812	1626
q22	328	272	223	223
Total cold run time: 94003 ms
Total hot run time: 16789 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3413	3351	3334	3334
q2	517	409	385	385
q3	2267	2494	2204	2204
q4	1199	1209	904	904
q5	2210	2163	2145	2145
q6	170	129	87	87
q7	1027	921	896	896
q8	1591	1412	1400	1400
q9	3214	3229	3198	3198
q10	1893	1836	1682	1682
q11	365	271	249	249
q12	468	440	344	344
q13	1500	1542	1185	1185
q14	173	191	165	165
q15	q16	398	400	362	362
q17	3654	3313	3345	3313
q18	4893	4566	4868	4566
q19	957	860	865	860
q20	1000	973	843	843
q21	3777	3075	3165	3075
q22	398	336	330	330
Total cold run time: 35084 ms
Total hot run time: 31527 ms

@hello-stephen

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

query5	4291	419	329	329
query6	376	130	115	115
query7	4986	419	234	234
query8	286	124	117	117
query9	8687	2858	2866	2858
query10	413	213	188	188
query11	5404	1057	930	930
query12	114	72	73	72
query13	1189	449	308	308
query14	6076	2272	2145	2145
query14_1	2034	2023	2022	2022
query15	173	124	115	115
query16	938	363	356	356
query17	809	476	363	363
query18	2322	326	244	244
query19	169	138	109	109
query20	71	72	74	72
query21	210	100	86	86
query22	5570	5399	5407	5399
query23	6659	6406	6232	6232
query23_1	6125	6175	6065	6065
query24	7327	1089	757	757
query24_1	758	787	761	761
query25	433	305	256	256
query26	1237	245	124	124
query27	2776	381	261	261
query28	4710	1510	1497	1497
query29	940	431	337	337
query30	251	157	133	133
query31	819	421	341	341
query32	134	78	77	77
query33	466	223	178	178
query34	984	805	477	477
query35	397	404	358	358
query36	575	576	535	535
query37	118	85	71	71
query38	1051	860	823	823
query39	496	477	508	477
query39_1	474	467	475	467
query40	205	91	82	82
query41	60	57	56	56
query42	78	73	74	73
query43	242	241	208	208
query44	1021	527	539	527
query45	122	106	106	106
query46	810	836	512	512
query47	778	758	719	719
query48	314	298	231	231
query49	551	250	196	196
query50	804	258	192	192
query51	8141	8096	7935	7935
query52	65	66	58	58
query53	184	239	144	144
query54	219	155	146	146
query55	69	58	54	54
query56	186	155	175	155
query57	712	652	642	642
query58	207	158	156	156
query59	1251	1274	1121	1121
query60	218	184	169	169
query61	111	100	112	100
query62	364	216	179	179
query63	171	137	143	137
query64	2697	687	624	624
query65	1705	1649	1632	1632
query66	1892	277	198	198
query67	10203	10119	9865	9865
query68	2745	1192	747	747
query69	328	225	200	200
query70	663	609	614	609
query71	242	167	174	167
query72	2234	1630	1490	1490
query73	657	604	334	334
query74	1574	1246	1151	1151
query75	1174	1120	973	973
query76	2283	697	491	491
query77	250	251	213	213
query78	4186	3960	3297	3297
query79	2171	818	586	586
query80	1595	306	268	268
query81	488	157	138	138
query82	617	131	95	95
query83	276	211	191	191
query84	285	113	89	89
query85	777	347	277	277
query86	391	199	174	174
query87	1013	971	912	912
query88	2775	2099	2090	2090
query89	274	195	176	176
query90	1974	122	133	122
query91	135	117	97	97
query92	81	68	71	68
query93	1347	1074	741	741
query94	640	248	213	213
query95	522	314	217	217
query96	788	610	251	251
query97	1058	1096	1051	1051
query98	143	138	137	137
query99	419	339	308	308
Total cold run time: 177748 ms
Total hot run time: 82619 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.07	0.04	0.04
query3	0.25	0.11	0.11
query4	1.61	0.08	0.10
query5	0.18	0.16	0.16
query6	1.28	0.71	0.69
query7	0.03	0.01	0.00
query8	0.04	0.03	0.02
query9	0.29	0.22	0.21
query10	0.35	0.35	0.35
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.31	0.30	0.31
query14	0.46	0.46	0.45
query15	0.37	0.36	0.35
query16	0.21	0.23	0.22
query17	0.74	0.70	0.69
query18	0.18	0.16	0.16
query19	1.17	1.17	1.16
query20	0.01	0.01	0.01
query21	15.43	0.15	0.11
query22	5.08	0.04	0.05
query23	16.18	0.27	0.10
query24	3.01	0.32	0.25
query25	0.11	0.04	0.04
query26	0.79	0.17	0.13
query27	0.04	0.03	0.03
query28	3.61	0.59	0.27
query29	12.44	3.21	2.56
query30	0.27	0.12	0.12
query31	2.75	0.38	0.18
query32	3.51	0.33	0.23
query33	1.39	1.59	1.43
query34	15.38	2.16	1.83
query35	1.78	1.77	1.76
query36	0.45	0.31	0.28
query37	0.06	0.04	0.04
query38	0.05	0.03	0.03
query39	0.03	0.03	0.03
query40	0.12	0.09	0.07
query41	0.08	0.03	0.02
query42	0.03	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 90.5 s
Total hot run time: 14.84 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.37% (34647/45365)
Line Coverage 61.32% (389545/635229)
Region Coverage 57.71% (327759/567980)
Branch Coverage 58.41% (149156/255369)

@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.37% (34647/45365)
Line Coverage 61.32% (389548/635229)
Region Coverage 57.70% (327708/567980)
Branch Coverage 58.41% (149149/255369)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 19.26% (26/135) 🎉
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.38% (34648/45365)
Line Coverage 61.30% (389415/635229)
Region Coverage 57.66% (327489/567980)
Branch Coverage 58.36% (149046/255369)

@eldenmoon eldenmoon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

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.

4 participants