perf: DH-22420: Skip Unnecessary Single Value Columns when Sorting#7957
Merged
cpwright merged 4 commits intodeephaven:mainfrom Apr 29, 2026
Merged
Conversation
Contributor
No docs changes detected for 262afb0 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements a sorting optimization in the Deephaven engine to avoid doing sort work for sort keys that cannot affect ordering (single-value / row-key-agnostic columns), including a no-op “identity” mapping when all sort keys are constant.
Changes:
- Add logic in
SortHelpers.getSortedKeysto drop row-key-agnostic sort columns (when the comparator respects equality) and return an identity mapping when all keys are constant. - Refactor row-redirection utilities by extracting
StaticWrappedRowSetRowRedirectionand reusing it fromWrappedRowSetRowRedirection. - Add test coverage to validate behavior for constant, null-value, and non-equality-respecting comparator cases.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| engine/table/src/test/java/io/deephaven/engine/table/impl/MultiColumnSortTest.java | Adds tests for skipping constant / null sort columns and identity-sort behavior. |
| engine/table/src/main/java/io/deephaven/engine/table/impl/util/WrappedRowSetRowRedirection.java | Refactors to extend StaticWrappedRowSetRowRedirection and updates prev-chunk behavior. |
| engine/table/src/main/java/io/deephaven/engine/table/impl/util/StaticWrappedRowSetRowRedirection.java | New reusable base implementation for wrapped-RowSet redirection. |
| engine/table/src/main/java/io/deephaven/engine/table/impl/SortOperation.java | Treats identity mapping as already-sorted and generalizes historical redirection type. |
| engine/table/src/main/java/io/deephaven/engine/table/impl/SortHelpers.java | Implements constant-column skipping and introduces IdentitySortMapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…iColumnSortTest.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/WrappedRowSetRowRedirection.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
lbooker42
approved these changes
Apr 29, 2026
Contributor
lbooker42
left a comment
There was a problem hiding this comment.
This looks good and is rather clever.
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.