column

package
v2.0.0-...-accfacf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column interface {
	Name() string
	Type() entity.FieldType
	Len() int
	Slice(int, int) Column
	FieldData() *schemapb.FieldData
	AppendValue(interface{}) error
	Get(int) (interface{}, error)
	GetAsInt64(int) (int64, error)
	GetAsString(int) (string, error)
	GetAsDouble(int) (float64, error)
	GetAsBool(int) (bool, error)
	// nullable related API
	AppendNull() error
	IsNull(int) (bool, error)
	Nullable() bool
}

Column interface field type for column-based data frame

func FieldDataColumn

func FieldDataColumn(fd *schemapb.FieldData, begin, end int) (Column, error)

FieldDataColumn converts schemapb.FieldData to Column, used int search result conversion logic begin, end specifies the start and end positions

func IDColumns

func IDColumns(schema *entity.Schema, ids *schemapb.IDs, begin, end int) (Column, error)

IDColumns converts schemapb.IDs to corresponding column currently Int64 / string may be in IDs

type ColumnBFloat16Vector

type ColumnBFloat16Vector struct {
	// contains filtered or unexported fields
}

func NewColumnBFloat16Vector

func NewColumnBFloat16Vector(fieldName string, dim int, data [][]byte) *ColumnBFloat16Vector

func NewColumnBFloat16VectorFromFp32Vector

func NewColumnBFloat16VectorFromFp32Vector(fieldName string, dim int, data [][]float32) *ColumnBFloat16Vector

func (*ColumnBFloat16Vector) AppendValue

func (c *ColumnBFloat16Vector) AppendValue(i interface{}) error

AppendValue appends vector value into values. Override default type constrains, add `[]byte`, `entity.FloatVector` and `[]float32` conversion.

func (ColumnBFloat16Vector) Dim

func (b ColumnBFloat16Vector) Dim() int

func (ColumnBFloat16Vector) FieldData

func (b ColumnBFloat16Vector) FieldData() *schemapb.FieldData

func (*ColumnBFloat16Vector) Slice

func (c *ColumnBFloat16Vector) Slice(start, end int) Column

type ColumnBinaryVector

type ColumnBinaryVector struct {
	// contains filtered or unexported fields
}

func NewColumnBinaryVector

func NewColumnBinaryVector(fieldName string, dim int, data [][]byte) *ColumnBinaryVector

func (*ColumnBinaryVector) AppendValue

func (c *ColumnBinaryVector) AppendValue(i interface{}) error

AppendValue appends vector value into values. override default type constrains, add `[]byte` conversion

func (ColumnBinaryVector) Dim

func (b ColumnBinaryVector) Dim() int

func (ColumnBinaryVector) FieldData

func (b ColumnBinaryVector) FieldData() *schemapb.FieldData

func (*ColumnBinaryVector) Slice

func (c *ColumnBinaryVector) Slice(start, end int) Column

type ColumnBool

type ColumnBool struct {
	// contains filtered or unexported fields
}

func NewColumnBool

func NewColumnBool(name string, values []bool) *ColumnBool

func (ColumnBool) AppendNull

func (c ColumnBool) AppendNull() error

func (ColumnBool) AppendValue

func (c ColumnBool) AppendValue(a any) error

func (ColumnBool) Data

func (c ColumnBool) Data() []T

func (ColumnBool) FieldData

func (c ColumnBool) FieldData() *schemapb.FieldData

func (ColumnBool) Get

func (c ColumnBool) Get(idx int) (any, error)

func (ColumnBool) GetAsBool

func (c ColumnBool) GetAsBool(idx int) (bool, error)

func (ColumnBool) GetAsDouble

func (c ColumnBool) GetAsDouble(idx int) (float64, error)

func (ColumnBool) GetAsInt64

func (c ColumnBool) GetAsInt64(idx int) (int64, error)

func (ColumnBool) GetAsString

func (c ColumnBool) GetAsString(idx int) (string, error)

func (ColumnBool) IsNull

func (c ColumnBool) IsNull(idx int) (bool, error)

func (ColumnBool) Len

func (c ColumnBool) Len() int

func (ColumnBool) MustValue

func (c ColumnBool) MustValue(idx int) T

func (ColumnBool) Name

func (c ColumnBool) Name() string

Name returns column name.

func (ColumnBool) Nullable

func (c ColumnBool) Nullable() bool

func (*ColumnBool) Slice

