SimFG 91d40fa558
fix: Update logging context and upgrade dependencies (#41318)
- issue: #41291

---------

Signed-off-by: SimFG <bang.fu@zilliz.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-04-23 10:52:38 +08:00

29 lines
729 B
Go

package indexparamcheck
import (
"github.com/cockroachdb/errors"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/pkg/v2/util/typeutil"
)
// TRIEChecker checks if a TRIE index can be built.
type TRIEChecker struct {
scalarIndexChecker
}
func (c *TRIEChecker) CheckTrain(dataType schemapb.DataType, params map[string]string) error {
return c.scalarIndexChecker.CheckTrain(dataType, params)
}
func (c *TRIEChecker) CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error {
if !typeutil.IsStringType(field.GetDataType()) {
return errors.New("TRIE are only supported on varchar field")
}
return nil
}
func newTRIEChecker() *TRIEChecker {
return &TRIEChecker{}
}