Documentation ¶
Index ¶
- func CalculateVectorBytes(dataType common.DataType, size int) int
- func CalculateVectorPartyBytes(dataType common.DataType, size int, hasNulls bool, hasCounts bool) int
- type Vector
- func (v *Vector) Buffer() unsafe.Pointer
- func (v *Vector) CheckAllValid() bool
- func (v *Vector) GetBool(index int) bool
- func (v *Vector) GetMaxValue() uint32
- func (v *Vector) GetMinValue() uint32
- func (v *Vector) GetSliceBytesAligned(lowerBound int, upperBound int) (buffer unsafe.Pointer, startIndex int, bytes int)
- func (v *Vector) GetValue(index int) unsafe.Pointer
- func (v *Vector) LowerBound(first int, last int, value unsafe.Pointer) int
- func (v *Vector) SafeDestruct()
- func (v *Vector) SetAllValid()
- func (v *Vector) SetBool(index int, value bool)
- func (v *Vector) SetValue(index int, data unsafe.Pointer)
- func (v *Vector) UpperBound(first int, last int, value unsafe.Pointer) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateVectorBytes ¶
CalculateVectorBytes calculates bytes the vector will occupy given data type and size without actual allocation.
func CalculateVectorPartyBytes ¶
func CalculateVectorPartyBytes(dataType common.DataType, size int, hasNulls bool, hasCounts bool) int
CalculateVectorPartyBytes calculates bytes the vector party will occupy. Note: data type supported in go memory will report memory usage when value is actually set, therefore report 0 here
Types ¶
type Vector ¶
type Vector struct { // The data type of the value stored in the vector. DataType common.DataType CmpFunc common.CompareFunc // Max number of values that can be stored in the vector. Size int // Allocated size of the vector in bytes. Bytes int // contains filtered or unexported fields }
Vector stores a batch of columnar data (values, nulls, or counts) for a column.
func NewVector ¶
NewVector creates a vector with the specified bits per unit and size(capacity). The majority of its storage space is managed in C.
func (*Vector) CheckAllValid ¶
CheckAllValid checks whether all bits are 1 in a bool typed vector.
func (*Vector) GetBool ¶
GetBool returns the bool value for the specified index. index bound is not checked!
func (*Vector) GetMaxValue ¶
GetMaxValue return the max value of the Vector Party
func (*Vector) GetMinValue ¶
GetMinValue return the min value of the Vector Party
func (*Vector) GetSliceBytesAligned ¶
func (v *Vector) GetSliceBytesAligned(lowerBound int, upperBound int) (buffer unsafe.Pointer, startIndex int, bytes int)
GetSliceBytesAligned calculate the number of bytes of a slice of the vector, represented by [lowerBound, upperBound), aligned to 64-byte return the buffer pointer, new start index (start entry in vector), and length in bytes
func (*Vector) GetValue ¶
GetValue returns the data value for the specified index. index bound is not checked! The return value points to the internal buffer location that stores the value.
func (*Vector) LowerBound ¶
LowerBound returns the index of the first element in vector[first, last) that is greater or equal to the given value. The result is only valid if vector[first, last) is fully sorted in ascendant order. If all values in the given range is less than the given value, LowerBound returns last. Note that first/last is not checked against vector bound.
func (*Vector) SafeDestruct ¶
func (v *Vector) SafeDestruct()
SafeDestruct destructs this vector's storage space managed in C.
func (*Vector) SetAllValid ¶
func (v *Vector) SetAllValid()
SetAllValid set all bits to be 1 in a bool typed vector.
func (*Vector) SetValue ¶
SetValue sets the data value for the specified index. index bound is not checked! data points to a buffer (in UpsertBatch for instance) that contains the value to be set.
func (*Vector) UpperBound ¶
UpperBound returns the index of the first element in vector[first, last) that is greater than the given value. The result is only valid if vector[first, last) is fully sorted in ascendant order. If all values in the given range is less than the given value, LowerBound returns last. Note that first/last is not checked against vector bound.