func (c *ColumnBool) Slice(start, end int) Column

func (ColumnBool) Type

func (c ColumnBool) Type() entity.FieldType

Type returns corresponding field type. note that: it is not necessary to be 1-on-1 mapping say, `[]byte` could be lots of field type.

func (ColumnBool) Value

func (c ColumnBool) Value(idx int) (T, error)

type ColumnBoolArray

type ColumnBoolArray struct {
	// contains filtered or unexported fields
}

func NewColumnBoolArray

func NewColumnBoolArray(fieldName string, data [][]bool) *ColumnBoolArray

func (ColumnBoolArray) ElementType

func (c ColumnBoolArray) ElementType() entity.FieldType

func (ColumnBoolArray) FieldData

func (c ColumnBoolArray) FieldData() *schemapb.FieldData

func (*ColumnBoolArray) Slice

func (c *ColumnBoolArray) Slice(start, end int) Column

type ColumnDouble

type ColumnDouble struct {
	// contains filtered or unexported fields
}

func NewColumnDouble

func NewColumnDouble(name string, values []float64) *ColumnDouble

func (ColumnDouble) AppendNull

func (c ColumnDouble) AppendNull() error

func (ColumnDouble) AppendValue

func (c ColumnDouble) AppendValue(a any) error

func (ColumnDouble) Data

func (c ColumnDouble) Data() []T

func (ColumnDouble) FieldData

func (c ColumnDouble) FieldData() *schemapb.FieldData

func (ColumnDouble) Get

func (c ColumnDouble) Get(idx int) (any, error)

func (ColumnDouble) GetAsBool

func (c ColumnDouble) GetAsBool(idx int) (bool, error)

func (ColumnDouble) GetAsDouble

func (c ColumnDouble) GetAsDouble(idx int) (float64, error)

func (ColumnDouble) GetAsInt64

func (c ColumnDouble) GetAsInt64(idx int) (int64, error)

func (ColumnDouble) GetAsString

func (c ColumnDouble) GetAsString(idx int) (string, error)

func (ColumnDouble) IsNull

func (c ColumnDouble) IsNull(idx int) (bool, error)

func (ColumnDouble) Len

func (c ColumnDouble) Len() int

func (ColumnDouble) MustValue

func (c ColumnDouble) MustValue(idx int) T

func (ColumnDouble) Name

func (c ColumnDouble) Name() string

Name returns column name.

func (ColumnDouble) Nullable

func (c ColumnDouble) Nullable() bool

func (*ColumnDouble) Slice

func (c *ColumnDouble) Slice(start, end int) Column

func (ColumnDouble) Type

func (c ColumnDouble) Type() entity.FieldType

Type returns corresponding field type. note that: it is not necessary to be 1-on-1 mapping say, `[]byte` could be lots of field type.

func (ColumnDouble) Value

func (c ColumnDouble) Value(idx int) (T, error)

type ColumnDoubleArray

type ColumnDoubleArray struct {
	// contains filtered or unexported fields
}

func NewColumnDoubleArray

func NewColumnDoubleArray(fieldName string, data [][]float64) *ColumnDoubleArray

func (ColumnDoubleArray) ElementType

func (c ColumnDoubleArray) ElementType() entity.FieldType

func (ColumnDoubleArray) FieldData

func (c ColumnDoubleArray) FieldData() *schemapb.FieldData

func (*ColumnDoubleArray) Slice

func (c *ColumnDoubleArray) Slice(start, end int) Column

type ColumnDynamic

type ColumnDynamic struct {
	*ColumnJSONBytes
	// contains filtered or unexported fields
}

ColumnDynamic is a logically wrapper for dynamic json field with provided output field.

func NewColumnDynamic

func NewColumnDynamic(column *ColumnJSONBytes, outputField string) *ColumnDynamic

func (ColumnDynamic) AppendNull

func (c ColumnDynamic) AppendNull() error

func (ColumnDynamic) Data

func (c ColumnDynamic) Data() []T

func (*ColumnDynamic) Get

func (c *ColumnDynamic) Get(idx int) (interface{}, error)

Get returns element at idx as interface{}. Overrides internal json column behavior, returns raw json data.

func (*ColumnDynamic) GetAsBool

func (c *ColumnDynamic) GetAsBool(idx int) (bool, error)

func (*ColumnDynamic) GetAsDouble

func (c *ColumnDynamic) GetAsDouble(idx int) (float64, error)

func (*ColumnDynamic) GetAsInt64

