Skip to content

[perf](load) introduce sequential prefetch for FileScannerV2 CSV reads - #69716

Merged
sollhui merged 3 commits into
apache:masterfrom
sollhui:fix/v2-csv-sequential-prefetch
Oct 29, 2026
Merged

sollhui merged 3 commits into
apache:masterfrom
sollhui:fix/v2-csv-sequential-prefetch

Conversation

@sollhui

@sollhui sollhui commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: #69333

Problem Summary:

After CSV ingestion switched to FileScannerV2, DelimitedTextReader opened remote files directly through FileFactory, bypassing the sequential prefetch used by the original CSV reader. S3 reads therefore block the scanner instead of overlapping remote I/O with CSV parsing.

Restore DelegateReader::create_file_reader(SEQUENTIAL) in the shared CSV/Text reader, passing the shared IOContext and adjusted split range. Unknown-size first splits use an end sentinel bounded by the physical file size. Tracing remains outside the prefetch layer, and shared stream-load pipes retain their existing ownership and cancellation behavior.

To safely integrate asynchronous reads with V2 scanner statistics:

  • Each prefetch buffer owns its cache statistics and an IOContext snapshot. The consumer merges completed statistics exactly once before consuming, reusing or closing the buffer. Workers never update the scanner's cache-statistics object.
  • Close drains active reads even after a foreground timeout, keeping borrowed scanner state alive until I/O completes. Queued tasks observe CLOSED and skip reading. Cleanup can consequently take longer than buffered_reader_read_timeout_ms while an underlying request is outstanding.
  • The ring modulus uses allocated capacity: a 6 MiB setting allocates one 4 MiB buffer and wraps at 4 MiB. Settings below 4 MiB use one buffer; the 16 MiB default is unchanged.
  • CSV/Text filesystem readers close before collecting prefetch profile counters. Repeated close does not publish counters twice.

Performance

For the TPC-H dataset load benchmark, elapsed time decreased from 2617.33 s to 1696.06 s, saving 921.27 s. This is a 35.2% reduction in load time, or approximately 1.54x speedup, for the measured workload.

Dataset Before After Load time reduction Speedup
TPC-H 2617.33 s 1696.06 s 35.2% 1.54x

Release note

Restore asynchronous S3 prefetch for FileScannerV2 CSV and text reads, with safe cache-statistics aggregation and cleanup, consistent ring capacity and populated prefetch profiles.

Check List (For Author)

  • Test:

    • Added S3 mock coverage for whole-file, mid-row split and unknown-size reads; checks row values, outer tracing, background S3 reads, prefetch profile publication and repeated close.
    • Added buffered-reader tests for four concurrent workers with isolated cache statistics, partial consumption, slot reuse, unconsumed-buffer collection, successful reads finishing after foreground timeout, explicit close/destruction, and exact bytes across 0/1/6/10/16 MiB ring settings from zero/nonzero offsets. Added a shared stream-pipe ownership test.
    • Passed Clang 16 syntax checking of the complete buffered_reader_test.cpp translation unit against repository and installed third-party headers with -Werror -Wunused-member-function.
    • Passed repository clang-format 16 formatting/check scripts, build-support/check-build-hygiene.sh, and git diff --check.
    • Full BE build and runtime tests are not verified locally: ./run-be-ut.sh --run --filter='BufferedReaderTest.*:CsvV2ReaderTest.*' -j 8 stops at JDK initialization (Failed setting boot class path). Separate production/CSV syntax attempts encounter installed C++ library and stale generated-header incompatibilities. No compilation database is available for clang-tidy. Runtime and sanitizer validation remain pending CI.
    • The S3 mock test disables file cache; the concurrent statistics test exercises the actual prefetch implementation with a mock reader updating FileCacheStatistics. No cached-S3 end-to-end runtime result is claimed.
    • TPC-H load benchmark: elapsed time decreased from 2617.33 s to 1696.06 s (35.2% less load time; approximately 1.54x speedup).
  • Behavior changed:

    • Yes. Eligible S3 CSV/Text readers use sequential prefetch. Shared prefetch readers isolate cache counters, drain outstanding reads during cleanup and normalize ring capacity. CSV/Text publishes prefetch profiles on close.
  • Does this need documentation?

    • No.

Check List (For Reviewer who merge this PR)

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

### What problem does this PR solve?

Issue Number: None

Related PR: apache#69333

Problem Summary:

After CSV ingestion switched to FileScannerV2, `DelimitedTextReader` opened remote files directly through `FileFactory`, bypassing the sequential prefetch used by the original CSV reader. S3 reads therefore block the scanner instead of overlapping remote I/O with CSV parsing.

