Skip to content

[fix](maxcompute) Estimate write block size from Arrow buffers, not per-row serialization#64612

Merged
Gabriel39 merged 2 commits into
apache:masterfrom
hubgeter:fix-mc-row-master
Jun 24, 2026
Merged

[fix](maxcompute) Estimate write block size from Arrow buffers, not per-row serialization#64612
Gabriel39 merged 2 commits into
apache:masterfrom
hubgeter:fix-mc-row-master

Conversation

@hubgeter

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Problem Summary:
The old per-row estimateSingleRowPayloadBytes ZSTD-serialized a one-row batch for every row (CPU-heavy and ~25x oversized); sum FieldVector.getBufferSize() over the whole batch instead, and rotate the block lazily.

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

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

@hubgeter

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17817	3981	3954	3954
q2	1993	297	187	187
q3	10339	1392	830	830
q4	4680	474	338	338
q5	7553	874	561	561
q6	190	169	139	139
q7	775	811	632	632
q8	9333	1595	1511	1511
q9	6206	4520	4476	4476
q10	6796	1796	1527	1527
q11	436	275	244	244
q12	640	432	301	301
q13	18108	3467	2779	2779
q14	263	260	243	243
q15	q16	778	789	706	706
q17	1022	887	1028	887
q18	6744	5771	5558	5558
q19	1360	1235	1092	1092
q20	462	401	262	262
q21	5905	2642	2401	2401
q22	423	354	296	296
Total cold run time: 101823 ms
Total hot run time: 28924 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4326	4260	4244	4244
q2	336	349	223	223
q3	4624	4944	4369	4369
q4	2044	2151	1371	1371
q5	4383	4294	4268	4268
q6	231	179	124	124
q7	1753	1688	1859	1688
q8	2531	2091	2117	2091
q9	7839	7899	7843	7843
q10	4816	4726	4301	4301
q11	592	405	385	385
q12	734	746	530	530
q13	3414	3550	3064	3064
q14	317	304	281	281
q15	q16	738	741	640	640
q17	1341	1325	1317	1317
q18	7985	7328	7335	7328
q19	1110	1085	1109	1085
q20	2244	2201	1949	1949
q21	5241	4579	4434	4434
q22	528	450	407	407
Total cold run time: 57127 ms
Total hot run time: 51942 ms

@hello-stephen

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

