-
Notifications
You must be signed in to change notification settings - Fork 646
feat(common): support input/output of new data type vector(n)
#22019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
xiangjinwu
wants to merge
7
commits into
feat-common-type-vector-p0-dummy
Choose a base branch
from
feat-common-type-vector-p1-io
base: feat-common-type-vector-p0-dummy
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat(common): support input/output of new data type vector(n)
#22019
xiangjinwu
wants to merge
7
commits into
feat-common-type-vector-p0-dummy
from
feat-common-type-vector-p1-io
+196
−55
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
xiangjinwu
commented
May 28, 2025
fn new(_capacity: usize) -> Self { | ||
todo!("VECTOR_PLACEHOLDER") | ||
fn new(capacity: usize) -> Self { | ||
Self::with_type(capacity, DataType::Vector(3)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment on lines
+187
to
+191
// TODO(VECTOR_PLACEHOLDER): not in CAST_TABLE because | ||
// * `DataType::try_from(DataTypeName::Vector).unwrap().to_oid()` panics | ||
// * `DataTypeName::Vector.to_oid()` is better but `to_oid` does not work for `DataTypeName::List` | ||
|| matches!((source, target), (DataType::Varchar, DataType::Vector(_)) if CastContext::Explicit <= allows) | ||
|| matches!((source, target), (DataType::Vector(_), DataType::Varchar) if CastContext::Assign <= allows) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
The new data type
vector(n)
is expected to match most of the behavior ofvector
from pgvector. Compared to existingreal[]
:null
,nan
,inf
or-inf
.Different from pgvector, the length parameter is always required. In pgvector it is optional for simple operations but required when building index.
This PR fills in some todos left by #21380 to support basic usage:
explain
outputvector(n)
from input SQLselect null::vector(3);
This implementation uses an inner
ListArray
to mimic the expected semantic. We may consider switching to a more direct implementation that could potentially BREAK existing value encoding (persisted data).Checklist
Documentation
Release note