Repository navigation
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
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
Add Spark SQL
vector_range_searchfor single-vector columns in Data Evolution append tables. Spark plans snapshot-scoped reference tasks on the driver. Executors evaluate the range and stream matching rows and scores in bounded chunks.This draft depends on #11655. See the Spark-only diff.
Usage
The fourth argument is a constant map containing numeric
min_distance,max_distance, or both. Both bounds are inclusive. The optional fifth argument is a constant map of string-valued execution options, such asvector-index.search-modeandivf.nprobe.Run the examples with a Paimon catalog selected. The sample table uses two-dimensional vectors and squared L2 distance.
Single query
The query returns IDs 1 and 2. The distance for ID 2 equals the upper bound. Use
map('min_distance', 1.0D)to apply only the lower bound.Batch queries
The batch returns
(query_id, id)pairs(10, 2),(20, 1), and(20, 3). The lower bound excludes each query's exact match. With an index, the index metric determines the distance units. Quantization and probe options can affect matches. Range results are uncapped and have no implicit order.Changes
VectorDistanceRangecontract and validate bounds separately from execution options.Tests
LIMIT.The Spark 4 run used the same suites with
-Pfast-build -Pspark4on JDK 17.