query5	4311	644	477	477
query6	437	194	168	168
query7	4928	520	300	300
query8	356	208	205	205
query9	8746	4064	4046	4046
query10	434	310	250	250
query11	5948	2337	2140	2140
query12	157	100	100	100
query13	1268	612	427	427
query14	6392	5437	5042	5042
query14_1	4419	4427	4407	4407
query15	208	199	177	177
query16	1045	464	433	433
query17	1123	708	593	593
query18	2706	468	351	351
query19	204	188	144	144
query20	113	111	105	105
query21	216	144	124	124
query22	13612	13502	13327	13327
query23	17860	16601	16241	16241
query23_1	16356	16313	16352	16313
query24	7592	1767	1301	1301
query24_1	1332	1337	1328	1328
query25	564	459	413	413
query26	1325	329	167	167
query27	2612	611	339	339
query28	4413	2040	2039	2039
query29	1105	638	497	497
query30	318	251	199	199
query31	1111	1059	965	965
query32	115	60	59	59
query33	519	330	251	251
query34	1177	1141	674	674
query35	748	815	673	673
query36	1403	1383	1252	1252
query37	151	103	85	85
query38	3204	3161	3049	3049
query39	932	923	900	900
query39_1	878	861	873	861
query40	221	120	96	96
query41	63	60	59	59
query42	94	94	92	92
query43	316	320	277	277
query44	1412	768	777	768
query45	203	189	176	176
query46	1041	1221	711	711
query47	2364	2376	2186	2186
query48	357	401	301	301
query49	608	454	342	342
query50	955	353	262	262
query51	4400	4315	4236	4236
query52	85	89	79	79
query53	248	267	196	196
query54	257	213	197	197
query55	86	75	71	71
query56	235	223	210	210
query57	1428	1423	1295	1295
query58	239	218	205	205
query59	1564	1641	1429	1429
query60	274	240	229	229
query61	149	149	150	149
query62	715	658	590	590
query63	232	187	206	187
query64	2301	760	604	604
query65	4865	4768	4769	4768
query66	1678	457	343	343
query67	29664	29617	29971	29617
query68	3156	1613	959	959
query69	443	298	271	271
query70	1055	953	970	953
query71	289	236	209	209
query72	2887	2639	2272	2272
query73	866	773	461	461
query74	5122	4973	4778	4778
query75	2630	2589	2207	2207
query76	2326	1167	771	771
query77	343	371	287	287
query78	12384	12496	11792	11792
query79	2638	1275	792	792
query80	1686	486	372	372
query81	520	281	239	239
query82	580	150	120	120
query83	318	270	247	247
query84	257	143	112	112
query85	873	502	414	414
query86	428	307	286	286
query87	3386	3334	3255	3255
query88	3659	2775	2741	2741
query89	424	381	330	330
query90	1890	184	178	178
query91	172	163	131	131
query92	58	55	56	55
query93	1726	1424	905	905
query94	708	330	303	303
query95	658	472	345	345
query96	1098	768	381	381
query97	2706	2692	2556	2556
query98	214	207	199	199
query99	1184	1182	1031	1031
Total cold run time: 263411 ms
Total hot run time: 175241 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.10	0.04	0.05
query3	0.26	0.13	0.14
query4	1.61	0.14	0.14
query5	0.24	0.23	0.22
query6	1.24	1.08	1.09
query7	0.04	0.01	0.01
query8	0.07	0.04	0.04
query9	0.43	0.33	0.30
query10	0.55	0.56	0.56
query11	0.20	0.14	0.13
query12	0.19	0.14	0.14
query13	0.47	0.48	0.48
query14	1.01	1.00	1.02
query15	0.63	0.60	0.60
query16	0.33	0.35	0.31
query17	1.16	1.11	1.10
query18	0.22	0.20	0.20
query19	2.07	1.90	1.99
query20	0.02	0.01	0.01
query21	15.43	0.23	0.13
query22	4.85	0.05	0.06
query23	16.14	0.31	0.12
query24	3.01	0.43	0.32
query25	0.12	0.04	0.05
query26	0.73	0.21	0.15
query27	0.04	0.04	0.04
query28	3.51	0.88	0.55
query29	12.46	4.27	3.48
query30	0.27	0.15	0.15
query31	2.77	0.60	0.31
query32	3.22	0.60	0.49
query33	3.26	3.16	3.31
query34	15.75	4.25	3.52
query35	3.53	3.55	3.53
query36	0.55	0.45	0.43
query37	0.09	0.06	0.06
query38	0.05	0.04	0.03
query39	0.04	0.03	0.03
query40	0.18	0.16	0.15
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 97.01 s
Total hot run time: 25.24 s

@Gabriel39

Copy link
Copy Markdown
Contributor

/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.

Superseded by review 4540816359, which contains the corrected inline anchor for the same finding. The misplaced inline comment from this review was deleted.

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

Requesting changes for one correctness issue in the MaxCompute writer.

Critical checkpoint conclusions:

  • Goal/test coverage: The PR intends to replace per-row serialized size estimation with batch buffer-size estimation. The faster estimate itself is clear, but the current control flow no longer proves the write-block threshold is respected. I did not find a test covering rollover when an incoming JNI batch pushes a non-empty MaxCompute block past mc.write_max_block_bytes.
  • Scope/focus: The change is localized to MaxComputeJniWriter.java, but it removes the only intra-batch row-range splitting in the MaxCompute write path.
  • Concurrency/lifecycle/config/compatibility: No new concurrency or lifecycle issue found. No new config item is added. The existing mc.write_max_block_bytes contract is affected by the new rotation timing.
  • Parallel paths: BE forwards each materialized block to the Java writer through VJniFormatTransformer/VMCPartitionWriter; I did not find an upstream byte-splitting path that compensates for this removal.
  • Tests/style: git diff --check passes for the changed file. I did not run the MaxCompute connector test suite in this review environment.

