feat(c): export vector-search projection over the C FFI#608
Open
JunRuiLee wants to merge 1 commit into
Open
Conversation
Add paimon_vector_search_builder_with_projection, mirroring paimon_read_builder_with_projection: a null-terminated array of null-terminated C strings, or null to clear. The names are stored on the builder state and applied in execute_read via with_projection, so C callers can restrict the materialized columns instead of always reading every user column plus the search score. Column-name validation is deferred to execute_read (the core vector builder's with_projection is infallible and resolves the projection when the search runs), so an unknown projected column surfaces as an error from execute_read rather than from the setter.
JunRuiLee
marked this pull request as ready for review
July 24, 2026 14:02
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.
Purpose
The C FFI vector-search builder (
bindings/c/src/vector_search.rs) exposedwith_vector_column/query_vector/limit/options/filter/execute_read, but not projection. C callers therefore could not restrict thematerialized columns and always read every user column (plus the search score),
even though the Rust
VectorSearchBuilderalready supportswith_projection.Changes
paimon_vector_search_builder_with_projection(builder, columns), mirroringpaimon_read_builder_with_projection:columnsis a null-terminated array ofnull-terminated C strings (pass
nullto clear). Names are stored on thebuilder state and applied in
execute_readviawith_projection.execute_read(the coreVectorSearchBuilder::with_projectionis infallible and resolves the projectionwhen the search runs), so an unknown projected column surfaces as an error from
execute_readrather than from the setter.Only
execute_readis affected; the search-only paths are unchanged.Tests
vector_search_pk_projection_restricts_columns: projecting["id"]throughexecute_readmaterializes onlyid+__paimon_search_score(the vectorcolumn is excluded), matching a Rust reference.
vector_search_projection_unknown_column_errors_at_execute_read: an unknownprojected column fails loud at
execute_read.cargo test -p paimon-c,cargo fmt --all --check, andcargo clippy -p paimon-c --all-targets -- -D warningsall pass.