func (c *ColumnDynamic) GetAsInt64(idx int) (int64, error)

func (*ColumnDynamic) GetAsString

func (c *ColumnDynamic) GetAsString(idx int) (string, error)

func (ColumnDynamic) IsNull

func (c ColumnDynamic) IsNull(idx int) (bool, error)

func (ColumnDynamic) Len

func (c ColumnDynamic) Len() int

func (ColumnDynamic) MustValue

func (c ColumnDynamic) MustValue(idx int) T

func (*ColumnDynamic) Name

func (c *ColumnDynamic) Name() string

func (ColumnDynamic) Nullable

func (c ColumnDynamic) Nullable() bool

func (ColumnDynamic) Type

func (c ColumnDynamic) Type() entity.FieldType

Type returns corresponding field type. note that: it is not necessary to be 1-on-1 mapping say, `[]byte` could be lots of field type.

func (ColumnDynamic) Value

func (c ColumnDynamic) Value(idx int) (T, error)

type ColumnFloat

type ColumnFloat struct {
	// contains filtered or unexported fields
}

func NewColumnFloat

func NewColumnFloat(name string, values []float32) *ColumnFloat

func (ColumnFloat) AppendNull

func (c ColumnFloat) AppendNull() error

func (ColumnFloat) AppendValue

func (c ColumnFloat) AppendValue(a any) error

func (ColumnFloat) Data

func (c ColumnFloat) Data() []T

func (ColumnFloat) FieldData

func (c ColumnFloat) FieldData() *schemapb.FieldData

func (ColumnFloat) Get

func (c ColumnFloat) Get(idx int) (any, error)

func (ColumnFloat) GetAsBool

func (c ColumnFloat) GetAsBool(idx int) (bool, error)

func (*ColumnFloat) GetAsDouble

func (c *ColumnFloat) GetAsDouble(idx int) (float64, error)

func (ColumnFloat) GetAsInt64

func (c ColumnFloat) GetAsInt64(idx int) (int64, error)

func (ColumnFloat) GetAsString

func (c ColumnFloat) GetAsString(idx int) (string, error)

func (ColumnFloat) IsNull

func (c ColumnFloat) IsNull(idx int) (bool, error)

func (ColumnFloat) Len

func (c ColumnFloat) Len() int

func (ColumnFloat) MustValue

func (c ColumnFloat) MustValue(idx int) T

func (ColumnFloat) Name

func (c ColumnFloat) Name() string

Name returns column name.

func (ColumnFloat) Nullable

func (c ColumnFloat) Nullable() bool

func (*ColumnFloat) Slice

func (c *ColumnFloat) Slice(start, end int) Column

func (ColumnFloat) Type

func (c ColumnFloat) Type() entity.FieldType

Type returns corresponding field type. note that: it is not necessary to be 1-on-1 mapping say, `[]byte` could be lots of field type.

func (ColumnFloat) Value

func (c ColumnFloat) Value(idx int) (T, error)

type ColumnFloat16Vector

type ColumnFloat16Vector struct {
	// contains filtered or unexported fields
}

func NewColumnFloat16Vector

func NewColumnFloat16Vector(fieldName string, dim int, data [][]byte) *ColumnFloat16Vector

func NewColumnFloat16VectorFromFp32Vector

func NewColumnFloat16VectorFromFp32Vector(fieldName string, dim int, data [][]float32) *ColumnFloat16Vector

func (*ColumnFloat16Vector) AppendValue

func (c *ColumnFloat16Vector) AppendValue(i interface{}) error

AppendValue appends vector value into values. Override default type constrains, add `[]byte`, `entity.FloatVector` and `[]float32` conversion.

func (ColumnFloat16Vector) Dim

func (b ColumnFloat16Vector) Dim() int

func (ColumnFloat16Vector) FieldData

func (b ColumnFloat16Vector) FieldData() *schemapb.FieldData

func (*ColumnFloat16Vector) Slice

func (c *ColumnFloat16Vector) Slice(start, end int) Column

type ColumnFloatArray

type ColumnFloatArray struct {
	// contains filtered or unexported fields
}

func NewColumnFloatArray

func NewColumnFloatArray(fieldName string, data [][]float32) *ColumnFloatArray

func (ColumnFloatArray) ElementType

func (c ColumnFloatArray) ElementType() entity.FieldType

func (ColumnFloatArray) FieldData

func (c ColumnFloatArray) FieldData() *schemapb.FieldData

