milvus-io / milvus-sdk-go

Go SDK for Milvus.
Apache License 2.0
326 stars 105 forks source link

[Bug]: Check data type(string) failed #579

Open fresh7849 opened 11 months ago

fresh7849 commented 11 months ago

Is there an existing issue for this?

Current Behavior

param column xxx has type type:String field_name:\"xxx\" but collection field definition is string

Expected Behavior

check string type should be passed.

The code

if column.Type() != field.DataType {
    return nil, 0, fmt.Errorf("param column %s has type %v but collection field definition is %v", column.Name(), column.FieldData(), field.DataType)
}

should change to

if column.Type().String() != field.DataType.String() {
    return nil, 0, fmt.Errorf("param column %s has type %v but collection field definition is %v", column.Name(), column.FieldData(), field.DataType)
}

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

xiaofan-luan commented 11 months ago

use varchar instead of string

fanchunke commented 11 months ago

I use varchar as field type,insert is ok,but when upsert,it raise "param column xxx has type type:String field_name:"xxx" but collection field definition is string" @xiaofan-luan