Restore `DelegateReader::create_file_reader(SEQUENTIAL)` in the shared CSV/Text reader, passing the shared IOContext and the adjusted split range. Unknown-size first splits use an end sentinel that the prefetch reader clamps to the physical file size. Keep tracing outside the prefetch layer and preserve the existing stream-load pipe path.

### Release note

Restore asynchronous S3 prefetch for FileScannerV2 CSV and text reads.

### Check List (For Author)

- Test
    - [x] Unit Test added: `CsvV2ReaderTest.S3PrefetchPreservesSplitRowsAndReadStatistics` covers whole-file, mid-row split and unknown-size reads; checks row values, IO statistics and background-thread S3 reads.
    - Local runtime execution is **blocked**, not passed: `./run-be-ut.sh --run --filter='CsvV2ReaderTest.*' -j 8` stops during JDK initialization with `Failed setting boot class path`. Reproduced outside the sandbox. Runtime validation is pending CI.
    - Passed repository clang-format 16 formatting/check scripts, `build-support/check-build-hygiene.sh`, and `git diff --check`.
    - No post-fix throughput or same-host benchmark result is claimed.

- Behavior changed:
    - [x] Yes. Eligible S3 CSV/Text readers use the existing sequential prefetch implementation. No row parsing, schema or stream-pipe semantics change.

- Does this need documentation?
    - [x] No.
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@sollhui sollhui changed the title [fix](load) Restore sequential prefetch for FileScannerV2 CSV reads [perf](load) Restore sequential prefetch for FileScannerV2 CSV reads Oct 28, 2026
@sollhui

sollhui commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@sollhui

sollhui commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

/review

### What problem does this PR solve?

Issue Number: None

Related PR: apache#69716

Problem Summary:

The anonymous-namespace CSV S3 test client uses MOCK_METHOD for operations
that never have expectations. Clang reports the generated gmock_* member
functions as unused, and BE unit-test compilation fails under -Werror.
Replace these unused mock methods with ordinary virtual overrides that
fail the test and return unsupported status on unexpected calls. Remove
the unused gMock include.

### Release note

None

### Check List (For Author)

- Test: reproduced the original diagnostic and passed the corrected client
  in a focused Clang 16 syntax check using actual repository headers and
  -Werror -Wunused-member-function; repository format and hygiene checks.
  Full BE unit-test execution remains blocked by local JDK initialization.
- Behavior changed: No production behavior change.
- Does this need documentation: No.
@sollhui

sollhui commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@sollhui

sollhui commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Request changes: three P1 findings affect cached-read concurrency, timed-out reader ownership, and configured buffer-ring geometry; one P2 finding leaves the new prefetch profile counters at zero. All four are inline. There were no existing inline comments or blocking IDs to carry forward.

Static coverage includes both changed files and the scanner/table-reader -> CSV/Text -> DelegateReader -> S3/cache -> line-reader chain. Critical checkpoint conclusions:

  • Goal and proof: eligible S3 CSV/Text now selects sequential prefetch. The added unit test checks representative rows, split alignment, unknown size, outer read statistics and background GET dispatch, but does not establish concurrency or timeout safety.
  • Scope, clarity and reuse: the production change is small and reuses the legacy CSV delegate. Layer ownership and schema/materialization boundaries remain intact. Reuse exposes the three safety defects reported inline.
  • Concurrency and locks: the default buffer ring schedules four workers sharing non-atomic scanner cache counters without a common update/snapshot lock; the scanner's monotonicity assertions make this a crash risk. Outer tracing counters remain on the scanner thread. No new lock-order cycle was found.
  • Lifecycle and memory: normal close drains active reads and prefetch backing buffers allocate/free on the query thread. Timed-out close can release scanner-owned context pointees while work remains active. No new static initialization dependency or ownership cycle was found; no separate orphan-memory defect was substantiated.
  • Configuration: no configuration is added. Existing mutable prefetch size and wait-time settings now affect this v2 path; a supported value of 6 MiB exposes invalid buffer indexing. Runtime mutation is observed when each reader is constructed.
  • Compatibility: no wire definition, function symbol, storage format or persistent metadata changes. No Thrift/Protobuf or rolling-upgrade compatibility change applies.
  • Parallel paths: CSV and Text share the change; FILE_STREAM retains its pipe path. Local/HDFS/Broker/HTTP pass through the delegate. Default small raw S3 objects use DelegateReader's existing InMemory policy; cached S3 uses prefetch. Compressed first splits preserve their physical-byte/decompressor contract and non-first compressed splits remain rejected.
  • Conditional logic and correctness: adjusted pre-read prefixes preserve the split end; unknown-size sentinel clamps to physical S3 size; synchronous fallback beyond the prefetch range preserves records crossing split boundaries. Backward delimiter probes were rechecked. No additional default-configuration row-correctness defect was found.
  • Tests and expected results: the mock uses immutable data and atomic counters; cleanup restores global test state. Existing local CSV tests cover delimiters, headers, projection, malformed input, multiple blocks and small split boundaries. No expected-result artifact is changed. Tests were inspected, not executed.
  • Observability: outer FileReaderStats remains available, but newly registered prefetch counters are never published, as reported inline.
  • Transactions and persistence: no transaction, visibility-version, delete-bitmap, EditLog, data-write atomicity or crash-recovery logic changes.
  • FE-BE propagation: no new cross-process variable or transmission path applies.
  • Performance: asynchronous dispatch is present and existing buffering is reused; throughput, overlap benefit, allocation behavior and read amplification were not measured. No benchmark result is claimed.
  • Further-issue sweep and user focus: both changed paths and all risk items were reviewed beyond the initial findings. No additional user focus was supplied; no unresolved static candidate remains.

Validation limits: this contract permits static review only, so no build, unit/regression test, sanitizer run or benchmark was performed. The added tiny fixture disables file cache, forces the prefetch path, uses one worker and ends known-size splits at EOF. Runtime coverage remains missing for cached/concurrent multi-buffer reads, the 4 MiB rotation boundary and non-default sizes, errors/timeouts/early close/cancellation, finite split-end overread, default small-file dispatch and compressed/Text S3 integration. These are disclosed validation gaps, not claims of passing execution.

Review converged after 3 round(s).

### What problem does this PR solve?

Issue Number: None

Related PR: apache#69716

Problem Summary: Sequential prefetch exposes shared cache statistics to concurrent
updates and can outlive scanner-owned state after a close timeout. Give each
buffer separate cache statistics and merge them on the consumer thread. Drain
active reads during close, normalize ring capacity to allocated buffers, and
publish CSV/Text prefetch profiles before releasing filesystem readers. Preserve
shared stream-pipe ownership.

### Release note

Prevent cache-statistics races and shutdown lifetime errors during sequential
prefetch. Handle non-multiple-of-four buffer settings and publish CSV/Text
prefetch counters.

### Check List (For Author)

- Test: Add concurrent-statistics, timeout cleanup, ring-capacity, profile and
  stream-ownership unit coverage. Buffered-reader test TU passes Clang 16 syntax
  checking with -Werror -Wunused-member-function. Formatting, hygiene and diff
  checks pass. Full BE unit execution is blocked by local JDK initialization;
  production/Csv test syntax checks also encounter local toolchain/generated
  header incompatibilities. Runtime validation remains pending CI.
- Behavior changed: Yes; close drains active I/O, counters merge on the consumer,
  and the prefetch ring uses its allocated capacity.
- Does this need documentation: No
@sollhui

sollhui commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@sollhui

sollhui commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: workspace routing discovery unauthorized (401)
Workflow run: https://github.com/apache/doris/actions/runs/40635847976

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: 28727 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit adbbf99f0a55c2a175a4d61676a664a0b13c0b56, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17605	5244	5095	5095
q2	2135	323	266	266
q3	10212	1410	816	816
q4	4692	462	333	333
q5	7445	822	529	529
q6	181	185	150	150
q7	752	793	602	602
q8	9254	1346	1058	1058
q9	5621	4212	4169	4169
q10	6831	1287	1039	1039
q11	429	259	226	226
q12	638	401	275	275
q13	18116	3661	3042	3042
q14	281	280	239	239
q15	q16	745	738	659	659
q17	1213	768	577	577
q18	7146	6183	6132	6132
q19	1248	964	590	590
q20	395	340	232	232
q21	5837	2447	2421	2421
q22	389	322	277	277
Total cold run time: 101165 ms
Total hot run time: 28727 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5957	5928	6089	5928
q2	724	622	602	602
q3	5681	5886	5285	5285
q4	2061	2144	1583	1583
q5	5702	5813	5650	5650
q6	235	185	153	153
q7	2255	2061	1847	1847
q8	3020	2743	2740	2740
q9	7928	7731	7487	7487
q10	3602	3622	3129	3129
q11	581	416	383	383
q12	663	664	493	493
q13	3313	3700	3024	3024
q14	286	284	265	265
q15	q16	657	693	617	617
q17	7768	7017	6878	6878
q18	13071	12211	12899	12211
q19	911	779	783	779
q20	2128	2141	1970	1970
q21	5772	4572	4884	4572
q22	486	438	393	393
Total cold run time: 72801 ms
Total hot run time: 65989 ms

@hello-stephen

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

query5	4309	589	459	459
query6	421	214	191	191
query7	4805	446	238	238
query8	320	170	149	149
query9	8778	3250	3264	3250
query10	494	319	263	263
query11	5977	3876	3598	3598
query12	156	92	88	88
query13	1254	463	330	330
query14	6110	3927	3665	3665
query14_1	3416	3450	3447	3447
query15	212	196	180	180
query16	952	433	409	409
query17	879	655	537	537
query18	2435	435	312	312
query19	192	168	136	136
query20	88	86	82	82
query21	213	131	114	114
query22	12974	13129	13318	13129
query23	13378	12873	12390	12390
query23_1	12441	12612	12641	12612
query24	7381	844	476	476
query24_1	486	490	490	490
query25	541	421	368	368
query26	1242	259	145	145
query27	2775	444	277	277
query28	4613	2065	2051	2051
query29	1561	604	462	462
query30	304	224	189	189
query31	1026	925	823	823
query32	168	93	93	93
query33	532	302	243	243
query34	909	876	516	516
query35	738	752	647	647
query36	842	835	743	743
query37	125	102	85	85
query38	1782	1727	1675	1675
query39	792	806	754	754
query39_1	733	746	735	735
query40	228	138	100	100
query41	73	69	72	69
query42	87	88	84	84
query43	348	364	322	322
query44	1328	714	716	714
query45	184	183	165	165
query46	821	1013	562	562
query47	2678	2888	2765	2765
query48	313	306	239	239
query49	575	400	293	293
query50	674	277	204	204
query51	10467	10460	10389	10389
query52	77	89	73	73
query53	187	209	158	158
query54	257	195	194	194
query55	73	67	66	66
query56	226	234	222	222
query57	1671	1656	1543	1543
query58	297	271	269	269
query59	2139	2120	1950	1950
query60	294	245	229	229
query61	147	143	145	143
query62	384	342	285	285
query63	195	160	158	158
query64	2753	909	731	731
query65	3322	3263	3258	3258
query66	1763	425	300	300
query67	20148	20179	19856	19856
query68	3156	995	620	620
query69	394	293	251	251
query70	857	803	788	788
query71	305	241	216	216
query72	2674	2601	2324	2324
query73	526	529	296	296
query74	4647	4513	4398	4398
query75	2362	2276	1928	1928
query76	2329	1031	595	595
query77	349	381	287	287
query78	9765	9777	9145	9145
query79	986	921	532	532
query80	1249	444	359	359
query81	583	316	268	268
query82	769	141	103	103
query83	299	198	187	187
query84	315	114	102	102
query85	1002	432	373	373
query86	376	237	228	228
query87	2005	1961	1831	1831
query88	3799	2779	2766	2766
query89	338	282	242	242
query90	1781	179	174	174
query91	159	150	130	130
query92	104	89	92	89
query93	1004	1036	595	595
query94	585	321	272	272
query95	570	327	297	297
query96	684	506	242	242
query97	2442	2456	2329	2329
query98	162	162	150	150
query99	786	763	635	635
Total cold run time: 235125 ms
Total hot run time: 151836 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.10	0.05	0.04
query3	0.26	0.09	0.09
query4	1.61	0.10	0.10
query5	0.23	0.25	0.24
query6	1.16	0.67	0.67
query7	0.04	0.00	0.00
query8	0.05	0.04	0.04
query9	0.39	0.33	0.36
query10	0.58	0.60	0.55
query11	0.21	0.14	0.14
query12	0.19	0.15	0.14
query13	0.49	0.48	0.49
query14	1.01	1.02	1.02
query15	0.65	0.61	0.62
query16	0.30	0.33	0.33
query17	1.18	1.13	1.15
query18	0.21	0.19	0.19
query19	2.09	1.93	1.94
query20	0.02	0.02	0.01
query21	15.43	0.21	0.14
query22	4.83	0.06	0.05
query23	16.29	0.31	0.12
query24	2.99	0.57	0.51
query25	0.09	0.07	0.06
query26	1.58	0.21	0.14
query27	0.05	0.04	0.05
query28	3.57	0.72	0.36
query29	12.54	4.23	3.26
query30	0.27	0.13	0.10
query31	2.77	0.57	0.33
query32	3.22	0.59	0.51
query33	3.24	3.26	3.20
query34	15.31	3.95	3.39
query35	3.37	3.37	3.34
query36	0.56	0.45	0.43
query37	0.10	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.15	0.14
query41	0.08	0.04	0.03
query42	0.04	0.02	0.02
query43	0.04	0.04	0.03
Total cold run time: 97.42 s
Total hot run time: 24.37 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 67.07% (32362/48248)
Line Coverage 51.93% (342697/659924)
Region Coverage 47.37% (278541/588018)
Branch Coverage 49.04% (131332/267832)

@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 77.51% (36238/46753)
Line Coverage 62.72% (409474/652895)
Region Coverage 59.25% (347148/585890)
Branch Coverage 60.10% (160583/267180)

@sollhui sollhui changed the title [perf](load) Restore sequential prefetch for FileScannerV2 CSV reads [perf](load) introduce sequential prefetch for FileScannerV2 CSV reads Oct 29, 2026
@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 77.51% (36238/46753)
Line Coverage 62.72% (409485/652895)
Region Coverage 59.26% (347224/585890)
Branch Coverage 60.11% (160591/267180)

@sollhui
sollhui merged commit 8d88f1c into apache:master Oct 29, 2026
57 of 58 checks passed
@sollhui
sollhui deleted the fix/v2-csv-sequential-prefetch branch October 29, 2026 07:20
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

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

Copy link
Copy Markdown
Contributor

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

Gabriel39 pushed a commit that referenced this pull request Oct 30, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: #69716

Problem Summary:

After restoring sequential prefetch, large V2 CSV loads still spend
substantial CPU time in row parsing and string materialization. The
reader compares a general separator at every byte, updates atomic
profile counters per cell, starts three stage timers per row, and
repeats checked string-column casts per cell. It also ignores the row
cap supplied by TableReader.

This change combines four optimizations on master:
- Compare the separator byte directly for plain single-character
separators; retain enclosed, multi-character, Hive/OpenCSV and PROTO
parsing paths.
- Accumulate exact work counters locally and publish at
get_block/count/schema return, including errors. Sample stage timings
every 1024 physical read_line calls, starting with the first, and expose
unscaled SampledReadLineTime, SampledSplitLineTime and
SampledDeserializeTime with sample counts. DelimitedTextReader remains
full elapsed time; split-prefix alignment has its own full timer.
- Validate nullable string column types and reserve offsets/null maps
once per mutable batch, then insert strings directly with the existing
NULL, quoting and escape semantics.
- Honor FileReader::set_batch_size, retaining the existing byte budget
and runtime default when no explicit cap is supplied. The caller still
controls the maximum batch size; this does not force 16352-row blocks.

Shared counters and batch sizing also apply to the Hive text reader.

### Performance benchmark

On TPC-DS SF100, elapsed time decreased from **1,944 seconds to 1,375
seconds**:

| Benchmark | Before | After | Time reduction | Speedup |
| --- | ---: | ---: | ---: | ---: |
| TPC-DS SF100 | 1,944 s | 1,375 s | 29.3% (569 s) | 1.41× |

### Release note

Reduce V2 CSV parsing overhead and honor caller-provided batch sizes.
Delimited-text per-stage profile timers are now explicitly named
Sampled* and contain unscaled sampled durations; use the full
DelimitedTextReader timer for elapsed-time comparisons.

### Check List (For Author)

- Test
- [x] Unit Test: added cases for dynamic/zero batch caps, byte limits,
filtered blocks, cross-batch sampling and exact counters,
single/multi-character separators, NULL and escape behavior, missing
fields, reordered projection and copy-on-write. Extended error,
rejected-row and COUNT counter coverage.
- Execution: run-be-ut.sh was attempted with CsvV2ReaderTest.*,
TextV2ReaderTest.* and LegacyAndV2/PlainCsvSplitTest.*. It exits before
C++ compilation because the local JDK 17 fails to initialize (Failed
setting boot class path), including outside the sandbox. Full build/UT
remain pending. Performance benchmark results are reported above.
- Passed: repository clang-format 16 formatting/check scripts,
build-support/check-build-hygiene.sh and git diff --check.
- Behavior changed: Yes. Existing batch-size contract is honored, and
detailed stage timers are explicitly sampled. CSV value semantics are
unchanged.
- Does this need documentation: No. The profile includes a timing
explanation; no new configuration or SQL syntax.

For further benchmark comparisons, use identical hardware, input,
compression, cache conditions and load batch/byte-budget settings for
the parent and this commit. Compare total load time, Scanner CPU time,
DelimitedTextReader time and RowsRead/BlockNumber. Do not directly
compare Sampled* timers with the previous full stage timers.
yiguolei pushed a commit to sollhui/doris that referenced this pull request Nov 12, 2026
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.

3 participants