MCPcopy Create free account
hub / github.com/cosdata/cosdata / metadata_replica_set

Function metadata_replica_set

src/vector_store.rs:494–501  ·  view source on GitHub ↗

Computes "metadata replica sets" i.e. all metadata dimensions along based on the metadata `schema`. This includes both base and metadata dimensions. Note that the first item in the result will correspond to the base dimensions. This can be used as an assumption. If `fields` is None or an empty map, it will return a vector with a single item i.e. the base dimensions.

(
    schema: &MetadataSchema,
    fields: Option<&MetadataFields>,
)

Source from the content-addressed store, hash-verified

492/// If `fields` is None or an empty map, it will return a vector with
493/// a single item i.e. the base dimensions.
494fn metadata_replica_set(
495 schema: &MetadataSchema,
496 fields: Option<&MetadataFields>,
497) -> Result<Vec<Metadata>, WaCustomError> {
498 let dims = fields_to_dimensions(schema, fields).map_err(WaCustomError::MetadataError)?;
499 let replicas = dims.into_iter().map(Metadata::from).collect();
500 Ok(replicas)
501}
502
503/// Returns a vector of `NodePropMetadata` instances based on the
504/// collection `schema` and `metadata_fields` as per the following

Callers 1

prop_metadata_replicasFunction · 0.85

Calls 1

fields_to_dimensionsFunction · 0.85

Tested by

no test coverage detected