chunk

package
v0.0.0-...-10cc69c Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NULL_HASH = 0xbf58476d1ce4e5b9
)

Variables

View Source
var (
	POWERS_OF_TEN = []int64{
		1,
		10,
		100,
		1000,
		10000,
		100000,
		1000000,
		10000000,
		100000000,
		1000000000,
		10000000000,
		100000000000,
		1000000000000,
		10000000000000,
		100000000000000,
		1000000000000000,
		10000000000000000,
		100000000000000000,
		1000000000000000000,
	}
)

Functions

func CombineHashScalar

func CombineHashScalar(a, b uint64) uint64

func CombineHashTypeSwitch

func CombineHashTypeSwitch(
	hashes *Vector,
	input *Vector,
	rsel *SelectVector,
	count int,
	hasRsel bool,
)

func Copy

func Copy(
	srcP *Vector,
	dstP *Vector,
	selP *SelectVector,
	srcCount int,
	srcOffset int,
	dstOffset int,
)

func CopyBitmap

func CopyBitmap(v *Vector) *util.Bitmap

func FlattenConstVector

func FlattenConstVector[T any](data []byte, srcData []byte, pSize int, cnt int)

Helper functions for format conversion

func GenerateSequence

func GenerateSequence(
	result *Vector,
	count uint64,
	start, increment uint64,
)

func GetDataInPhyFormatConst

func GetDataInPhyFormatConst(vec *Vector) []byte

constant vector

func GetDataInPhyFormatFlat

func GetDataInPhyFormatFlat(vec *Vector) []byte

flat vector

func GetMaskInPhyFormatConst

func GetMaskInPhyFormatConst(vec *Vector) *util.Bitmap

func GetMaskInPhyFormatFlat

func GetMaskInPhyFormatFlat(vec *Vector) *util.Bitmap

func GetSequenceInPhyFormatSequence

func GetSequenceInPhyFormatSequence(vec *Vector, start, incr, seqCount *int64)

func GetSequenceInPhyFormatSequence2

func GetSequenceInPhyFormatSequence2(vec *Vector, start, incr *int64)

func GetSliceInPhyFormatConst

func GetSliceInPhyFormatConst[T any](vec *Vector) []T

func GetSliceInPhyFormatFlat

func GetSliceInPhyFormatFlat[T any](vec *Vector) []T

func GetSliceInPhyFormatSequence

func GetSliceInPhyFormatSequence(vec *Vector) []int64

sequence vector

func GetSliceInPhyFormatUnifiedFormat

func GetSliceInPhyFormatUnifiedFormat[T any](uni *UnifiedFormat) []T

func HasNull

func HasNull(input *Vector, count int) bool

func HashTypeSwitch

func HashTypeSwitch(
	input, result *Vector,
	rsel *SelectVector,
	count int,
	hasRsel bool,
)

func IsNullInPhyFormatConst

func IsNullInPhyFormatConst(vec *Vector) bool

func ReadFromStorage

func ReadFromStorage(
	ptr unsafe.Pointer,
	count int,
	res *Vector,
)

func ReadLoop

func ReadLoop[T any](
	src unsafe.Pointer,
	count int,
	res *Vector,
)

func ReferenceInPhyFormatConst

func ReferenceInPhyFormatConst(
	vec *Vector,
	src *Vector,
	pos int,
	count int,
)

func SaveLoop

func SaveLoop[T any](
	vdata *UnifiedFormat,
	count int,
	ptr unsafe.Pointer,
	nVal ScatterOp[T],
)

func SetData

func SetData(vec *Vector, slice []byte)

func SetMaskInPhyFormatFlat

func SetMaskInPhyFormatFlat(vec *Vector, mask *util.Bitmap)

func SetNullInPhyFormatConst

func SetNullInPhyFormatConst(vec *Vector, null bool)

func SetNullInPhyFormatFlat

func SetNullInPhyFormatFlat(vec *Vector, idx uint64, null bool)

func TemplatedCopy

func TemplatedCopy[T any](
	src *Vector,
	sel *SelectVector,
	dst *Vector,
	srcOffset int,
	dstOffset int,
	copyCount int,
)

func TemplatedLoopCombineHash

func TemplatedLoopCombineHash[T any](
	input *Vector,
	hashes *Vector,
	rsel *SelectVector,
	count int,
	hasRsel bool,
	hashOp HashOp[T],
	hashFun HashFunc[T],
)

func TemplatedLoopHash

func TemplatedLoopHash[T any](
	input, result *Vector,
	rsel *SelectVector,
	count int,
	hasRsel bool,
	hashOp HashOp[T],
	hashFun HashFunc[T],
)

func TightLoopCombineHash

func TightLoopCombineHash[T any](
	ldata []T,
	hashData []uint64,
	rsel *SelectVector,
	count int,
	selVec *SelectVector,
	mask *util.Bitmap,
	hasRsel bool,
	hashOp HashOp[T],
	hashFun HashFunc[T],
)

func TightLoopCombineHashConstant

func TightLoopCombineHashConstant[T any](
	ldata []T,
	constHash uint64,
	hashData []uint64,
	rsel *SelectVector,
	count int,
	selVec *SelectVector,
	mask *util.Bitmap,
	hasRsel bool,
	hashOp HashOp[T],
	hashFun HashFunc[T],
)

func TightLoopHash

func TightLoopHash[T any](
	ldata []T,
	resultData []uint64,
	rsel *SelectVector,
	count int,
	selVec *SelectVector,
	mask *util.Bitmap,
	hasRsel bool,
	hashOp HashOp[T],
	hashFun HashFunc[T],
)

func WriteToStorage

func WriteToStorage(
	src *Vector,
	count int,
	ptr unsafe.Pointer,
)

Types

type BoolScatterOp

type BoolScatterOp struct {
}

func (BoolScatterOp) NullValue

func (scatter BoolScatterOp) NullValue() bool

func (BoolScatterOp) RandValue

func (scatter BoolScatterOp) RandValue() bool

func (BoolScatterOp) Store

func (scatter BoolScatterOp) Store(src bool, rowLoc unsafe.Pointer, offsetInRow int, heapLoc *unsafe.Pointer)

type Chunk

type Chunk struct {
	Data  []*Vector
	Count int
	// contains filtered or unexported fields
}

func (*Chunk) Cap

func (c *Chunk) Cap() int

func (*Chunk) Card

func (c *Chunk) Card() int

func (*Chunk) ColumnCount

func (c *Chunk) ColumnCount() int

func (*Chunk) Deserialize

func (c *Chunk) Deserialize(deserial util.Deserialize) error

func (*Chunk) Flatten

func (c *Chunk) Flatten()

func (*Chunk) Hash

func (c *Chunk) Hash(result *Vector)

func (*Chunk) Init

func (c *Chunk) Init(types []common.LType, cap int)

func (*Chunk) Print

func (c *Chunk) Print()

func (*Chunk) Print2

func (c *Chunk) Print2(rwoPrefix string)

func (*Chunk) Reference

func (c *Chunk) Reference(other *Chunk)

func (*Chunk) ReferenceIndice

func (c *Chunk) ReferenceIndice(other *Chunk, indice []int)

func (*Chunk) Reset

func (c *Chunk) Reset()

func (*Chunk) SaveToFile

func (c *Chunk) SaveToFile(resFile *os.File) (err error)

func (*Chunk) SaveToWriter

func (c *Chunk) SaveToWriter(writer wire.DataWriter) (err error)

func (*Chunk) Serialize

func (c *Chunk) Serialize(serial util.Serialize) error

func (*Chunk) SetCap

func (c *Chunk) SetCap(cap int)

func (*Chunk) SetCard

func (c *Chunk) SetCard(count int)

func (*Chunk) Slice

func (c *Chunk) Slice(other *Chunk, sel *SelectVector, count int, colOffset int)

func (*Chunk) SliceIndice

func (c *Chunk) SliceIndice(other *Chunk, sel *SelectVector, count int, colOffset int, indice []int)

func (*Chunk) SliceItself

func (c *Chunk) SliceItself(sel *SelectVector, cnt int)