func (*ColumnFloatArray) Slice

func (c *ColumnFloatArray) Slice(start, end int) Column

type ColumnFloatVector

type ColumnFloatVector struct {
	// contains filtered or unexported fields
}

func NewColumnFloatVector

func NewColumnFloatVector(fieldName string, dim int, data [][]float32) *ColumnFloatVector

func (*ColumnFloatVector) AppendValue

func (c *ColumnFloatVector) AppendValue(i interface{}) error

AppendValue appends vector value into values. override default type constrains, add `[]float32` conversion

func (ColumnFloatVector) Dim

func (b ColumnFloatVector) Dim() int

func (ColumnFloatVector) FieldData

func (b ColumnFloatVector) FieldData() *schemapb.FieldData

func (*ColumnFloatVector) Slice

func (c *ColumnFloatVector) Slice(start, end int) Column

type ColumnInt16

type ColumnInt16 struct {
	// contains filtered or unexported fields
}

func NewColumnInt16

func NewColumnInt16(name string, values []int16) *ColumnInt16

func (ColumnInt16) AppendNull

func (c ColumnInt16) AppendNull() error

func (ColumnInt16) AppendValue

func (c ColumnInt16) AppendValue(a any) error

func (ColumnInt16) Data

func (c ColumnInt16) Data() []T

func (ColumnInt16) FieldData

func (c ColumnInt16) FieldData() *schemapb.FieldData

func (ColumnInt16) Get

func (c ColumnInt16) Get(idx int) (any, error)

func (ColumnInt16) GetAsBool

func (c ColumnInt16) GetAsBool(idx int) (bool, error)

func (ColumnInt16) GetAsDouble

func (c ColumnInt16) GetAsDouble(idx int) (float64, error)

func (*ColumnInt16) GetAsInt64

func (c *ColumnInt16) GetAsInt64(idx int) (int64, error)

func (ColumnInt16) GetAsString

func (c ColumnInt16) GetAsString(idx int) (string, error)

func (ColumnInt16) IsNull

func (c ColumnInt16) IsNull(idx int) (bool, error)

func (ColumnInt16) Len

func (c ColumnInt16) Len() int

func (ColumnInt16) MustValue

func (c ColumnInt16) MustValue(idx int) T

func (ColumnInt16) Name

func (c ColumnInt16) Name() string

Name returns column name.

func (ColumnInt16) Nullable

func (c ColumnInt16) Nullable() bool

func (*ColumnInt16) Slice

func (c *ColumnInt16) Slice(start, end int) Column

func (ColumnInt16) Type

func (c ColumnInt16) Type() entity.FieldType

Type returns corresponding field type. note that: it is not necessary to be 1-on-1 mapping say, `[]byte` could be lots of field type.

func (ColumnInt16) Value

func (c ColumnInt16) Value(idx int) (T, error)

type ColumnInt16Array

type ColumnInt16Array struct {
	// contains filtered or unexported fields
}

func NewColumnInt16Array

func NewColumnInt16Array(fieldName string, data [][]int16) *ColumnInt16Array

func (ColumnInt16Array) ElementType

func (c ColumnInt16Array) ElementType() entity.FieldType

func (ColumnInt16Array) FieldData

func (c ColumnInt16Array) FieldData() *schemapb.FieldData

func (*ColumnInt16Array) Slice

func (c *ColumnInt16Array) Slice(start, end int) Column

type ColumnInt32

type ColumnInt32 struct {
	// contains filtered or unexported fields
}

func NewColumnInt32

func NewColumnInt32(name string, values []int32) *ColumnInt32

func (ColumnInt32) AppendNull

func (c ColumnInt32) AppendNull() error

func (ColumnInt32) AppendValue

func (c ColumnInt32) AppendValue(a any) error

func (ColumnInt32) Data

func (c ColumnInt32) Data() []T

func (ColumnInt32) FieldData

func (c ColumnInt32) FieldData() *schemapb.FieldData

func (ColumnInt32) Get

func (c ColumnInt32) Get(idx int) (any, error)

func (ColumnInt32) GetAsBool

func (c ColumnInt32) GetAsBool(idx int) (bool, error)

func (ColumnInt32) GetAsDouble

func (c ColumnInt32) GetAsDouble(idx int) (float64, error)

func (*ColumnInt32) GetAsInt64

func (c *ColumnInt32) GetAsInt64(idx int) (int64, error)

