diff --git a/internal/datacoord/task_index.go b/internal/datacoord/task_index.go index ed75d885b4..abb3fb0f79 100644 --- a/internal/datacoord/task_index.go +++ b/internal/datacoord/task_index.go @@ -204,7 +204,8 @@ func (it *indexBuildTask) PreCheck(ctx context.Context, dependency *taskSchedule // vector index build needs information of optional scalar fields data optionalFields := make([]*indexpb.OptionalFieldInfo, 0) partitionKeyIsolation := false - if Params.CommonCfg.EnableMaterializedView.GetAsBool() && isOptionalScalarFieldSupported(indexType) && typeutil.IsDenseFloatVectorType(field.DataType) { + isVectorTypeSupported := typeutil.IsDenseFloatVectorType(field.DataType) || typeutil.IsBinaryVectorType(field.DataType) + if Params.CommonCfg.EnableMaterializedView.GetAsBool() && isOptionalScalarFieldSupported(indexType) && isVectorTypeSupported { if collectionInfo == nil { log.Ctx(ctx).Warn("get collection failed", zap.Int64("collID", segIndex.CollectionID), zap.Error(err)) it.SetState(indexpb.JobState_JobStateInit, err.Error()) diff --git a/internal/datacoord/task_scheduler_test.go b/internal/datacoord/task_scheduler_test.go index 792d72bbe3..46aa5a655e 100644 --- a/internal/datacoord/task_scheduler_test.go +++ b/internal/datacoord/task_scheduler_test.go @@ -1665,7 +1665,6 @@ func (s *taskSchedulerSuite) Test_indexTaskWithMvOptionalScalarField() { s.Run("enqueue returns empty when vector type is not dense vector", func() { paramtable.Get().CommonCfg.EnableMaterializedView.SwapTempValue("true") for _, dataType := range []schemapb.DataType{ - schemapb.DataType_BinaryVector, schemapb.DataType_SparseFloatVector, } { mt.collections[collID].Schema.Fields[0].DataType = dataType