func (*Chunk) ToUnifiedFormat

func (c *Chunk) ToUnifiedFormat() []*UnifiedFormat

type DateScatterOp

type DateScatterOp struct {
}

func (DateScatterOp) NullValue

func (scatter DateScatterOp) NullValue() common.Date

func (DateScatterOp) RandValue

func (scatter DateScatterOp) RandValue() common.Date

func (DateScatterOp) Store

func (scatter DateScatterOp) Store(src common.Date, rowLoc unsafe.Pointer, offsetInRow int, heapLoc *unsafe.Pointer)

type DecimalScatterOp

type DecimalScatterOp struct {
}

func (DecimalScatterOp) NullValue

func (scatter DecimalScatterOp) NullValue() common.Decimal

func (DecimalScatterOp) RandValue

func (scatter DecimalScatterOp) RandValue() common.Decimal

func (DecimalScatterOp) Store

func (scatter DecimalScatterOp) Store(src common.Decimal, rowLoc unsafe.Pointer, offsetInRow int, heapLoc *unsafe.Pointer)

type Float64ScatterOp

type Float64ScatterOp struct {
}

func (Float64ScatterOp) NullValue

func (scatter Float64ScatterOp) NullValue() float64

func (Float64ScatterOp) RandValue

func (scatter Float64ScatterOp) RandValue() float64

func (Float64ScatterOp) Store

func (scatter Float64ScatterOp) Store(src float64, rowLoc unsafe.Pointer, offsetInRow int, heapLoc *unsafe.Pointer)

type HashFunc

type HashFunc[T any] interface {
	// contains filtered or unexported methods
}

type HashFuncDate

type HashFuncDate struct {
}

type HashFuncDecimal

type HashFuncDecimal struct {
}

type HashFuncHugeint

type HashFuncHugeint struct {
}

type HashFuncInt8

type HashFuncInt8 struct {
}

type HashFuncInt32

type HashFuncInt32 struct {
}

type HashFuncInt64

type HashFuncInt64 struct {
}

type HashFuncString

type HashFuncString struct {
}

type HashOp

type HashOp[T any] interface {
	// contains filtered or unexported methods
}

type HashOpDate

type HashOpDate struct {
}

type HashOpDecimal

type HashOpDecimal struct {
}

type HashOpHugeint

type HashOpHugeint struct{}

type HashOpInt8

type HashOpInt8 struct {
}

type HashOpInt32

type HashOpInt32 struct {
}

type HashOpInt64

type HashOpInt64 struct {
}

type HashOpString

type HashOpString struct {
}

type HugeintScatterOp

type HugeintScatterOp struct {
}

func (HugeintScatterOp) NullValue

func (scatter HugeintScatterOp) NullValue() common.Hugeint

func (HugeintScatterOp) RandValue

func (scatter HugeintScatterOp) RandValue() common.Hugeint

func (HugeintScatterOp) Store

func (scatter HugeintScatterOp) Store(src common.Hugeint, rowLoc unsafe.Pointer, offsetInRow int, heapLoc *unsafe.Pointer)

type Int8ScatterOp

type Int8ScatterOp struct {
}

func (Int8ScatterOp) NullValue

func (scatter Int8ScatterOp) NullValue() int8

func (Int8ScatterOp) RandValue

func (scatter Int8ScatterOp) RandValue() int8

func (Int8ScatterOp) Store

func (scatter Int8ScatterOp) Store(src int8, rowLoc unsafe.Pointer, offsetInRow int, heapLoc *unsafe.Pointer)

type Int32ScatterOp

type Int32ScatterOp struct {
}

func (Int32ScatterOp) NullValue

func (scatter Int32ScatterOp) NullValue() int32

func (Int32ScatterOp) RandValue

func (scatter Int32ScatterOp) RandValue() int32

func (Int32ScatterOp) Store

func (scatter Int32ScatterOp) Store(src int32, rowLoc unsafe.Pointer, offsetInRow int, heapLoc *unsafe.Pointer)

type Int64ScatterOp

type Int64ScatterOp struct {
}

func (Int64ScatterOp) NullValue