func (ColumnInt32) GetAsString

func (c ColumnInt32) GetAsString(idx int) (string, error)

func (ColumnInt32) IsNull

func (c ColumnInt32) IsNull(idx int) (bool, error)

func (ColumnInt32) Len

func (c ColumnInt32) Len() int

func (ColumnInt32) MustValue

func (c ColumnInt32) MustValue(idx int) T

func (ColumnInt32) Name

func (c ColumnInt32) Name() string

Name returns column name.

func (ColumnInt32) Nullable

func (c ColumnInt32) Nullable() bool

func (*ColumnInt32) Slice

func (c *ColumnInt32) Slice(start, end int) Column

func (ColumnInt32) Type

func (c ColumnInt32) Type() entity.FieldType

Type returns corresponding field type. note that: it is not necessary to be 1-on-1 mapping say, `[]byte` could be lots of field type.

func (ColumnInt32) Value

func (c ColumnInt32) Value(idx int) (T, error)

type ColumnInt32Array

type ColumnInt32Array struct {
	// contains filtered or unexported fields
}

func NewColumnInt32Array

func NewColumnInt32Array(fieldName string, data [][]int32) *ColumnInt32Array

func (ColumnInt32Array) ElementType

func (c ColumnInt32Array) ElementType() entity.FieldType

func (ColumnInt32Array) FieldData

func (c ColumnInt32Array) FieldData() *schemapb.FieldData

func (*ColumnInt32Array) Slice

func (c *ColumnInt32Array) Slice(start, end int) Column

type ColumnInt64

type ColumnInt64 struct {
	// contains filtered or unexported fields
}

func NewColumnInt64

func NewColumnInt64(name string, values []int64) *ColumnInt64

func (ColumnInt64) AppendNull

func (c ColumnInt64) AppendNull() error

func (ColumnInt64) AppendValue

func (c ColumnInt64) AppendValue(a any) error

func (ColumnInt64) Data

func (c ColumnInt64) Data() []T

func (ColumnInt64) FieldData

func (c ColumnInt64) FieldData() *schemapb.FieldData

func (ColumnInt64) Get

func (c ColumnInt64) Get(idx int) (any, error)

func (ColumnInt64) GetAsBool

func (c ColumnInt64) GetAsBool(idx int) (bool, error)

func (ColumnInt64) GetAsDouble

func (c ColumnInt64) GetAsDouble(idx int) (float64, error)

func (ColumnInt64) GetAsInt64

func (c ColumnInt64) GetAsInt64(idx int) (int64, error)

func (ColumnInt64) GetAsString

func (c ColumnInt64) GetAsString(idx int) (string, error)

func (ColumnInt64) IsNull

func (c ColumnInt64) IsNull(idx int) (bool, error)

func (ColumnInt64) Len

func (c ColumnInt64) Len() int

func (ColumnInt64) MustValue

func (c ColumnInt64) MustValue(idx int) T

func (ColumnInt64) Name

func (c ColumnInt64) Name() string

Name returns column name.

func (ColumnInt64) Nullable

func (c ColumnInt64) Nullable() bool

func (*ColumnInt64) Slice

func (c *ColumnInt64) Slice(start, end int) Column

func (ColumnInt64) Type

func (c ColumnInt64) Type() entity.FieldType

Type returns corresponding field type. note that: it is not necessary to be 1-on-1 mapping say, `[]byte` could be lots of field type.

func (ColumnInt64) Value

func (c ColumnInt64) Value(idx int) (T, error)

type ColumnInt64Array

type ColumnInt64Array struct {
	// contains filtered or unexported fields
}

func NewColumnInt64Array

func NewColumnInt64Array(fieldName string, data [][]int64) *ColumnInt64Array

func (ColumnInt64Array) ElementType

func (c ColumnInt64Array) ElementType() entity.FieldType

func (ColumnInt64Array) FieldData

func (c ColumnInt64Array) FieldData() *schemapb.FieldData

func (*ColumnInt64Array) Slice

func (c *ColumnInt64Array) Slice(start, end int) Column

type ColumnInt8

type ColumnInt8 struct {
	// contains filtered or unexported fields
}

func NewColumnInt8

func NewColumnInt8(name string, values []int8) *ColumnInt8

func (ColumnInt8) AppendNull

func (c ColumnInt8) AppendNull() error

func (ColumnInt8) AppendValue

func (c ColumnInt8) AppendValue(a any) error

func (ColumnInt8) Data

