mirror of https://github.com/milvus-io/milvus.git
## What this PR does This PR fixes an issue where the `PreCheck` function in DataCoord logs unnecessary warnings when attempting to retrieve 'dim' from non-vector fields. The change adds a check to only call `GetDimFromParams` when the field type is a vector type. ## Related issue Fixes #41287 --------- Signed-off-by: 박상호 <sangho@rapportlabs.kr> Signed-off-by: Sangho Park <hoyaspark@gmail.com>pull/40323/head^2
parent
a6606ce9c6
commit
4be6d0e967
|
@ -207,11 +207,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
|
||||
|
|
Loading…
Reference in New Issue