mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
enhance: [2.4] remove warnings when there is no partition key set (#36679)
issue: #36673 Signed-off-by: Patrick Weizhi Xu <weizhi.xu@zilliz.com> (cherry picked from commit db60f7cf2a56656b101067a2dbebd4dd32ed6ed2)
This commit is contained in:
parent
f7302a78fb
commit
6e93601b2c
@ -216,24 +216,20 @@ func (it *indexBuildTask) PreCheck(ctx context.Context, dependency *taskSchedule
|
||||
it.SetState(indexpb.JobState_JobStateInit, err.Error())
|
||||
return true
|
||||
}
|
||||
partitionKeyField, err := typeutil.GetPartitionKeyFieldSchema(schema)
|
||||
if partitionKeyField == nil || err != nil {
|
||||
log.Ctx(ctx).Warn("index builder get partition key field failed", zap.Int64("taskID", it.taskID), zap.Error(err))
|
||||
} else {
|
||||
if typeutil.IsFieldDataTypeSupportMaterializedView(partitionKeyField) {
|
||||
optionalFields = append(optionalFields, &indexpb.OptionalFieldInfo{
|
||||
FieldID: partitionKeyField.FieldID,
|
||||
FieldName: partitionKeyField.Name,
|
||||
FieldType: int32(partitionKeyField.DataType),
|
||||
DataIds: getBinLogIDs(segment, partitionKeyField.FieldID),
|
||||
})
|
||||
iso, isoErr := common.IsPartitionKeyIsolationPropEnabled(collectionInfo.Properties)
|
||||
if isoErr != nil {
|
||||
log.Ctx(ctx).Warn("failed to parse partition key isolation", zap.Error(isoErr))
|
||||
}
|
||||
if iso {
|
||||
partitionKeyIsolation = true
|
||||
}
|
||||
partitionKeyField, _ := typeutil.GetPartitionKeyFieldSchema(schema)
|
||||
if partitionKeyField != nil && typeutil.IsFieldDataTypeSupportMaterializedView(partitionKeyField) {
|
||||
optionalFields = append(optionalFields, &indexpb.OptionalFieldInfo{
|
||||
FieldID: partitionKeyField.FieldID,
|
||||
FieldName: partitionKeyField.Name,
|
||||
FieldType: int32(partitionKeyField.DataType),
|
||||
DataIds: getBinLogIDs(segment, partitionKeyField.FieldID),
|
||||
})
|
||||
iso, isoErr := common.IsPartitionKeyIsolationPropEnabled(collectionInfo.Properties)
|
||||
if isoErr != nil {
|
||||
log.Ctx(ctx).Warn("failed to parse partition key isolation", zap.Error(isoErr))
|
||||
}
|
||||
if iso {
|
||||
partitionKeyIsolation = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user