From 94c3f114eb637667314eecc5a9785fd4b4516a8a Mon Sep 17 00:00:00 2001 From: Spade A <71589810+SpadeA-Tang@users.noreply.github.com> Date: Mon, 20 Oct 2025 10:34:03 +0800 Subject: [PATCH] fix: reject GEOMETRY and TIMESTAMPTZ in STRUCT [2.6] (#44938) issue: https://github.com/milvus-io/milvus/issues/44930 pr: https://github.com/milvus-io/milvus/pull/44937 Signed-off-by: SpadeA --- internal/proxy/util.go | 8 ++------ internal/proxy/util_test.go | 5 ++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/internal/proxy/util.go b/internal/proxy/util.go index 479bc860ca..b56826d4fa 100644 --- a/internal/proxy/util.go +++ b/internal/proxy/util.go @@ -654,13 +654,9 @@ func ValidateFieldsInStruct(field *schemapb.FieldSchema, schema *schemapb.Collec return fmt.Errorf("Nested array is not supported %s", field.Name) } - if field.ElementType == schemapb.DataType_JSON { - return fmt.Errorf("JSON is not supported for fields in struct, fieldName = %s", field.Name) - } - if field.DataType == schemapb.DataType_Array { - if typeutil.IsVectorType(field.GetElementType()) { - return fmt.Errorf("Inconsistent schema: element type of array field %s is a vector type", field.Name) + if err := validateElementType(field.GetElementType()); err != nil { + return err } } else { // TODO(SpadeA): only support float vector now diff --git a/internal/proxy/util_test.go b/internal/proxy/util_test.go index 00fb872dfa..5df2d6eda9 100644 --- a/internal/proxy/util_test.go +++ b/internal/proxy/util_test.go @@ -3908,7 +3908,7 @@ func TestValidateFieldsInStruct(t *testing.T) { } err := ValidateFieldsInStruct(field, schema) assert.Error(t, err) - assert.Contains(t, err.Error(), "JSON is not supported for fields in struct") + assert.Contains(t, err.Error(), "is not supported") }) t.Run("nested array not supported", func(t *testing.T) { @@ -3940,7 +3940,7 @@ func TestValidateFieldsInStruct(t *testing.T) { } err := ValidateFieldsInStruct(field, schema) assert.Error(t, err) - assert.Contains(t, err.Error(), "element type of array field array_with_vector is a vector type") + assert.Contains(t, err.Error(), "element type FloatVector is not supported") }) t.Run("array of vector field with non-vector element type", func(t *testing.T) { @@ -4054,7 +4054,6 @@ func TestValidateFieldsInStruct(t *testing.T) { schemapb.DataType_Int64, schemapb.DataType_Float, schemapb.DataType_Double, - schemapb.DataType_String, } for _, dt := range validScalarTypes {