mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
1f43be4a3c
issue: #29309 reopen pr : #29310 Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
29 lines
652 B
Go
29 lines
652 B
Go
package indexparamcheck
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
|
|
"github.com/milvus-io/milvus/pkg/util/typeutil"
|
|
)
|
|
|
|
// STLSORTChecker checks if a STL_SORT index can be built.
|
|
type STLSORTChecker struct {
|
|
scalarIndexChecker
|
|
}
|
|
|
|
func (c *STLSORTChecker) CheckTrain(params map[string]string) error {
|
|
return c.scalarIndexChecker.CheckTrain(params)
|
|
}
|
|
|
|
func (c *STLSORTChecker) CheckValidDataType(dType schemapb.DataType) error {
|
|
if !typeutil.IsArithmetic(dType) {
|
|
return fmt.Errorf("STL_SORT are only supported on numeric field")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func newSTLSORTChecker() *STLSORTChecker {
|
|
return &STLSORTChecker{}
|
|
}
|