func (scatter Int64ScatterOp) NullValue() int64

func (Int64ScatterOp) RandValue

func (scatter Int64ScatterOp) RandValue() int64

func (Int64ScatterOp) Store

func (scatter Int64ScatterOp) Store(src int64, rowLoc unsafe.Pointer, offsetInRow int, heapLoc *unsafe.Pointer)

type PhyFormat

type PhyFormat int
const (
	PF_FLAT PhyFormat = iota
	PF_CONST
	PF_DICT
	PF_SEQUENCE
)

func (PhyFormat) IsConst

func (f PhyFormat) IsConst() bool

func (PhyFormat) IsDict

func (f PhyFormat) IsDict() bool

func (PhyFormat) IsFlat

func (f PhyFormat) IsFlat() bool

func (PhyFormat) IsSequence

func (f PhyFormat) IsSequence() bool

func (PhyFormat) String

func (f PhyFormat) String() string

type ScatterOp

type ScatterOp[T any] interface {
	NullValue() T
	RandValue() T
	Store(src T, rowLoc unsafe.Pointer, offsetInRow int, heapLoc *unsafe.Pointer)
}

type SelectVector

type SelectVector struct {
	SelVec []int
}

func GetSelVectorInPhyFormatDict

func GetSelVectorInPhyFormatDict(vec *Vector) *SelectVector

dictionary vector

func IncrSelectVectorInPhyFormatFlat

func IncrSelectVectorInPhyFormatFlat() *SelectVector

func NewSelectVector

func NewSelectVector(count int) *SelectVector

func NewSelectVector2

func NewSelectVector2(start, count int) *SelectVector

func NewSelectVector3

func NewSelectVector3(tuples []int) *SelectVector

func ZeroSelectVectorInPhyFormatConst

func ZeroSelectVectorInPhyFormatConst(cnt int, sel *SelectVector) *SelectVector

func (*SelectVector) GetIndex

func (svec *SelectVector) GetIndex(idx int) int

func (*SelectVector) Init

func (svec *SelectVector) Init(cnt int)

func (*SelectVector) Init2

func (svec *SelectVector) Init2(sel *SelectVector)

func (*SelectVector) Init3

func (svec *SelectVector) Init3(data []int)

func (*SelectVector) Invalid

func (svec *SelectVector) Invalid() bool

func (*SelectVector) SetIndex

func (svec *SelectVector) SetIndex(idx int, index int)

func (*SelectVector) Slice

func (svec *SelectVector) Slice(sel *SelectVector, count int) []int

type StringScatterOp

type StringScatterOp struct {
}

func (StringScatterOp) NullValue

func (scatter StringScatterOp) NullValue() common.String

func (StringScatterOp) RandValue

func (scatter StringScatterOp) RandValue() common.String

func (StringScatterOp) Store

func (scatter StringScatterOp) Store(src common.String, rowLoc unsafe.Pointer, offsetInRow int, heapLoc *unsafe.Pointer)

type Uint64ScatterOp

type Uint64ScatterOp struct {
}

func (Uint64ScatterOp) NullValue

func (scatter Uint64ScatterOp) NullValue() uint64

func (Uint64ScatterOp) RandValue

func (scatter Uint64ScatterOp) RandValue() uint64

func (Uint64ScatterOp) Store

func (scatter Uint64ScatterOp) Store(src uint64, rowLoc unsafe.Pointer, offsetInRow int, heapLoc *unsafe.Pointer)

type UnifiedFormat

type UnifiedFormat struct {
	Sel      *SelectVector
	Data     []byte
	Mask     *util.Bitmap
	InterSel SelectVector
	PTypSize int
}

type Value

type Value struct {
	Typ    common.LType
	IsNull bool
	//value
	Bool  bool
	I64   int64
	I64_1 int64
	I64_2 int64
	U64   uint64
	F64   float64
	Str   string
}

func MaxValue

func MaxValue(typ common.LType) *Value

func MinValue

func MinValue(typ common.LType) *Value

func (Value) String

func (val Value) String() string

type VecBuffer

type VecBuffer struct {
	BufTyp VecBufferType
	Data   []byte
	Sel    *SelectVector
	Child  *Vector
}

func NewBuffer

func NewBuffer(sz int) *VecBuffer

func NewChildBuffer

func NewChildBuffer(child *Vector) *VecBuffer

func NewConstBuffer

func NewConstBuffer(typ common.LType) *VecBuffer

func NewDictBuffer

func NewDictBuffer(data []int) *VecBuffer

func NewDictBuffer2

func NewDictBuffer2(sel *SelectVector) *VecBuffer

func NewStandardBuffer

func NewStandardBuffer(lt common.LType, cap int) *VecBuffer

func (*VecBuffer) GetSelVector

func (buf *VecBuffer) GetSelVector() *SelectVector

type VecBufferType

type VecBufferType int
const (
	//array of data
	VBT_STANDARD VecBufferType = iota
	VBT_DICT
	VBT_CHILD
	VBT_STRING
)

type Vector

type Vector struct {
	Data []byte
	Mask *util.Bitmap
	Buf  *VecBuffer
	Aux  *VecBuffer
	// contains filtered or unexported fields
}

func GetChildInPhyFormatDict

func GetChildInPhyFormatDict(vec *Vector) *Vector

func NewConstVector

func NewConstVector(lTyp common.LType) *Vector

func NewEmptyVector

func NewEmptyVector(typ common.LType, pf PhyFormat, cap int) *Vector

func NewFlatVector

func NewFlatVector(lTyp common.LType, cap int) *Vector

func NewUbigintFlatVector

func NewUbigintFlatVector(v []uint64, sz int) *Vector

func NewVarcharFlatVector

func NewVarcharFlatVector(v []string, sz int) *Vector

func NewVector

func NewVector(lTyp common.LType, initData bool, cap int) *Vector

func NewVector2

func NewVector2(lTyp common.LType, cap int) *Vector

func (*Vector) Deserialize

func (vec *Vector) Deserialize(count int, deserial util.Deserialize) error

func (*Vector) Flatten

func (vec *Vector) Flatten(cnt int)

Format conversion methods for Vector

func (*Vector) Flatten2

func (vec *Vector) Flatten2(sel *SelectVector, cnt int)

func (*Vector) GetValue

func (vec *Vector) GetValue(idx int) *Value

func (*Vector) Init

func (vec *Vector) Init(cap int)

func (*Vector) PhyFormat

func (vec *Vector) PhyFormat() PhyFormat

func (*Vector) Print

func (vec *Vector) Print(rowCount int)

func (*Vector) Print2

func (vec *Vector) Print2(prefix string, rowCount int)

func (*Vector) Reference

func (vec *Vector) Reference(other *Vector)

func (*Vector) ReferenceValue

func (vec *Vector) ReferenceValue(val *Value)

func (*Vector) Reinterpret

func (vec *Vector) Reinterpret(other *Vector)

func (*Vector) Reset

func (vec *Vector) Reset()

func (*Vector) Sequence

func (vec *Vector) Sequence(start uint64, incr uint64, count uint64)

func (*Vector) Serialize

func (vec *Vector) Serialize(count int, serial util.Serialize) error

Serialization and deserialization methods for Vector

func (*Vector) SetPhyFormat

func (vec *Vector) SetPhyFormat(pf PhyFormat)

func (*Vector) SetValue

func (vec *Vector) SetValue(idx int, val *Value)

func (*Vector) Slice

func (vec *Vector) Slice(other *Vector, sel *SelectVector, count int)

func (*Vector) Slice2

func (vec *Vector) Slice2(sel *SelectVector, count int)

func (*Vector) Slice3

func (vec *Vector) Slice3(other *Vector, offset uint64, end uint64)

func (*Vector) SliceOnSelf

func (vec *Vector) SliceOnSelf(sel *SelectVector, count int)

func (*Vector) ToUnifiedFormat

func (vec *Vector) ToUnifiedFormat(count int, output *UnifiedFormat)

func (*Vector) Typ

func (vec *Vector) Typ() common.LType

Jump to

Keyboard shortcuts

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