milvus/pkg/util/indexparamcheck/base_checker.go
Jiquan Long 29ae1229b6
Support AutoIndex (#24387)
Signed-off-by: longjiquan <jiquan.long@zilliz.com>
2023-05-29 20:35:28 +08:00

33 lines
791 B
Go

package indexparamcheck
import (
"github.com/cockroachdb/errors"
"github.com/milvus-io/milvus-proto/go-api/schemapb"
)
type baseChecker struct {
}
func (c baseChecker) CheckTrain(params map[string]string) error {
if !CheckIntByRange(params, DIM, DefaultMinDim, DefaultMaxDim) {
return errOutOfRange(DIM, DefaultMinDim, DefaultMaxDim)
}
return nil
}
// CheckValidDataType check whether the field data type is supported for the index type
func (c baseChecker) CheckValidDataType(dType schemapb.DataType) error {
return nil
}
func (c baseChecker) SetDefaultMetricTypeIfNotExist(m map[string]string) {}
func (c baseChecker) StaticCheck(params map[string]string) error {
return errors.New("unsupported index type")
}
func newBaseChecker() IndexChecker {
return &baseChecker{}
}