fix: [2.5] skip dim check for non-vector fields in PreCheck (#41287) (#41329)

issue: https://github.com/milvus-io/milvus/issues/41287
pr: https://github.com/milvus-io/milvus/pull/41289

Signed-off-by: Sangho Park <hoyaspark@gmail.com>
pull/41383/head
박상호 2025-04-16 12:32:33 +09:00 committed by GitHub
parent ebe1b1c9a9
commit 741838a1dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 5 deletions

View File

@ -205,11 +205,15 @@ func (it *indexBuildTask) PreCheck(ctx context.Context, dependency *taskSchedule
}
}
dim, err := storage.GetDimFromParams(field.GetTypeParams())
if err != nil {
log.Ctx(ctx).Warn("failed to get dim from field type params",
zap.String("field type", field.GetDataType().String()), zap.Error(err))
// don't return, maybe field is scalar field or sparseFloatVector
// Extract dim only for vector types to avoid unnecessary warnings
dim := -1
if typeutil.IsFixDimVectorType(field.GetDataType()) {
if dimVal, err := storage.GetDimFromParams(field.GetTypeParams()); err != nil {
log.Ctx(ctx).Warn("failed to get dim from field type params",
zap.String("field type", field.GetDataType().String()), zap.Error(err))
} else {
dim = dimVal
}
}
// vector index build needs information of optional scalar fields data