Skip to content

feat: Implement ConstantEncoding::get for row-level value lookup#757

Open
duxiao1212 wants to merge 1 commit into
facebookincubator:mainfrom
duxiao1212:export-D105856233
Open

feat: Implement ConstantEncoding::get for row-level value lookup#757
duxiao1212 wants to merge 1 commit into
facebookincubator:mainfrom
duxiao1212:export-D105856233

Conversation

@duxiao1212
Copy link
Copy Markdown
Contributor

@duxiao1212 duxiao1212 commented May 20, 2026

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 20, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 20, 2026

@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
@meta-codesync meta-codesync Bot changed the title feat: Support Constant encoding for ClusterIndex key streams feat: Implement ConstantEncoding::get for row-level value lookup May 21, 2026
@duxiao1212 duxiao1212 force-pushed the export-D105856233 branch from b0b68c8 to d84aba4 Compare May 21, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant