-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feat](variant) Support vertical compaction for subcolumns #54499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
This commit introduces a new mechanism to improve compaction
performance for tables with VARIANT columns by enabling vertical
compaction for frequently accessed subcolumns.
Key Changes:
1. Vertical Compaction of Subcolumns:
During compaction, the table schema is temporarily extended to
treat "hot" subcolumns (frequently accessed paths) within the
VARIANT column as separate, top-level columns. This allows them to
be compacted more efficiently in their own column groups,
improving overall performance. This behavior is controlled by the
new configuration parameter
`enable_vertical_compact_variant_subcolumns`, which is enabled by
default.
2. Schema Handling in Rowsets:
* To prevent these temporary extracted subcolumns from being
persisted permanently, a new flag,
strip_variant_extracted_columns_in_rowset_meta, has been
added to RowsetWriterContext. When enabled, the RowsetWriter
removes these temporary columns from the schema before saving
the rowset metadata.
* This change ensures that the in-memory Rowset object uses
the same schema as the one persisted in its RowsetMeta,
preventing potential data inconsistencies.
3. Sparse Column Merging on Read:
* A new SparseColumnMergeIterator has been implemented. This
iterator is responsible for merging data from the base
sparse representation of the VARIANT with data from any
extracted subcolumns during reads. This provides a complete
and unified view of the VARIANT data to the upper-level
query engine.
4. Other Fixes and Improvements:
* The DataTypeVariant constructor now correctly accepts the
max_subcolumns_count parameter.
* A new correctness check (check_path_stats) has been added to
ensure that the final output rowset does not contain any
temporary, extracted subcolumns after compaction.
* Previously commented-out code related to subcolumn indexing
and sparse column merging has been re-enabled.
* The build_basic_info method in the compaction process has
been refactored to return a Status for more robust error
handling.
Member
Author
|
run buildall |
TPC-H: Total hot run time: 33939 ms |
TPC-DS: Total hot run time: 171380 ms |
ClickBench: Total hot run time: 33.52 s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces a new mechanism to improve compaction
performance for tables with VARIANT columns by enabling vertical
compaction for frequently accessed subcolumns.
Key Changes:
Vertical Compaction of Subcolumns: During compaction, the table schema is temporarily extended to treat "hot" subcolumns (frequently accessed paths) within the VARIANT column as separate, top-level columns. This allows them to
be compacted more efficiently in their own column groups,
improving overall performance. This behavior is controlled by the new configuration parameter
enable_vertical_compact_variant_subcolumns, which is enabled by default.Schema Handling in Rowsets: * To prevent these temporary extracted subcolumns from being persisted permanently, a new flag, strip_variant_extracted_columns_in_rowset_meta, has been added to RowsetWriterContext. When enabled, the RowsetWriter removes these temporary columns from the schema before saving the rowset metadata. * This change ensures that the in-memory Rowset object uses the same schema as the one persisted in its RowsetMeta, preventing potential data inconsistencies.
Sparse Column Merging on Read:
Other Fixes and Improvements: * The DataTypeVariant constructor now correctly accepts the max_subcolumns_count parameter. * A new correctness check (check_path_stats) has been added to ensure that the final output rowset does not contain any temporary, extracted subcolumns after compaction. * Previously commented-out code related to subcolumn indexing and sparse column merging has been re-enabled. * The build_basic_info method in the compaction process has been refactored to return a Status for more robust error handling.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)