Skip to content

[refactor](storage) introduce the block transform chain - #66528

Open
csun5285 wants to merge 1 commit into
apache:masterfrom
csun5285:refactor/transform-chain-seams
Open

[refactor](storage) introduce the block transform chain#66528
csun5285 wants to merge 1 commit into
apache:masterfrom
csun5285:refactor/transform-chain-seams

Conversation

@csun5285

@csun5285 csun5285 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Third PR of the #64674 split stack (#65492, #66151). Adds storage/transform/block_transform.{h,cpp}: an immutable BlockTransformChain applied to every flushed block at the two segment_creator seams before the block reaches a segment writer.

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

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

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

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

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

…te/VariantParse/RowStoreFill at the segment_creator seams

Third PR of the apache#64674 split stack (apache#65492, apache#66151). Adds
storage/transform/block_transform.{h,cpp}: an immutable BlockTransformChain
applied to every flushed block at the two segment_creator seams before the
block reaches a segment writer.

- ValidateStage: the schema/width checks both writers duplicated.
- VariantParseStage: the non-partial-update variant parse both writers called.
- RowStoreFillStage: registers a RowStoreColumnGenerator over a COW snapshot
  taken before variant parse, so the row-store column is still built from the
  raw variant representation. The vertical writer pumps it in bounded batches
  (_append_generated_column, 4MB / num_rows_per_block caps); the horizontal
  writer materializes it up front.

Bridges removed by later PRs of the stack: binlog sub-writers get an empty
chain (RowBinlogSegmentWriter still derives rows itself); partial update
loads get [Validate] only (the writers still own the PU fill/parse/row-store
work). Every block goes through exactly one of chain-or-writer per transform.

New guards on previously crashing paths: PU without tablet context ->
NotSupported; PU flushed through add_block (no segment id) -> InternalError.
add_block never carries PU loads (callers: push handler, merger, schema
change).

