feat: Implement ConstantEncoding::get for row-level value lookup#757
Open
duxiao1212 wants to merge 1 commit into
Open
feat: Implement ConstantEncoding::get for row-level value lookup#757duxiao1212 wants to merge 1 commit into
duxiao1212 wants to merge 1 commit into
Conversation
|
@duxiao1212 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105856233. |
Summary: Adds row-level random-access via Encoding::get(uint32_t row, void* buffer) to ConstantEncoding<T>. Since ConstantEncoding stores a single value shared by all rows, the implementation is a one-line memcpy that ignores the row argument. This brings ConstantEncoding to parity with Prefix and Trivial encodings, which already implement get() (added in D105225824 to support ClusterIndex::keyAtRow). The base Encoding::get default still throws NIMBLE_NOT_IMPLEMENTED for encodings that have not implemented row-level random access (RLE, Dictionary, Delta, MainlyConstant, etc.). This diff is encoding-layer only; it does not change which encodings any caller accepts. Whether to allow Constant in a particular call site (e.g. ClusterIndex key stream) is a separate decision and left for follow-up diffs as concrete needs arise. Reviewed By: xiaoxmeng Differential Revision: D105856233
b0b68c8 to
d84aba4
Compare
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 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.
Summary:
Adds row-level random-access via Encoding::get(uint32_t row, void* buffer) to ConstantEncoding. Since ConstantEncoding stores a single value shared by all rows, the implementation is a one-line memcpy that ignores the row argument.
This brings ConstantEncoding to parity with Prefix and Trivial encodings, which already implement get() (added in D105225824 to support ClusterIndex::keyAtRow). The base Encoding::get default still throws NIMBLE_NOT_IMPLEMENTED for encodings that have not implemented row-level random access (RLE, Dictionary, Delta, MainlyConstant, etc.).
This diff is encoding-layer only; it does not change which encodings any caller accepts. Whether to allow Constant in a particular call site (e.g. ClusterIndex key stream) is a separate decision and left for follow-up diffs as concrete needs arise.
Reviewed By: xiaoxmeng
Differential Revision: D105856233