milvus-io/milvus-sdk-rust

[Bug]: Failed to create a collection with a FieldSchema of `varchar` type

apepkuss opened this issue · 0 comments

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Milvus server returns an error below while creating a collection that has a field of VarChar type:

Error: Server(UnexpectedError, "string data type not supported yet, please use VarChar type instead")

The example code:

#[tokio::main]
async fn main() -> Result<(), Error> {
    const URL: &str = "http://localhost:19530";

    let client = Client::new(URL).await?;

    let schema =
        CollectionSchemaBuilder::new("hello_milvus", "a guide example for milvus rust SDK")
            .add_field(FieldSchema::new_primary_int64("id", "", true))
            .add_field(FieldSchema::new_varchar("name", "desc", 64))  // trigger error here
            .add_field(FieldSchema::new_float_vector(DEFAULT_VEC_FIELD, "", 256))
            .build()?;
    let collection = client.create_collection(schema.clone(), None).await?;

    collection.drop().await?;

    Ok(())
}