func (c ColumnInt8) Data() []T

func (ColumnInt8) FieldData

func (c ColumnInt8) FieldData() *schemapb.FieldData

func (ColumnInt8) Get

func (c ColumnInt8) Get(idx int) (any, error)

func (ColumnInt8) GetAsBool

func (c ColumnInt8) GetAsBool(idx int) (bool, error)

func (ColumnInt8) GetAsDouble

func (c ColumnInt8) GetAsDouble(idx int) (float64, error)

func (*ColumnInt8) GetAsInt64

func (c *ColumnInt8) GetAsInt64(idx int) (int64, error)

func (ColumnInt8) GetAsString

func (c ColumnInt8) GetAsString(idx int) (string, error)

func (ColumnInt8) IsNull

func (c ColumnInt8) IsNull(idx int) (bool, error)

func (ColumnInt8) Len

func (c ColumnInt8) Len() int

func (ColumnInt8) MustValue

func (c ColumnInt8) MustValue(idx int) T

func (ColumnInt8) Name

func (c ColumnInt8) Name() string

Name returns column name.

func (ColumnInt8) Nullable

func (c ColumnInt8) Nullable() bool

func (*ColumnInt8) Slice

func (c *ColumnInt8) Slice(start, end int) Column

func (ColumnInt8) Type

func (c ColumnInt8) Type() entity.FieldType

Type returns corresponding field type. note that: it is not necessary to be 1-on-1 mapping say, `[]byte` could be lots of field type.

func (ColumnInt8) Value

func (c ColumnInt8) Value(idx int) (T, error)

type ColumnInt8Array

type ColumnInt8Array struct {
	// contains filtered or unexported fields
}

func NewColumnInt8Array

func NewColumnInt8Array(fieldName string, data [][]int8) *ColumnInt8Array

func (ColumnInt8Array) ElementType

func (c ColumnInt8Array) ElementType() entity.FieldType

func (ColumnInt8Array) FieldData

func (c ColumnInt8Array) FieldData() *schemapb.FieldData

func (*ColumnInt8Array) Slice

func (c *ColumnInt8Array) Slice(start, end int) Column

type ColumnJSONBytes

type ColumnJSONBytes struct {
	// contains filtered or unexported fields
}

func NewColumnJSONBytes

func NewColumnJSONBytes(name string, values [][]byte) *ColumnJSONBytes

func (ColumnJSONBytes) AppendNull

func (c ColumnJSONBytes) AppendNull() error

func (*ColumnJSONBytes) AppendValue

func (c *ColumnJSONBytes) AppendValue(i interface{}) error

AppendValue append value into column.

func (ColumnJSONBytes) Data

func (c ColumnJSONBytes) Data() []T

func (*ColumnJSONBytes) FieldData

func (c *ColumnJSONBytes) FieldData() *schemapb.FieldData

func (ColumnJSONBytes) Get

func (c ColumnJSONBytes) Get(idx int) (any, error)

func (ColumnJSONBytes) GetAsBool

func (c ColumnJSONBytes) GetAsBool(idx int) (bool, error)

func (ColumnJSONBytes) GetAsDouble

func (c ColumnJSONBytes) GetAsDouble(idx int) (float64, error)

func (ColumnJSONBytes) GetAsInt64

func (c ColumnJSONBytes) GetAsInt64(idx int) (int64, error)

func (ColumnJSONBytes) GetAsString

func (c ColumnJSONBytes) GetAsString(idx int) (string, error)

func (ColumnJSONBytes) IsNull

func (c ColumnJSONBytes) IsNull(idx int) (bool, error)

func (ColumnJSONBytes) Len

func (c ColumnJSONBytes) Len() int

func (ColumnJSONBytes) MustValue

func (c ColumnJSONBytes) MustValue(idx int) T

func (ColumnJSONBytes) Name

func (c ColumnJSONBytes) Name() string

Name returns column name.

func (ColumnJSONBytes) Nullable

func (c ColumnJSONBytes) Nullable() bool

func (*ColumnJSONBytes) Slice

func (c *ColumnJSONBytes) Slice(start, end int) Column

func (ColumnJSONBytes) Type

func (c ColumnJSONBytes) Type() entity.FieldType

Type returns corresponding field type. note that: it is not necessary to be 1-on-1 mapping say, `[]byte` could be lots of field type.

func (ColumnJSONBytes) Value

func (c ColumnJSONBytes) Value(idx int) (T, error)

