-
Notifications
You must be signed in to change notification settings - Fork 710
fix: invalid schema type for LogicalVectorSearchLookupJoin #23893
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
fix: invalid schema type for LogicalVectorSearchLookupJoin #23893
Conversation
Signed-off-by: Mingzhuo Yin <yinmingzhuo@gmail.com>
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.
Pull request overview
This PR fixes an issue where LogicalVectorSearchLookupJoin was creating a struct type with named fields when it should use unnamed fields. The fix involves changing StructType::unnamed() to accept an iterator directly, eliminating unnecessary allocations and improving code ergonomics.
- Refactored
StructType::unnamed()to acceptimpl IntoIterator<Item = DataType>instead ofVec<DataType> - Fixed
VectorSearchLookupJoinCore::struct_type()to use unnamed struct fields - Removed unnecessary
.collect()calls and unused imports across the codebase
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/common/src/types/struct_type.rs | Modified unnamed() method signature to accept any iterator of DataType |
| src/frontend/src/optimizer/plan_node/logical_vector_search_lookup_join.rs | Fixed to use StructType::unnamed() instead of StructType::new(), ensuring correct unnamed struct schema |
| src/frontend/src/optimizer/rule/unify_first_last_value_rule.rs | Removed unnecessary .collect() call when building field types |
| src/frontend/src/binder/expr/value.rs | Removed unused itertools::Itertools import and .collect_vec() call |
| src/common/src/array/struct_array.rs | Removed .collect() calls in from_protobuf() and From<DataChunk> implementation |
| src/common/src/array/data_chunk.rs | Simplified struct type creation by removing intermediate .collect() |
Signed-off-by: Mingzhuo Yin <yinmingzhuo@gmail.com>
wenym1
left a comment
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.
Rest LGTM. Thanks for the quick fix!
|
|
||
| fn struct_type(&self) -> StructType { | ||
| StructType::new( | ||
| StructType::unnamed( |
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.
Shall we have a unified method in StructType like fn row_expr_type(types: impl Iterator<Item = DataType>) and call in both here and in bind_row so that we can explicitly declare that here we construct the struct type in the same way as row?
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.
updated in new commit
Signed-off-by: Mingzhuo Yin <yinmingzhuo@gmail.com>
eca2400 to
97dded6
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
close #23891
CorrelatedTopNToVectorSearchRuleonly specifies following logical plan pattern.This logical plan should have schema same as
array(row(...)), so the inner struct type should be an unnamed struct.Checklist
Documentation
Release note