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