func (*ColumnJSONBytes) WithIsDynamic

func (c *ColumnJSONBytes) WithIsDynamic(isDynamic bool) *ColumnJSONBytes

type ColumnSparseFloatVector

type ColumnSparseFloatVector struct {
	// contains filtered or unexported fields
}

func NewColumnSparseVectors

func NewColumnSparseVectors(name string, values []entity.SparseEmbedding) *ColumnSparseFloatVector

func (ColumnSparseFloatVector) Dim

func (b ColumnSparseFloatVector) Dim() int

func (*ColumnSparseFloatVector) FieldData

func (c *ColumnSparseFloatVector) FieldData() *schemapb.FieldData

func (*ColumnSparseFloatVector) Slice

func (c *ColumnSparseFloatVector) Slice(start, end int) Column

type ColumnString

type ColumnString struct {
	// contains filtered or unexported fields
}

func NewColumnString

func NewColumnString(name string, values []string) *ColumnString

func (ColumnString) AppendNull

func (c ColumnString) AppendNull() error

func (ColumnString) AppendValue

func (c ColumnString) AppendValue(a any) error

func (ColumnString) Data

func (c ColumnString) Data() []T

func (ColumnString) FieldData

func (c ColumnString) FieldData() *schemapb.FieldData

func (ColumnString) Get

func (c ColumnString) Get(idx int) (any, error)

func (ColumnString) GetAsBool

func (c ColumnString) GetAsBool(idx int) (bool, error)

func (ColumnString) GetAsDouble

func (c ColumnString) GetAsDouble(idx int) (float64, error)

func (ColumnString) GetAsInt64

func (c ColumnString) GetAsInt64(idx int) (int64, error)

func (ColumnString) GetAsString

func (c ColumnString) GetAsString(idx int) (string, error)

func (ColumnString) IsNull

func (c ColumnString) IsNull(idx int) (bool, error)

func (ColumnString) Len

func (c ColumnString) Len() int

func (ColumnString) MustValue

func (c ColumnString) MustValue(idx int) T

func (ColumnString) Name

func (c ColumnString) Name() string

Name returns column name.

func (ColumnString) Nullable

func (c ColumnString) Nullable() bool

func (*ColumnString) Slice

func (c *ColumnString) Slice(start, end int) Column

func (ColumnString) Type

func (c ColumnString) Type() entity.FieldType

Type returns corresponding field type. note that: it is not necessary to be 1-on-1 mapping say, `[]byte` could be lots of field type.

func (ColumnString) Value

func (c ColumnString) Value(idx int) (T, error)

type ColumnVarChar

type ColumnVarChar struct {
	// contains filtered or unexported fields
}

func NewColumnVarChar

func NewColumnVarChar(name string, values []string) *ColumnVarChar

func (ColumnVarChar) AppendNull

func (c ColumnVarChar) AppendNull() error

func (ColumnVarChar) AppendValue

func (c ColumnVarChar) AppendValue(a any) error

func (ColumnVarChar) Data

func (c ColumnVarChar) Data() []T

func (ColumnVarChar) FieldData

func (c ColumnVarChar) FieldData() *schemapb.FieldData

func (ColumnVarChar) Get

func (c ColumnVarChar) Get(idx int) (any, error)

func (ColumnVarChar) GetAsBool

func (c ColumnVarChar) GetAsBool(idx int) (bool, error)

func (ColumnVarChar) GetAsDouble

func (c ColumnVarChar) GetAsDouble(idx int) (float64, error)

func (ColumnVarChar) GetAsInt64

func (c ColumnVarChar) GetAsInt64(idx int) (int64, error)

func (ColumnVarChar) GetAsString

func (c ColumnVarChar) GetAsString(idx int) (string, error)

func (ColumnVarChar) IsNull

func (c ColumnVarChar) IsNull(idx int) (bool, error)

func (ColumnVarChar) Len

func (c ColumnVarChar) Len() int

func (ColumnVarChar) MustValue

func (c ColumnVarChar) MustValue(idx int) T

func (ColumnVarChar) Name

func (c ColumnVarChar) Name() string

Name returns column name.

func (ColumnVarChar) Nullable

func (c ColumnVarChar) Nullable() bool

func (*ColumnVarChar) Slice

func (c *ColumnVarChar) Slice(start, end int) Column

func (ColumnVarChar) Type

func (c ColumnVarChar) Type() entity.FieldType

