Documentation ¶
Index ¶
- Constants
- Variables
- func CheckCollection(t *testing.T, actualCollection *entity.Collection, expCollName string, ...)
- func CheckContainsCollection(t *testing.T, collections []*entity.Collection, collName string)
- func CheckContainsDb(t *testing.T, dbs []entity.Database, dbName string)
- func CheckErr(t *testing.T, actualErr error, expErrNil bool, expErrorMsg ...string)
- func CheckIndexResult(t *testing.T, actualIndexes []entity.Index, expIndexes ...entity.Index)
- func CheckInsertResult(t *testing.T, actualIds entity.Column, expIds entity.Column)
- func CheckNotContainsCollection(t *testing.T, collections []*entity.Collection, collName string)
- func CheckNotContainsDb(t *testing.T, dbs []entity.Database, dbName string)
- func CheckOutputFields(t *testing.T, actualColumns []entity.Column, expFields []string)
- func CheckPersistentSegments(t *testing.T, actualSegments []*entity.Segment, expNb int64)
- func CheckQueryResult(t *testing.T, actualColumns []entity.Column, expColumns []entity.Column)
- func CheckResourceGroup(t *testing.T, actualRg *entity.ResourceGroup, expRg *entity.ResourceGroup)
- func CheckSearchResult(t *testing.T, actualSearchResults []client.SearchResult, expNq int, ...)
- func EqualColumn(t *testing.T, columnA entity.Column, columnB entity.Column)
- func EqualFields(t *testing.T, fieldA *entity.Field, fieldB *entity.Field)
- func EqualSchema(t *testing.T, schemaA entity.Schema, schemaB entity.Schema)
- func GenAllFields() []*entity.Field
- func GenAllFieldsData(start int, nb int, dim int64) []entity.Column
- func GenAllFieldsRows(start int, nb int, dim int64, enableDynamicField bool) []interface{}
- func GenAllFloatIndex(metricType entity.MetricType) []entity.Index
- func GenColumnData(start int, nb int, fieldType entity.FieldType, fieldName string, ...) entity.Column
- func GenDefaultBinaryData(start int, nb int, dim int64) (entity.Column, entity.Column, entity.Column)
- func GenDefaultBinaryFields(autoID bool, dim int64) []*entity.Field
- func GenDefaultBinaryRows(start int, nb int, dim int64, enableDynamicField bool) []interface{}
- func GenDefaultColumnData(start int, nb int, dim int64) (entity.Column, entity.Column, entity.Column)
- func GenDefaultFields(autoID bool) []*entity.Field
- func GenDefaultJSONData(columnName string, start int, nb int) *entity.ColumnJSONBytes
- func GenDefaultJSONRows(start int, nb int, dim int64, enableDynamicField bool) []interface{}
- func GenDefaultRows(start int, nb int, dim int64, enableDynamicField bool) []interface{}
- func GenDefaultVarcharData(start int, nb int, dim int64) (entity.Column, entity.Column)
- func GenDefaultVarcharFields(autoID bool) []*entity.Field
- func GenDefaultVarcharRows(start int, nb int, dim int64, enableDynamicField bool) []interface{}
- func GenDynamicFieldData(start int, nb int) []entity.Column
- func GenField(name string, fieldType entity.FieldType, opts ...CreateFieldOption) *entity.Field
- func GenLongString(n int) string
- func GenRandomString(n int) string
- func GenSchema(name string, autoID bool, fields []*entity.Field, opts ...CreateSchemaOption) *entity.Schema
- func GenSearchVectors(nq int, dim int64, dataType entity.FieldType) []entity.Vector
- func MergeColumnsToDynamic(nb int, columns []entity.Column) *entity.ColumnJSONBytes
- type CreateFieldOption
- func WithAutoID(autoID bool) CreateFieldOption
- func WithDim(dim int64) CreateFieldOption
- func WithFieldDescription(desc string) CreateFieldOption
- func WithIsPartitionKey(isPartitionKey bool) CreateFieldOption
- func WithIsPrimaryKey(isPrimaryKey bool) CreateFieldOption
- func WithMaxLength(maxLen int64) CreateFieldOption
- func WithTypeParams(key string, value string) CreateFieldOption
- type CreateSchemaOption
- type Dynamic
- type GenColumnDataOption
Constants ¶
const ( DefaultIntFieldName = "int64" DefaultFloatFieldName = "float" DefaultVarcharFieldName = "varchar" DefaultJSONFieldName = "json" DefaultFloatVecFieldName = "floatVec" DefaultBinaryVecFieldName = "binaryVec" DefaultDynamicNumberField = "dynamicNumber" DefaultDynamicStringField = "dynamicString" DefaultDynamicBoolField = "dynamicBool" DefaultDynamicListField = "dynamicList" RowCount = "row_count" DefaultTimeout = 120 DefaultDim = int64(128) DefaultShards = int32(2) DefaultNb = 3000 DefaultNq = 5 DefaultTopK = 10 )
const default value for test
const ( MaxPartitionNum = 4096 DefaultDynamicFieldName = "$meta" DefaultPartition = "_default" DefaultIndexName = "_default_idx_102" DefaultIndexNameBinary = "_default_idx_100" DefaultRgName = "__default_resource_group" DefaultDb = "default" DefaultConsistencyLevel = entity.ClBounded MaxDim = 32768 DefaultMaxLength = int64(65535) MaxCollectionNameLen = 255 DefaultRgCapacity = 1000000 RetentionDuration = 40 // common.retentionDuration )
const default value from milvus
Variables ¶
var IndexStateValue = map[string]int32{
"IndexStateNone": 0,
"Unissued": 1,
"InProgress": 2,
"Finished": 3,
"Failed": 4,
"Retry": 5,
}
Functions ¶
func CheckCollection ¶
func CheckCollection(t *testing.T, actualCollection *entity.Collection, expCollName string, expShardNum int32, expSchema *entity.Schema, expConsistencyLevel entity.ConsistencyLevel)
CheckCollection check collection
func CheckContainsCollection ¶
func CheckContainsCollection(t *testing.T, collections []*entity.Collection, collName string)
CheckContainsCollection check collections contains collName
func CheckContainsDb ¶
CheckContainsDb check collections contains collName
func CheckIndexResult ¶
CheckIndexResult check index result, index type, metric type, index params
func CheckInsertResult ¶
CheckInsertResult check insert result, ids len (insert count), ids data (pks, but no auto ids)
func CheckNotContainsCollection ¶
func CheckNotContainsCollection(t *testing.T, collections []*entity.Collection, collName string)
CheckNotContainsCollection check collections not contains collName
func CheckNotContainsDb ¶
CheckNotContainsDb check collections contains collName
func CheckOutputFields ¶
CheckOutputFields check query output fields
func CheckPersistentSegments ¶
CheckPersistentSegments check persistent segments
func CheckQueryResult ¶
CheckQueryResult check query result, column name, type and field
func CheckResourceGroup ¶
func CheckResourceGroup(t *testing.T, actualRg *entity.ResourceGroup, expRg *entity.ResourceGroup)
func CheckSearchResult ¶
func CheckSearchResult(t *testing.T, actualSearchResults []client.SearchResult, expNq int, expTopK int)
CheckSearchResult check search result, check nq, topk, ids, score
func EqualColumn ¶
EqualColumn assert field data is equal of two columns
func EqualFields ¶
EqualFields equal two fields
func EqualSchema ¶
EqualSchema equal two schemas
func GenAllFields ¶
GenAllFields gen fields with all scala field types
func GenAllFieldsRows ¶
func GenAllFloatIndex ¶
func GenAllFloatIndex(metricType entity.MetricType) []entity.Index
GenAllFloatIndex gen all float vector index
func GenColumnData ¶
func GenColumnData(start int, nb int, fieldType entity.FieldType, fieldName string, opts ...GenColumnDataOption) entity.Column
GenColumnData GenColumnDataOption
func GenDefaultBinaryData ¶
func GenDefaultBinaryData(start int, nb int, dim int64) (entity.Column, entity.Column, entity.Column)
GenDefaultBinaryData gen default binary collection data
func GenDefaultBinaryFields ¶
GenDefaultBinaryFields gen default binary fields with int64, float, binaryVector field
func GenDefaultBinaryRows ¶
func GenDefaultColumnData ¶
func GenDefaultColumnData(start int, nb int, dim int64) (entity.Column, entity.Column, entity.Column)
GenDefaultColumnData gen default column with data
func GenDefaultFields ¶
GenDefaultFields gen default fields with int64, float, floatVector field
func GenDefaultJSONData ¶
func GenDefaultJSONData(columnName string, start int, nb int) *entity.ColumnJSONBytes
GenDefaultJSONData gen default column with data
func GenDefaultJSONRows ¶
func GenDefaultRows ¶
func GenDefaultVarcharData ¶
func GenDefaultVarcharFields ¶
GenDefaultVarcharFields gen default fields with varchar, floatVector field
func GenDefaultVarcharRows ¶
func GenSchema ¶
func GenSchema(name string, autoID bool, fields []*entity.Field, opts ...CreateSchemaOption) *entity.Schema
gen schema
func GenSearchVectors ¶
GenSearchVectors gen search vectors
func MergeColumnsToDynamic ¶
func MergeColumnsToDynamic(nb int, columns []entity.Column) *entity.ColumnJSONBytes
Types ¶
type CreateFieldOption ¶
CreateFieldOption is an option that is used to modify entity.Schema
func WithAutoID ¶
func WithAutoID(autoID bool) CreateFieldOption
func WithDim ¶
func WithDim(dim int64) CreateFieldOption
func WithFieldDescription ¶
func WithFieldDescription(desc string) CreateFieldOption
func WithIsPartitionKey ¶
func WithIsPartitionKey(isPartitionKey bool) CreateFieldOption
func WithIsPrimaryKey ¶
func WithIsPrimaryKey(isPrimaryKey bool) CreateFieldOption
func WithMaxLength ¶
func WithMaxLength(maxLen int64) CreateFieldOption
func WithTypeParams ¶
func WithTypeParams(key string, value string) CreateFieldOption
type CreateSchemaOption ¶
CreateSchemaOption is an option that is used to modify entity.Schema
func WithDescription ¶
func WithDescription(desc string) CreateSchemaOption
func WithEnableDynamicField ¶
func WithEnableDynamicField(enableDF bool) CreateSchemaOption
type GenColumnDataOption ¶
type GenColumnDataOption func(opt *genDataOpt)
func WithVectorDim ¶
func WithVectorDim(dim int64) GenColumnDataOption