Equivalence pinned by the golden segment-format tests (apache#65977):
RowStoreAndSegmentCreatorPathsKeepTheirSegmentBytes and
PartialUpdateAndRowBinlogPathsKeepTheirSegmentBytes cover the touched paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@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?

@csun5285

csun5285 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

1 similar comment
@csun5285

csun5285 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 94.32% (216/229) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.79% (26096/43643)
Line Coverage 44.11% (264593/599824)
Region Coverage 39.86% (210742/528735)
Branch Coverage 41.28% (96494/233768)

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added approved Indicates a PR has been approved by one committer. reviewed labels Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 95.45% (210/220) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.88% (32292/42556)
Line Coverage 60.71% (361672/595762)
Region Coverage 57.29% (303910/530469)
Branch Coverage 58.75% (137353/233790)

1 similar comment
@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 95.45% (210/220) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.88% (32292/42556)
Line Coverage 60.71% (361672/595762)
Region Coverage 57.29% (303910/530469)
Branch Coverage 58.75% (137353/233790)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 95.45% (210/220) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.92% (32307/42556)
Line Coverage 60.72% (361756/595762)
Region Coverage 57.30% (303940/530469)
Branch Coverage 58.77% (137387/233790)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 95.45% (210/220) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.92% (32309/42556)
Line Coverage 60.73% (361796/595762)
Region Coverage 57.25% (303677/530469)
Branch Coverage 58.67% (137160/233790)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 95.45% (210/220) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.92% (32310/42556)
Line Coverage 60.73% (361818/595762)
Region Coverage 57.25% (303689/530469)
Branch Coverage 58.67% (137173/233790)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 95.45% (210/220) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.88% (32291/42556)
Line Coverage 60.70% (361654/595762)
Region Coverage 57.23% (303589/530469)
Branch Coverage 58.65% (137116/233790)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17711	4121	4037	4037
q2	2033	315	201	201
q3	10349	1424	811	811
q4	4678	482	346	346
q5	7615	862	563	563
q6	185	176	141	141
q7	763	793	594	594
q8	9318	1529	1616	1529
q9	5374	4104	4063	4063
q10	6767	1601	1352	1352
q11	507	384	324	324
q12	752	579	455	455
q13	18078	3274	2744	2744
q14	263	273	243	243
q15	q16	747	736	663	663
q17	1050	1003	1049	1003
q18	6513	5585	5656	5585
q19	1298	1245	1081	1081
q20	846	708	575	575
q21	5994	2677	2374	2374
q22	433	356	301	301
Total cold run time: 101274 ms
Total hot run time: 28985 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4365	4307	4349	4307
q2	292	319	209	209
q3	4951	5058	4403	4403
q4	2186	2237	1415	1415
q5	4236	4158	4156	4156
q6	232	175	131	131
q7	1706	1595	1801	1595
q8	2703	2295	2157	2157
q9	7475	7592	7311	7311
q10	4281	4240	3961	3961
q11	571	394	365	365
q12	706	724	539	539
q13	3239	3483	2929	2929
q14	298	313	278	278
q15	q16	688	702	649	649
q17	1327	1318	1290	1290
q18	12272	11065	11892	11065
q19	1244	1143	1119	1119
q20	2229	2197	1924	1924
q21	5773	5024	4956	4956
q22	572	484	431	431
Total cold run time: 61346 ms
Total hot run time: 55190 ms

@hello-stephen

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

query5	4329	591	475	475
query6	481	227	205	205
query7	4891	552	347	347
query8	317	168	155	155
query9	8785	4091	4106	4091
query10	508	369	301	301
query11	5777	2176	2030	2030
query12	159	103	94	94
query13	1272	634	446	446
query14	6080	4309	4085	4085
query14_1	3855	3872	3840	3840
query15	207	196	179	179
query16	1000	474	460	460
query17	946	698	575	575
query18	2451	484	330	330
query19	198	179	144	144
query20	101	99	105	99
query21	227	156	132	132
query22	13067	13012	12760	12760
query23	15692	15071	14644	14644
query23_1	14646	14951	14545	14545
query24	7487	1692	1228	1228
query24_1	1267	1264	1271	1264
query25	510	426	382	382
query26	1315	365	209	209
query27	2605	621	387	387
query28	4548	2043	2064	2043
query29	1037	604	474	474
query30	345	274	222	222
query31	1189	1116	1090	1090
query32	111	61	61	61
query33	520	315	239	239
query34	1205	1154	645	645
query35	730	763	639	639
query36	777	789	732	732
query37	154	107	97	97
query38	1837	1768	1670	1670
query39	831	811	810	810
query39_1	794	803	779	779
query40	258	165	140	140
query41	69	67	63	63
query42	94	94	93	93
query43	335	326	287	287
query44	1523	779	771	771
query45	191	176	173	173
query46	1086	1259	730	730
query47	1531	1518	1437	1437
query48	415	418	292	292
query49	606	400	319	319
query50	1068	431	375	375
query51	10759	10637	10679	10637
query52	86	90	76	76
query53	260	292	203	203
query54	283	230	217	217
query55	77	75	69	69
query56	318	281	313	281
query57	1014	989	909	909
query58	280	259	264	259
query59	1564	1612	1383	1383
query60	327	296	270	270
query61	181	184	179	179
query62	399	332	272	272
query63	240	203	210	203
query64	3008	1160	967	967
query65	3867	3804	3763	3763
query66	1865	479	381	381
query67	28094	28100	28051	28051
query68	3150	1636	1025	1025
query69	417	318	287	287
query70	892	756	785	756
query71	391	359	322	322
query72	3170	2626	2315	2315
query73	813	754	441	441
query74	4639	4462	4316	4316
query75	2377	2355	2019	2019
query76	2361	1166	804	804
query77	365	373	269	269
query78	11175	11139	10687	10687
query79	1442	1159	728	728
query80	1272	564	475	475
query81	524	322	287	287
query82	642	176	139	139
query83	381	321	306	306
query84	317	158	129	129
query85	965	607	522	522
query86	410	233	220	220
query87	1983	1957	1835	1835
query88	3825	2889	2811	2811
query89	414	344	287	287
query90	1904	214	201	201
query91	202	196	168	168
query92	65	64	56	56
query93	1719	1506	1031	1031
query94	717	373	329	329
query95	784	594	487	487
query96	1131	789	362	362
query97	2465	2453	2326	2326
query98	205	194	184	184
query99	733	722	602	602
Total cold run time: 254077 ms
Total hot run time: 167238 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.09	0.04	0.05
query3	0.26	0.14	0.13
query4	1.60	0.14	0.13
query5	0.23	0.22	0.23
query6	1.15	0.79	0.80
query7	0.04	0.00	0.00
query8	0.06	0.04	0.03
query9	0.38	0.30	0.31
query10	0.53	0.53	0.54
query11	0.19	0.14	0.13
query12	0.18	0.15	0.14
query13	0.45	0.45	0.46
query14	1.01	0.99	0.98
query15	0.59	0.57	0.57
query16	0.31	0.33	0.32
query17	1.06	1.07	1.09
query18	0.22	0.19	0.20
query19	2.05	1.92	1.92
query20	0.02	0.01	0.02
query21	15.48	0.22	0.13
query22	4.76	0.06	0.06
query23	16.13	0.31	0.12
query24	3.04	0.44	0.31
query25	0.12	0.05	0.05
query26	0.73	0.20	0.16
query27	0.03	0.04	0.03
query28	3.53	0.80	0.35
query29	12.48	4.07	3.18
query30	0.27	0.16	0.16
query31	2.78	0.54	0.32
query32	3.22	0.58	0.48
query33	3.26	3.17	3.16
query34	15.58	3.91	3.27
query35	3.25	3.21	3.19
query36	0.55	0.45	0.41
query37	0.09	0.06	0.07
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.16	0.15	0.14
query41	0.09	0.03	0.02
query42	0.03	0.03	0.03
query43	0.05	0.03	0.03
Total cold run time: 96.14 s
Total hot run time: 23.68 s

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

LGTM

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