Type returns corresponding field type. note that: it is not necessary to be 1-on-1 mapping say, `[]byte` could be lots of field type.

func (ColumnVarChar) Value

func (c ColumnVarChar) Value(idx int) (T, error)

type ColumnVarCharArray

type ColumnVarCharArray struct {
	// contains filtered or unexported fields
}

func NewColumnVarCharArray

func NewColumnVarCharArray(fieldName string, data [][]string) *ColumnVarCharArray

func (ColumnVarCharArray) ElementType

func (c ColumnVarCharArray) ElementType() entity.FieldType

func (ColumnVarCharArray) FieldData

func (c ColumnVarCharArray) FieldData() *schemapb.FieldData

type NullableColumnCreateFunc

type NullableColumnCreateFunc[T any, Col interface {
	Column
	Data() []T
}] func(name string, values []T, validData []bool) (Col, error)
var (
	// scalars
	NewNullableColumnBool      NullableColumnCreateFunc[bool, *ColumnBool]        = NewNullableColumnCreator(NewColumnBool).New
	NewNullableColumnInt8      NullableColumnCreateFunc[int8, *ColumnInt8]        = NewNullableColumnCreator(NewColumnInt8).New
	NewNullableColumnInt16     NullableColumnCreateFunc[int16, *ColumnInt16]      = NewNullableColumnCreator(NewColumnInt16).New
	NewNullableColumnInt32     NullableColumnCreateFunc[int32, *ColumnInt32]      = NewNullableColumnCreator(NewColumnInt32).New
	NewNullableColumnInt64     NullableColumnCreateFunc[int64, *ColumnInt64]      = NewNullableColumnCreator(NewColumnInt64).New
	NewNullableColumnVarChar   NullableColumnCreateFunc[string, *ColumnVarChar]   = NewNullableColumnCreator(NewColumnVarChar).New
	NewNullableColumnString    NullableColumnCreateFunc[string, *ColumnString]    = NewNullableColumnCreator(NewColumnString).New
	NewNullableColumnFloat     NullableColumnCreateFunc[float32, *ColumnFloat]    = NewNullableColumnCreator(NewColumnFloat).New
	NewNullableColumnDouble    NullableColumnCreateFunc[float64, *ColumnDouble]   = NewNullableColumnCreator(NewColumnDouble).New
	NewNullableColumnJSONBytes NullableColumnCreateFunc[[]byte, *ColumnJSONBytes] = NewNullableColumnCreator(NewColumnJSONBytes).New
	// array
	NewNullableColumnBoolArray    NullableColumnCreateFunc[[]bool, *ColumnBoolArray]      = NewNullableColumnCreator(NewColumnBoolArray).New
	NewNullableColumnInt8Array    NullableColumnCreateFunc[[]int8, *ColumnInt8Array]      = NewNullableColumnCreator(NewColumnInt8Array).New
	NewNullableColumnInt16Array   NullableColumnCreateFunc[[]int16, *ColumnInt16Array]    = NewNullableColumnCreator(NewColumnInt16Array).New
	NewNullableColumnInt32Array   NullableColumnCreateFunc[[]int32, *ColumnInt32Array]    = NewNullableColumnCreator(NewColumnInt32Array).New
	NewNullableColumnInt64Array   NullableColumnCreateFunc[[]int64, *ColumnInt64Array]    = NewNullableColumnCreator(NewColumnInt64Array).New
	NewNullableColumnVarCharArray NullableColumnCreateFunc[[]string, *ColumnVarCharArray] = NewNullableColumnCreator(NewColumnVarCharArray).New
	NewNullableColumnFloatArray   NullableColumnCreateFunc[[]float32, *ColumnFloatArray]  = NewNullableColumnCreator(NewColumnFloatArray).New
	NewNullableColumnDoubleArray  NullableColumnCreateFunc[[]float64, *ColumnDoubleArray] = NewNullableColumnCreator(NewColumnDoubleArray).New
)

type NullableColumnCreator

type NullableColumnCreator[col interface {
	Column
	withValidData([]bool)
}, T any] struct {
	// contains filtered or unexported fields
}

func NewNullableColumnCreator

func NewNullableColumnCreator[col interface {
	Column
	withValidData([]bool)
}, T any](base func(name string, values []T) col) NullableColumnCreator[col, T]

func (NullableColumnCreator[col, T]) New

func (c NullableColumnCreator[col, T]) New(name string, values []T, validData []bool) (col, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL