mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix Int8~Int32 empty result set type (#23852)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
7f5294b1ef
commit
2cacda0d95
@ -20,6 +20,19 @@ func genEmptyBoolFieldData(field *schemapb.FieldSchema) *schemapb.FieldData {
|
||||
}
|
||||
|
||||
func genEmptyIntFieldData(field *schemapb.FieldSchema) *schemapb.FieldData {
|
||||
return &schemapb.FieldData{
|
||||
Type: field.GetDataType(),
|
||||
FieldName: field.GetName(),
|
||||
Field: &schemapb.FieldData_Scalars{
|
||||
Scalars: &schemapb.ScalarField{
|
||||
Data: &schemapb.ScalarField_IntData{IntData: &schemapb.IntArray{Data: nil}},
|
||||
},
|
||||
},
|
||||
FieldId: field.GetFieldID(),
|
||||
}
|
||||
}
|
||||
|
||||
func genEmptyLongFieldData(field *schemapb.FieldSchema) *schemapb.FieldData {
|
||||
return &schemapb.FieldData{
|
||||
Type: field.GetDataType(),
|
||||
FieldName: field.GetName(),
|
||||
@ -142,8 +155,10 @@ func GenEmptyFieldData(field *schemapb.FieldSchema) (*schemapb.FieldData, error)
|
||||
switch dataType {
|
||||
case schemapb.DataType_Bool:
|
||||
return genEmptyBoolFieldData(field), nil
|
||||
case schemapb.DataType_Int8, schemapb.DataType_Int16, schemapb.DataType_Int32, schemapb.DataType_Int64:
|
||||
case schemapb.DataType_Int8, schemapb.DataType_Int16, schemapb.DataType_Int32:
|
||||
return genEmptyIntFieldData(field), nil
|
||||
case schemapb.DataType_Int64:
|
||||
return genEmptyLongFieldData(field), nil
|
||||
case schemapb.DataType_Float:
|
||||
return genEmptyFloatFieldData(field), nil
|
||||
case schemapb.DataType_Double:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user