Skip to content
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

feat: support IVF_HNSW_PQ #1314

Merged
merged 7 commits into from
May 24, 2024
Merged

feat: support IVF_HNSW_PQ #1314

merged 7 commits into from
May 24, 2024

Conversation

BubbleCal
Copy link
Contributor

this also simplifies the code of creating index with macro

this also simplifies the code of creating index with macro

Signed-off-by: BubbleCal <[email protected]>
@github-actions github-actions bot added enhancement New feature or request Rust Rust related issues labels May 18, 2024
Signed-off-by: BubbleCal <[email protected]>
Signed-off-by: BubbleCal <[email protected]>
@BubbleCal BubbleCal requested a review from westonpace May 18, 2024 07:30
@BubbleCal BubbleCal marked this pull request as ready for review May 18, 2024 07:31
if !Self::supported_vector_data_type(field.data_type()) {
return Err(Error::InvalidInput {
message: format!(
"An IVF HNSW SQ index cannot be created on the column `{}` which has data type {}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"An IVF HNSW SQ index cannot be created on the column `{}` which has data type {}",
"An IVF HNSW PQ index cannot be created on the column `{}` which has data type {}",

Comment on lines +1281 to +1286
let num_partitions = if let Some(n) = index.num_partitions {
n
} else {
suggested_num_partitions(self.count_rows(None).await?)
};
let num_sub_vectors: u32 = if let Some(n) = index.num_sub_vectors {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit: you could probably use unwrap_or_else here too...

let num_partitions = index.num_partitions.unwrap_or_else(|| suggested_num_partitions(self.count_rows(None).await?));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can't be done because await not available in the non-async closure

@BubbleCal BubbleCal merged commit fd1a5ce into lancedb:main May 24, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Rust Rust related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants