From 6027647c000f68bf100e7a32e862807c9852242d Mon Sep 17 00:00:00 2001 From: Jiquan Long Date: Wed, 7 Aug 2024 14:32:22 +0800 Subject: [PATCH] fix: error message when input is not aligned (#35322) (#35324) fix: https://github.com/milvus-io/milvus/issues/35321 pr: https://github.com/milvus-io/milvus/pull/35322 Signed-off-by: longjiquan --- internal/proxy/validate_util.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/proxy/validate_util.go b/internal/proxy/validate_util.go index 8a285bf86c..3fe69366fd 100644 --- a/internal/proxy/validate_util.go +++ b/internal/proxy/validate_util.go @@ -123,9 +123,9 @@ func (v *validateUtil) Validate(data []*schemapb.FieldData, schema *schemapb.Col } func (v *validateUtil) checkAligned(data []*schemapb.FieldData, schema *typeutil.SchemaHelper, numRows uint64) error { - errNumRowsMismatch := func(fieldName string, fieldNumRows, passedNumRows uint64) error { - msg := fmt.Sprintf("the num_rows (%d) of field (%s) is not equal to passed num_rows (%d)", fieldNumRows, fieldName, passedNumRows) - return merr.WrapErrParameterInvalid(passedNumRows, numRows, msg) + errNumRowsMismatch := func(fieldName string, fieldNumRows uint64) error { + msg := fmt.Sprintf("the num_rows (%d) of field (%s) is not equal to passed num_rows (%d)", fieldNumRows, fieldName, numRows) + return merr.WrapErrParameterInvalid(numRows, fieldNumRows, msg) } errDimMismatch := func(fieldName string, dataDim int64, schemaDim int64) error { msg := fmt.Sprintf("the dim (%d) of field data(%s) is not equal to schema dim (%d)", dataDim, fieldName, schemaDim) @@ -154,7 +154,7 @@ func (v *validateUtil) checkAligned(data []*schemapb.FieldData, schema *typeutil } if n != numRows { - return errNumRowsMismatch(field.GetFieldName(), n, numRows) + return errNumRowsMismatch(field.GetFieldName(), n) } case schemapb.DataType_BinaryVector: @@ -178,7 +178,7 @@ func (v *validateUtil) checkAligned(data []*schemapb.FieldData, schema *typeutil } if n != numRows { - return errNumRowsMismatch(field.GetFieldName(), n, numRows) + return errNumRowsMismatch(field.GetFieldName(), n) } default: @@ -189,7 +189,7 @@ func (v *validateUtil) checkAligned(data []*schemapb.FieldData, schema *typeutil } if n != numRows { - return errNumRowsMismatch(field.GetFieldName(), n, numRows) + return errNumRowsMismatch(field.GetFieldName(), n) } } }