User focus: no additional user-provided focus was supplied.

Subagent conclusions: OR-1 was accepted and became the inline comment below. TSC-1 reported the same issue and was merged as a duplicate of OR-1/M-1. Convergence round 1 ended with both live subagents replying NO_NEW_VALUABLE_FINDINGS for the same ledger and proposed comment set.

// Discard bytes while allowing WriteChannel to track payload size.
long batchBytes;
try (VectorSchemaRoot root = buildRowRangeRoot(inputTable, numCols, 0, numRows)) {
batchBytes = estimateBatchPayloadBytes(root);

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.

This no longer enforces mc.write_max_block_bytes for the block being written. writeBatch only rotates when the current block is already over the limit, then estimates batchBytes, writes the whole VectorSchemaRoot, and adds the bytes afterward. With a 64MB threshold, a current block at 60MB and a 20MB incoming JNI block will be committed as an 80MB MaxCompute block; rotation happens only before the next batch. The removed code split the input row range and rotated before appending rows that would overflow the current block, and the BE side does not do any byte splitting before calling this Java writer. Please check currentBlockWrittenBytes + batchBytes before writing and split oversized incoming batches into row ranges, preserving the previous single-row oversize fallback.

…er-row serialization

The old per-row estimateSingleRowPayloadBytes ZSTD-serialized a one-row batch for
every row (CPU-heavy and ~25x oversized); sum FieldVector.getBufferSize() over the
whole batch instead, and rotate the block lazily.
@hubgeter hubgeter force-pushed the fix-mc-row-master branch from 2fd10f3 to eccadf7 Compare June 23, 2026 07:22
@hubgeter

Copy link
Copy Markdown
Contributor Author

/review

@hubgeter

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17635	4028	4023	4023
q2	2025	310	186	186
q3	10296	1436	821	821
q4	4678	465	341	341
q5	7515	856	583	583
q6	173	169	136	136
q7	789	830	624	624
q8	9353	1594	1619	1594
q9	5568	4531	4559	4531
q10	6733	1783	1527	1527
q11	441	272	238	238
q12	636	419	288	288
q13	18203	3461	2789	2789
q14	274	262	247	247
q15	q16	792	775	710	710
q17	989	908	969	908
q18	6945	5899	5614	5614
q19	1312	1260	1027	1027
q20	454	383	269	269
q21	6029	2669	2316	2316
q22	429	362	297	297
Total cold run time: 101269 ms
Total hot run time: 29069 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4330	4253	4268	4253
q2	327	351	218	218
q3	4535	5018	4402	4402
q4	2082	2108	1380	1380
q5	4421	4319	4316	4316
q6	232	180	130	130
q7	1729	1660	1862	1660
q8	2642	2194	2201	2194
q9	8337	8491	8122	8122
q10	4841	4786	4341	4341
q11	565	416	400	400
q12	756	784	562	562
q13	3260	3644	2942	2942
q14	296	307	280	280
q15	q16	722	724	653	653
q17	1358	1329	1326	1326
q18	7878	7327	7184	7184
q19	1158	1168	1113	1113
q20	2230	2244	1949	1949
q21	5230	4552	4421	4421
q22	506	474	396	396
Total cold run time: 57435 ms
Total hot run time: 52242 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.

Requesting changes for one remaining correctness/performance issue in the MaxCompute writer split path.

Critical checkpoint conclusions:

  • Goal and tests: the PR aims to reduce MaxCompute writer block-size estimation cost while preserving mc.write_max_block_bytes splitting. The helper tests cover findPartialRowRange, but they do not prove the actual writeBatch path avoids materializing an oversized incoming block before splitting.
  • Scope: the code change is localized to MaxComputeJniWriter plus one unit test, but the new fast-path estimate is placed before a bounded range is chosen.
  • Concurrency and lifecycle: no new concurrency was introduced; the existing open/write/close lifecycle and commit-message collection remain the relevant lifecycle path.
  • Configuration and compatibility: no new config or wire/storage format is added. The existing mc.write_max_block_bytes setting remains the behavioral contract affected here.
  • Parallel paths: BE sends each block to the Java JNI writer through VJniFormatTransformer.write() without doing byte-based splitting first, so Java-side writeBatch must bound the Arrow materialization itself.
  • Tests and CI: I did not run Maven/build tests because thirdparty/installed/bin/protoc is missing in this checkout, and fe/AGENTS.md says to stop build setup in that case.
  • Observability, transactions, persistence, data visibility: no new persistence or transaction-log path is modified. The issue can fail before MaxCompute commit/close, so additional observability is secondary to fixing the allocation order.
  • Performance: the accepted inline issue is a peak allocation/copying regression for large BE blocks that need splitting.

Subagent conclusions: optimizer-rewrite reported no new optimizer/rewrite findings. tests-session-config proposed TSC-1, which was independently verified and accepted as MAIN-1. The existing block-overflow GitHub thread was treated as already-known context, not duplicated. Convergence round 1 ended with both subagents returning NO_NEW_VALUABLE_FINDINGS for the final ledger/comment set.

private void writeRowsWithRowChecks(VectorTable inputTable, int numRows, int numCols) throws IOException {
private void writeBatch(VectorTable inputTable, int numRows, int numCols) throws IOException {
int rowStart = 0;
while (rowStart < numRows) {

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.

The split path still builds an Arrow root for the entire remaining JNI block before it knows whether the block fits. rowEnd is set to numRows here and buildRowRangeRoot(inputTable, numCols, rowStart, rowEnd) allocates/fills vectors for every remaining row before estimateBatchPayloadBytes can fall through to findPartialRowRange. Since VJniFormatTransformer.write() passes the whole BE block to Java in one VectorTable, a large incoming block that should be split by mc.write_max_block_bytes still has to be copied into one full-size VectorSchemaRoot first, so this fix can still hit the same heap pressure it is trying to avoid. Please choose the bounded row range before materializing Arrow vectors, and add a writeBatch-level test/injection that fails if an oversized input first requests rowStart..numRows.

@hello-stephen

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

query5	4318	637	451	451
query6	429	203	172	172
query7	4870	514	303	303
query8	361	204	197	197
query9	8766	4000	4003	4000
query10	432	314	250	250
query11	5920	2332	2143	2143
query12	155	104	100	100
query13	1272	608	441	441
query14	6374	5379	5036	5036
query14_1	4364	4361	4359	4359
query15	203	197	176	176
query16	1052	459	454	454
query17	1142	709	580	580
query18	2520	475	338	338
query19	209	185	143	143
query20	113	107	108	107
query21	213	143	115	115
query22	13592	13550	13353	13353
query23	17356	16568	16084	16084
query23_1	16154	16377	16224	16224
query24	7604	1812	1316	1316
query24_1	1324	1328	1327	1327
query25	571	465	415	415
query26	1306	321	168	168
query27	2670	551	339	339
query28	4449	2046	2014	2014
query29	1088	638	500	500
query30	314	239	204	204
query31	1131	1068	946	946
query32	98	62	61	61
query33	535	326	258	258
query34	1237	1201	662	662
query35	741	751	670	670
query36	1371	1429	1202	1202
query37	155	107	87	87
query38	1871	1704	1667	1667
query39	916	921	915	915
query39_1	877	879	861	861
query40	224	120	99	99
query41	63	64	60	60
query42	85	86	88	86
query43	324	324	278	278
query44	1421	782	775	775
query45	192	181	173	173
query46	1094	1208	754	754
query47	2423	2362	2219	2219
query48	404	409	303	303
query49	619	450	360	360
query50	1018	346	258	258
query51	4378	4373	4403	4373
query52	84	81	68	68
query53	245	267	191	191
query54	261	213	225	213
query55	72	69	65	65
query56	232	211	221	211
query57	1443	1420	1337	1337
query58	243	213	206	206
query59	1570	1663	1476	1476
query60	281	246	221	221
query61	152	152	146	146
query62	693	641	584	584
query63	225	191	189	189
query64	2490	775	638	638
query65	4898	4783	4740	4740
query66	1778	458	346	346
query67	29703	29686	29628	29628
query68	3186	1554	1045	1045
query69	406	306	265	265
query70	1047	946	1009	946
query71	288	253	213	213
query72	2970	2642	2329	2329
query73	815	766	453	453
query74	5103	4948	4783	4783
query75	2607	2582	2232	2232
query76	2327	1186	799	799
query77	350	380	283	283
query78	12564	12555	11807	11807
query79	1384	1188	819	819
query80	572	491	379	379
query81	453	282	244	244
query82	562	162	121	121
query83	349	280	246	246
query84	267	153	115	115
query85	873	520	422	422
query86	355	317	309	309
query87	1850	1821	1758	1758
query88	3714	2805	2776	2776
query89	422	385	332	332
query90	1949	179	172	172
query91	170	166	132	132
query92	63	62	58	58
query93	1456	1448	926	926
query94	542	349	321	321
query95	686	390	356	356
query96	1115	770	334	334
query97	2732	2699	2584	2584
query98	224	213	224	213
query99	1168	1148	1042	1042
Total cold run time: 257737 ms
Total hot run time: 172778 ms

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17750	4122	4162	4122
q2	1977	308	204	204
q3	10383	1376	828	828
q4	4680	466	337	337
q5	7479	851	579	579
q6	186	182	139	139
q7	788	835	627	627
q8	9367	1509	1565	1509
q9	5911	4529	4477	4477
q10	6803	1834	1550	1550
q11	440	281	246	246
q12	654	427	299	299
q13	18160	3341	2756	2756
q14	273	261	240	240
q15	q16	779	778	709	709
q17	1842	1166	675	675
q18	6824	5790	5430	5430
q19	1397	1294	1056	1056
q20	469	403	264	264
q21	5659	2726	2180	2180
q22	425	361	299	299
Total cold run time: 102246 ms
Total hot run time: 28526 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4506	4395	4396	4395
q2	329	357	227	227
q3	4553	4974	4443	4443
q4	2102	2169	1394	1394
q5	4504	4349	4348	4348
q6	233	184	137	137
q7	1731	1968	1759	1759
q8	2585	2284	2248	2248
q9	8197	8211	8129	8129
q10	4828	4753	4313	4313
q11	592	462	418	418
q12	742	753	539	539
q13	3447	3560	2963	2963
q14	315	315	285	285
q15	q16	704	771	676	676
q17	1394	1337	1358	1337
q18	8256	7361	6788	6788
q19	1091	1070	1123	1070
q20	2223	2213	1953	1953
q21	5300	4683	4580	4580
q22	550	468	391	391
Total cold run time: 58182 ms
Total hot run time: 52393 ms

@hello-stephen

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

query5	4308	621	471	471
query6	435	187	175	175
query7	4840	562	309	309
query8	369	218	194	194
query9	8740	4150	4103	4103
query10	434	300	258	258
query11	5958	2314	2119	2119
query12	148	105	98	98
query13	1253	600	402	402
query14	6416	5366	5078	5078
query14_1	4402	4424	4401	4401
query15	215	199	176	176
query16	1015	465	406	406
query17	1153	714	593	593
query18	2459	492	362	362
query19	211	188	168	168
query20	116	115	110	110
query21	219	138	120	120
query22	13592	13576	13254	13254
query23	17430	16492	16169	16169
query23_1	16672	16554	16398	16398
query24	8103	1817	1341	1341
query24_1	1332	1347	1279	1279
query25	596	495	360	360
query26	1305	325	169	169
query27	2746	557	326	326
query28	4432	2024	1979	1979
query29	1050	608	480	480
query30	307	223	198	198
query31	1128	1073	955	955
query32	115	62	57	57
query33	539	301	252	252
query34	1209	1171	658	658
query35	754	766	669	669
query36	1381	1397	1264	1264
query37	148	117	89	89
query38	1888	1748	1671	1671
query39	931	921	911	911
query39_1	877	875	870	870
query40	217	125	100	100
query41	65	62	61	61
query42	88	86	87	86
query43	327	330	287	287
query44	1495	772	770	770
query45	193	183	177	177
query46	1091	1251	765	765
query47	2358	2344	2229	2229
query48	404	424	303	303
query49	623	443	336	336
query50	985	368	262	262
query51	4453	4398	4357	4357
query52	106	81	68	68
query53	240	264	191	191
query54	262	226	190	190
query55	73	70	65	65
query56	236	239	230	230
query57	1452	1404	1328	1328
query58	241	213	209	209
query59	1541	1681	1398	1398
query60	282	244	221	221
query61	148	150	150	150
query62	692	650	589	589
query63	228	189	188	188
query64	2540	764	594	594
query65	4866	4791	4708	4708
query66	1790	453	344	344
query67	29745	29668	29527	29527
query68	3161	1544	944	944
query69	388	302	273	273
query70	1086	980	902	902
query71	295	234	216	216
query72	2926	2590	2342	2342
query73	844	824	415	415
query74	5146	4981	4770	4770
query75	2624	2587	2243	2243
query76	2308	1206	813	813
query77	354	386	278	278
query78	12364	12381	11791	11791
query79	1229	1142	775	775
query80	503	474	380	380
query81	451	278	240	240
query82	229	151	122	122
query83	274	275	248	248
query84	264	148	116	116
query85	821	507	407	407
query86	324	299	276	276
query87	1817	1819	1775	1775
query88	3746	2802	2809	2802
query89	410	377	326	326
query90	2140	187	178	178
query91	170	161	131	131
query92	63	60	53	53
query93	1508	1446	924	924
query94	550	396	306	306
query95	674	452	369	369
query96	1085	794	333	333
query97	2713	2700	2527	2527
query98	219	207	202	202
query99	1169	1149	1026	1026
Total cold run time: 258254 ms
Total hot run time: 172100 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.12	0.05	0.05
query3	0.26	0.14	0.12
query4	1.61	0.14	0.15
query5	0.24	0.22	0.22
query6	1.25	1.03	1.03
query7	0.04	0.01	0.01
query8	0.05	0.04	0.04
query9	0.38	0.32	0.31
query10	0.56	0.58	0.57
query11	0.18	0.14	0.15
query12	0.19	0.14	0.14
query13	0.47	0.47	0.48
query14	1.02	1.01	1.01
query15	0.65	0.58	0.61
query16	0.31	0.34	0.33
query17	1.12	1.06	1.09
query18	0.23	0.22	0.22
query19	2.13	1.98	1.94
query20	0.02	0.01	0.01
query21	15.43	0.21	0.14
query22	4.94	0.05	0.05
query23	16.13	0.32	0.12
query24	3.03	0.39	0.31
query25	0.13	0.06	0.04
query26	0.72	0.22	0.16
query27	0.04	0.04	0.04
query28	3.53	0.94	0.53
query29	12.51	4.38	3.45
query30	0.29	0.16	0.15
query31	2.77	0.59	0.32
query32	3.22	0.60	0.48
query33	3.26	3.22	3.22
query34	15.66	4.18	3.50
query35	3.54	3.57	3.53
query36	0.55	0.43	0.45
query37	0.09	0.06	0.06
query38	0.06	0.03	0.03
query39	0.04	0.03	0.03
query40	0.18	0.15	0.14
query41	0.08	0.03	0.03
query42	0.04	0.02	0.02
query43	0.04	0.04	0.03
Total cold run time: 97.12 s
Total hot run time: 25.2 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage `` 🎉
Increment coverage report
Complete coverage report

@hubgeter

Copy link
Copy Markdown
Contributor Author

/review

@hubgeter

Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at 2:55 PM.
Workflow run: https://github.com/apache/doris/actions/runs/28034557112

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17885	4104	4150	4104
q2	1985	312	199	199
q3	10335	1443	845	845
q4	4677	466	348	348
q5	7521	852	568	568
q6	201	179	144	144
q7	773	855	614	614
q8	9959	1771	1653	1653
q9	6234	4504	4533	4504
q10	6761	1805	1528	1528
q11	445	272	248	248
q12	662	442	308	308
q13	18085	3521	2781	2781
q14	280	264	244	244
q15	q16	796	775	717	717
q17	1970	1134	674	674
q18	6979	5739	5509	5509
q19	1537	1326	1063	1063
q20	494	409	270	270
q21	5743	2660	2419	2419
q22	437	364	313	313
Total cold run time: 103759 ms
Total hot run time: 29053 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4524	4409	4458	4409
q2	329	372	237	237
q3	4645	4971	4485	4485
q4	2049	2289	1451	1451
q5	4587	4474	4437	4437
q6	256	351	179	179
q7	2237	1823	1679	1679
q8	2685	2312	2308	2308
q9	8174	8160	8236	8160
q10	4830	4739	4740	4739
q11	618	447	429	429
q12	778	780	588	588
q13	3326	3777	2951	2951
q14	299	300	276	276
q15	q16	730	738	679	679
q17	1395	1379	1340	1340
q18	8230	7484	6904	6904
q19	1115	1074	1083	1074
q20	2278	2240	1962	1962
q21	5473	4837	4596	4596
q22	537	471	428	428
Total cold run time: 59095 ms
Total hot run time: 53311 ms

@hello-stephen

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

query5	4313	634	488	488
query6	444	187	173	173
query7	4831	529	283	283
query8	373	224	195	195
query9	8761	4080	4064	4064
query10	431	324	262	262
query11	5908	2370	2146	2146
query12	150	96	98	96
query13	1247	617	422	422
query14	6450	5532	5175	5175
query14_1	4604	4674	4491	4491
query15	208	199	172	172
query16	1008	443	439	439
query17	978	706	578	578
query18	2452	480	342	342
query19	194	193	141	141
query20	107	108	104	104
query21	219	144	115	115
query22	13612	13580	13418	13418
query23	17265	16558	16225	16225
query23_1	16254	16328	16358	16328
query24	7755	1812	1350	1350
query24_1	1326	1325	1309	1309
query25	570	470	401	401
query26	1327	336	174	174
query27	2673	565	346	346
query28	4496	2025	2044	2025
query29	1102	623	500	500
query30	322	239	203	203
query31	1116	1089	963	963
query32	116	64	69	64
query33	539	331	267	267
query34	1169	1217	681	681
query35	764	783	689	689
query36	1363	1378	1200	1200
query37	161	109	91	91
query38	1895	1720	1649	1649
query39	908	921	900	900
query39_1	872	864	898	864
query40	224	134	109	109
query41	73	68	68	68
query42	90	92	92	92
query43	340	353	296	296
query44	1484	793	793	793
query45	201	189	179	179
query46	1076	1194	739	739
query47	2327	2343	2211	2211
query48	405	404	314	314
query49	639	469	358	358
query50	1003	365	268	268
query51	4429	4422	4334	4334
query52	84	94	72	72
query53	250	274	196	196
query54	312	233	206	206
query55	74	70	63	63
query56	247	221	220	220
query57	1430	1402	1297	1297
query58	241	222	215	215
query59	1670	1688	1479	1479
query60	274	240	214	214
query61	149	147	142	142
query62	682	655	580	580
query63	232	190	192	190
query64	2547	744	600	600
query65	4893	4783	4787	4783
query66	1784	466	333	333
query67	29831	29581	29551	29551
query68	3176	1594	986	986
query69	411	306	265	265
query70	1118	965	992	965
query71	294	245	221	221
query72	2853	2605	2402	2402
query73	878	783	438	438
query74	5127	4959	4748	4748
query75	2626	2593	2230	2230
query76	2304	1215	824	824
query77	355	393	277	277
query78	12528	12517	11850	11850
query79	1407	1199	771	771
query80	1267	482	383	383
query81	530	283	243	243
query82	658	156	121	121
query83	325	270	250	250
query84	304	147	116	116
query85	881	529	418	418
query86	425	315	297	297
query87	1842	1836	1785	1785
query88	3734	2803	2811	2803
query89	438	377	338	338
query90	1891	188	188	188
query91	169	161	132	132
query92	67	62	57	57
query93	1582	1479	1012	1012
query94	718	351	274	274
query95	679	369	450	369
query96	1071	803	339	339
query97	2711	2688	2553	2553
query98	216	207	203	203
query99	1166	1160	1029	1029
Total cold run time: 259467 ms
Total hot run time: 173106 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.10	0.06	0.05
query3	0.26	0.14	0.14
query4	1.61	0.14	0.14
query5	0.24	0.23	0.23
query6	1.26	1.03	1.10
query7	0.04	0.00	0.00
query8	0.06	0.04	0.04
query9	0.41	0.33	0.32
query10	0.56	0.59	0.59
query11	0.19	0.14	0.14
query12	0.18	0.15	0.14
query13	0.46	0.48	0.49
query14	1.02	0.99	1.00
query15	0.62	0.60	0.59
query16	0.32	0.32	0.33
query17	1.08	1.15	1.09
query18	0.23	0.21	0.21
query19	2.07	1.91	2.01
query20	0.01	0.02	0.01
query21	15.43	0.21	0.14
query22	4.95	0.06	0.05
query23	16.15	0.32	0.12
query24	2.90	0.41	0.32
query25	0.11	0.06	0.04
query26	0.72	0.22	0.16
query27	0.04	0.04	0.04
query28	3.52	0.91	0.52
query29	12.52	4.32	3.46
query30	0.27	0.14	0.15
query31	2.77	0.60	0.32
query32	3.22	0.60	0.50
query33	3.18	3.21	3.22
query34	15.51	4.21	3.54
query35	3.54	3.52	3.57
query36	0.56	0.44	0.42
query37	0.09	0.07	0.07
query38	0.05	0.04	0.04
query39	0.03	0.03	0.02
query40	0.19	0.16	0.17
query41	0.09	0.03	0.02
query42	0.03	0.02	0.02
query43	0.04	0.04	0.03
Total cold run time: 96.63 s
Total hot run time: 25.28 s

@Gabriel39

Copy link
Copy Markdown
Contributor

/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 the current diff for PR 64612.

I did not find any new non-duplicate inline issue beyond the two existing MaxCompute block-size/materialization threads:

  • discussion_r3449574050 covers enforcing mc.write_max_block_bytes against the current block before writing and splitting incoming batches.
  • discussion_r3458025412 covers avoiding oversized Arrow-root materialization before determining a bounded row range, plus the missing writeBatch-level oversized-input test/injection.

Code-review checkpoint conclusions:

  • Goal/test: the PR is focused on MaxCompute JNI writer block splitting and adds unit coverage for helper logic, but the existing threads still own the remaining writeBatch-level behavioral concerns.
  • Scope/focus: changed surface is limited to MaxComputeJniWriter and its unit test.
  • Concurrency/lifecycle: no new concurrent path or special static lifecycle was introduced; writer state remains per writer instance.
  • Configuration/session propagation: no new config was added; mc.write_max_block_bytes continues through catalog properties into BE writer params and then the Java writer.
  • Compatibility/persistence/transactions: no storage format, function symbol, edit log, or transaction persistence change was introduced.
  • Parallel paths: BE sends whole blocks through VJniFormatTransformer; no C++ byte-splitting path exists, matching the existing review context.
  • Tests/results: new tests cover helper methods, not the full writeBatch path noted in the existing thread. I could not run the targeted Maven test locally because this runner lacks thirdparty/installed/bin/thrift.
  • Observability/performance: no new observability requirement found; performance risk remains the existing oversized-materialization discussion.

User focus: no additional user-provided focus was supplied.

Subagent conclusions: optimizer-rewrite found no applicable optimizer/rewrite candidate. tests-session-config found no new non-duplicate candidate and confirmed the missing writeBatch-level oversized-input coverage is already covered by the existing thread. Convergence round 1 ended with both subagents reporting NO_NEW_VALUABLE_FINDINGS.

@Gabriel39 Gabriel39 merged commit 6bf4327 into apache:master Jun 24, 2026
33 of 34 checks passed
github-actions Bot pushed a commit that referenced this pull request Jun 24, 2026
…er-row serialization (#64612)

The old per-row estimateSingleRowPayloadBytes ZSTD-serialized a one-row
batch for every row (CPU-heavy and ~25x oversized); sum
FieldVector.getBufferSize() over the whole batch instead, and rotate the
block lazily.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants