Uh oh!
There was an error while loading. Please reload this page.
[opt](variant) Optimize VARIANT doc mode load/compaction and add benchmarks - #60511
Conversation
eldenmoon
commented
Feb 4, 2026
run buildall |
hello-stephen
commented
Feb 4, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
There was a problem hiding this comment.
Pull request overview
This PR focuses on optimizing VARIANT “doc mode” ingestion/compaction paths by reducing overhead in doc-value serialization/materialization and by switching several hot-path maps/sets to phmap for better performance, with accompanying new/expanded tests.
Changes:
- Optimize doc-value column handling (avoid sorting, faster serialization path,
phmapusage in several structures). - Adjust variant compaction validation logic to tolerate doc/sparse extracted columns in output schemas.
- Add/extend unit tests, including a new doc-mode compaction test and additional doc-value serialization coverage.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| be/test/olap/variant_doc_mode_compaction_test.cpp | Adds a new end-to-end compaction test for VARIANT doc mode (currently heavy and non-hermetic). |
| be/test/olap/rowset/segment_v2/variant_util_test.cpp | Adds coverage for OnlyDocValueColumn serialization with mixed types. |
| be/src/vec/common/variant_util.h | Changes materialize_docs_to_subcolumns_map return type to phmap::flat_hash_map. |
| be/src/vec/common/variant_util.cpp | Implements faster doc-value serialization and updates doc materialization map implementation. |
| be/src/vec/columns/subcolumn_tree.h | Switches node children map to phmap::flat_hash_map. |
| be/src/vec/columns/column_variant.h / be/src/vec/columns/column_variant.cpp | Removes sort_doc_value_column support. |
| be/src/olap/rowset/segment_v2/variant/variant_column_writer_impl.cpp | Reworks sparse/doc bucket writing/statistics with phmap; introduces offset-iteration changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
eldenmoon
commented
Feb 4, 2026
run buildall |
eldenmoon
commented
Feb 4, 2026
run buildall |
doris-robot
commented
Feb 4, 2026
TPC-H: Total hot run time: 31662 ms |
doris-robot
commented
Feb 4, 2026
ClickBench: Total hot run time: 28.31 s |
eldenmoon
commented
Feb 5, 2026
run buildall |
doris-robot
commented
Feb 5, 2026
TPC-H: Total hot run time: 31175 ms |
doris-robot
commented
Feb 5, 2026
ClickBench: Total hot run time: 28.13 s |
eldenmoon
commented
Feb 6, 2026
run p0 5 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
eldenmoon
commented
Feb 6, 2026
run buildall |
doris-robot
commented
Feb 6, 2026
TPC-H: Total hot run time: 30809 ms |
doris-robot
commented
Feb 6, 2026
ClickBench: Total hot run time: 28.11 s |
eldenmoon
commented
Feb 6, 2026
run buildall |
doris-robot
commented
Feb 6, 2026
TPC-H: Total hot run time: 30123 ms |
doris-robot
commented
Feb 6, 2026
ClickBench: Total hot run time: 28.5 s |
eldenmoon
commented
Feb 7, 2026
run buildall |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
da975a5 to
6f5e3b1Compareeldenmoon
commented
Feb 9, 2026
run buildall |
…hmarks Improve VARIANT doc-mode ingestion and compaction performance, and add a write/compaction benchmark UT. Key changes: - Add config `enable_variant_doc_compaction_sparse_write` (default: true) to enable sparse writing for materialized subcolumns during doc-mode compaction. - Optimize doc value column generation: deduplicate paths, sort paths once, and serialize values directly into the binary column to reduce allocations/copies. - Optimize bucket sharding/stats collection with phmap and cached path->bucket mapping; remove per-row doc value sorting in writer. - Refactor VariantDocCompactWriter finalize flow with an explicit write plan; skip invalid array types and fix doc materialization offset handling. - Update variant-related UTs and add VariantDocModeCompactionTest to benchmark segment import and doc-mode compaction. Benchmark Testing: - BE UT: VariantColumnWriterReaderTest.*, VariantUtilTest.*, ColumnVariantTest.* - BE UT (Release-only, slow): VariantDocModeCompactionTest.*
eldenmoon
commented
Feb 9, 2026
run buildall |
doris-robot
commented
Feb 9, 2026
TPC-H: Total hot run time: 30589 ms |
doris-robot
commented
Feb 9, 2026
ClickBench: Total hot run time: 28.7 s |
PR approved by anyone and no changes requested. |
eldenmoon
commented
Feb 9, 2026
run buildall |
doris-robot
commented
Feb 9, 2026
TPC-H: Total hot run time: 30829 ms |
doris-robot
commented
Feb 9, 2026
ClickBench: Total hot run time: 28.72 s |
hello-stephen
commented
Feb 9, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Feb 9, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
PR approved by at least one committer and no changes requested. |
Uh oh!
There was an error while loading. Please reload this page.
…hmarks (apache#60511) Improve VARIANT doc-mode ingestion and compaction performance, and add a write/compaction benchmark UT. Key changes: - Add config `enable_variant_doc_compaction_sparse_write` (default: true) to enable sparse writing for materialized subcolumns during doc-mode compaction. - Optimize doc value column generation: deduplicate paths, sort paths once, and serialize values directly into the binary column to reduce allocations/copies. - Optimize bucket sharding/stats collection with phmap and cached path->bucket mapping; remove per-row doc value sorting in writer. - Refactor VariantDocCompactWriter finalize flow with an explicit write plan; skip invalid array types and fix doc materialization offset handling. - Update variant-related UTs and add VariantDocModeCompactionTest to benchmark segment import and doc-mode compaction. UT Testing: - BE UT: VariantColumnWriterReaderTest.*, VariantUtilTest.*, ColumnVariantTest.* Benchmark Testing(Release compile): - BE UT (Release-only, slow): VariantDocModeCompactionTest.* <img width="902" height="778" alt="image" src="https://github.com/user-attachments/assets/08fb9341-2620-484d-9cf9-f3a64c95d4bd" />
…hmarks (apache#60511) Improve VARIANT doc-mode ingestion and compaction performance, and add a write/compaction benchmark UT. Key changes: - Add config `enable_variant_doc_compaction_sparse_write` (default: true) to enable sparse writing for materialized subcolumns during doc-mode compaction. - Optimize doc value column generation: deduplicate paths, sort paths once, and serialize values directly into the binary column to reduce allocations/copies. - Optimize bucket sharding/stats collection with phmap and cached path->bucket mapping; remove per-row doc value sorting in writer. - Refactor VariantDocCompactWriter finalize flow with an explicit write plan; skip invalid array types and fix doc materialization offset handling. - Update variant-related UTs and add VariantDocModeCompactionTest to benchmark segment import and doc-mode compaction. UT Testing: - BE UT: VariantColumnWriterReaderTest.*, VariantUtilTest.*, ColumnVariantTest.* Benchmark Testing(Release compile): - BE UT (Release-only, slow): VariantDocModeCompactionTest.* <img width="902" height="778" alt="image" src="https://github.com/user-attachments/assets/08fb9341-2620-484d-9cf9-f3a64c95d4bd" />
…hmarks (apache#60511) Improve VARIANT doc-mode ingestion and compaction performance, and add a write/compaction benchmark UT. Key changes: - Add config `enable_variant_doc_compaction_sparse_write` (default: true) to enable sparse writing for materialized subcolumns during doc-mode compaction. - Optimize doc value column generation: deduplicate paths, sort paths once, and serialize values directly into the binary column to reduce allocations/copies. - Optimize bucket sharding/stats collection with phmap and cached path->bucket mapping; remove per-row doc value sorting in writer. - Refactor VariantDocCompactWriter finalize flow with an explicit write plan; skip invalid array types and fix doc materialization offset handling. - Update variant-related UTs and add VariantDocModeCompactionTest to benchmark segment import and doc-mode compaction. UT Testing: - BE UT: VariantColumnWriterReaderTest.*, VariantUtilTest.*, ColumnVariantTest.* Benchmark Testing(Release compile): - BE UT (Release-only, slow): VariantDocModeCompactionTest.* <img width="902" height="778" alt="image" src="https://github.com/user-attachments/assets/08fb9341-2620-484d-9cf9-f3a64c95d4bd" />
Improve VARIANT doc-mode ingestion and compaction performance, and add a
write/compaction benchmark UT.
Key changes:
enable_variant_doc_compaction_sparse_write(default: true) toenable sparse writing for materialized subcolumns during doc-mode compaction.
serialize values directly into the binary column to reduce allocations/copies.
mapping; remove per-row doc value sorting in writer.
skip invalid array types and fix doc materialization offset handling.
segment import and doc-mode compaction.
UT Testing:
Benchmark Testing(Release compile):