-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[CLN] schema: build default with config ef & default_knn_index, remove #document population in defaults #5775
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -185,14 +185,16 @@ impl CollectionsWithSegmentsProvider { | |
| .await? | ||
| }; | ||
|
|
||
| // reconcile schema and config | ||
| let reconciled_schema = Schema::reconcile_schema_and_config( | ||
| collection_and_segments_sysdb.collection.schema.as_ref(), | ||
| Some(&collection_and_segments_sysdb.collection.config), | ||
| knn_index, | ||
| ) | ||
| .map_err(CollectionsWithSegmentsProviderError::InvalidSchema)?; | ||
| collection_and_segments_sysdb.collection.schema = Some(reconciled_schema); | ||
| if collection_and_segments_sysdb.collection.schema.is_none() { | ||
| collection_and_segments_sysdb.collection.schema = Some( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are always passing schema down to the reader then should we update the reader in |
||
| Schema::convert_collection_config_to_schema( | ||
| &collection_and_segments_sysdb.collection.config, | ||
| knn_index, | ||
| ) | ||
| .map_err(CollectionsWithSegmentsProviderError::InvalidSchema)?, | ||
| ); | ||
| } | ||
|
|
||
| self.set_collection_with_segments(collection_and_segments_sysdb.clone()) | ||
| .await; | ||
| Ok(collection_and_segments_sysdb) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,14 +112,14 @@ impl SpannSegmentWriter { | |
| return Err(SpannSegmentWriterError::InvalidArgument); | ||
| } | ||
|
|
||
| let reconciled_schema = Schema::reconcile_schema_and_config( | ||
| collection.schema.as_ref(), | ||
| Some(&collection.config), | ||
| KnnIndex::Spann, | ||
| ) | ||
| .map_err(SpannSegmentWriterError::InvalidSchema)?; | ||
| let schema = if let Some(schema) = &collection.schema { | ||
| schema.clone() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why clone here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because i cant do collection.schema directly, i have to borrow the schema with as_ref the other alternative would be to borrow collection.schema directly. this works, just want to confirm this is safe? |
||
| } else { | ||
| Schema::convert_collection_config_to_schema(&collection.config, KnnIndex::Spann) | ||
| .map_err(SpannSegmentWriterError::InvalidSchema)? | ||
| }; | ||
|
|
||
| let params = reconciled_schema | ||
| let params = schema | ||
| .get_internal_spann_config() | ||
| .ok_or(SpannSegmentWriterError::MissingSpannConfiguration)?; | ||
|
|
||
|
|
@@ -690,8 +690,8 @@ mod test { | |
| ..Default::default() | ||
| }; | ||
| collection.schema = Some( | ||
| Schema::reconcile_schema_and_config(None, Some(&collection.config), KnnIndex::Spann) | ||
| .expect("Error reconciling schema for test collection"), | ||
| Schema::convert_collection_config_to_schema(&collection.config, KnnIndex::Spann) | ||
| .expect("Error converting config to schema for test collection"), | ||
| ); | ||
|
|
||
| let pl_block_size = 5 * 1024 * 1024; | ||
|
|
@@ -927,8 +927,8 @@ mod test { | |
| ..Default::default() | ||
| }; | ||
| collection.schema = Some( | ||
| Schema::reconcile_schema_and_config(None, Some(&collection.config), KnnIndex::Spann) | ||
| .expect("Error reconciling schema for test collection"), | ||
| Schema::convert_collection_config_to_schema(&collection.config, KnnIndex::Spann) | ||
| .expect("Error converting config to schema for test collection"), | ||
| ); | ||
|
|
||
| let pl_block_size = 5 * 1024 * 1024; | ||
|
|
@@ -1089,8 +1089,8 @@ mod test { | |
| ..Default::default() | ||
| }; | ||
| collection.schema = Some( | ||
| Schema::reconcile_schema_and_config(None, Some(&collection.config), KnnIndex::Spann) | ||
| .expect("Error reconciling schema for test collection"), | ||
| Schema::convert_collection_config_to_schema(&collection.config, KnnIndex::Spann) | ||
| .expect("Error converting config to schema for test collection"), | ||
| ); | ||
|
|
||
| let segment_id = SegmentUuid::new(); | ||
|
|
@@ -1220,8 +1220,8 @@ mod test { | |
| ..Default::default() | ||
| }; | ||
| collection.schema = Some( | ||
| Schema::reconcile_schema_and_config(None, Some(&collection.config), KnnIndex::Spann) | ||
| .expect("Error reconciling schema for test collection"), | ||
| Schema::convert_collection_config_to_schema(&collection.config, KnnIndex::Spann) | ||
| .expect("Error converting config to schema for test collection"), | ||
| ); | ||
|
|
||
| let pl_block_size = 5 * 1024 * 1024; | ||
|
|
||
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.
have we tested that schema is None and not {} for older collections?
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.
yes