testutil

package
v0.0.0-debug-20260702 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MakeBoolVector = func(values []bool, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, boolType, mp)
	}

	MakeBitVector = func(values []uint64, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, bitType, mp)
	}

	MakeInt8Vector = func(values []int8, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, int8Type, mp)
	}

	MakeInt16Vector = func(values []int16, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, int16Type, mp)
	}

	MakeInt32Vector = func(values []int32, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, int32Type, mp)
	}

	MakeInt64Vector = func(values []int64, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, int64Type, mp)
	}

	MakeUint8Vector = func(values []uint8, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, uint8Type, mp)
	}

	MakeUint16Vector = func(values []uint16, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, uint16Type, mp)
	}

	MakeUint32Vector = func(values []uint32, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, uint32Type, mp)
	}

	MakeUint64Vector = func(values []uint64, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, uint64Type, mp)
	}

	MakeFloat32Vector = func(values []float32, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, float32Type, mp)
	}

	MakeFloat64Vector = func(values []float64, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, float64Type, mp)
	}

	MakeRowIdVector = func(values []types.Rowid, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, rowIdType, mp)
	}

	MakeBlockIdVector = func(values []types.Blockid, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, blockIdType, mp)
	}

	MakeTSVector = func(values []types.TS, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, tsType, mp)
	}

	MakeVarcharVector = func(values []string, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeStringVector(values, nsp, varcharType, mp)
	}

	MakeTextVector = func(values []string, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeStringVector(values, nsp, textType, mp)
	}

	MakeUUIDVector = func(values []types.Uuid, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeVector(values, nsp, uuidType, mp)
	}

	MakeJsonVector = func(values []string, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeJsonVector(values, nsp, mp)
	}

	MakeDateVector = func(values []string, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeDateVector(values, nsp, mp)
	}

	MakeTimeVector = func(values []string, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeTimeVector(values, nsp, mp)
	}

	MakeDatetimeVector = func(values []string, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeDatetimeVector(values, nsp, mp)
	}

	MakeTimestampVector = func(values []string, nsp []uint64, mp *mpool.MPool) *vector.Vector {
		return makeTimestampVector(values, nsp, mp)
	}
)

All vectors generated by the Make Function, their memory is not allocated through the memory pool if you want to generate a vector in memory pool, use NewFunction to instead of MakeFunction.

View Source
var (
	MakeScalarNull = func(t testing.TB, typ types.T, length int, mp *mpool.MPool) *vector.Vector {
		return vector.NewConstNull(typ.ToType(), length, NewProc(t).Mp())
	}
	MakeScalarInt64 = func(v int64, length int, mp *mpool.MPool) *vector.Vector {
		return makeScalar(v, length, int64Type, mp)
	}

	MakeScalarVarchar = func(value string, length int, mp *mpool.MPool) *vector.Vector {
		return makeScalarString(value, length, varcharType, mp)
	}
)

functions to make a scalar vector for test.

View Source
var NewProc = NewProcess

Functions

func CompareVectors added in v0.6.0

func CompareVectors(expected *vector.Vector, got *vector.Vector) bool

func MakeVarlenaVector

func MakeVarlenaVector(data [][]byte, nulls []uint64, typ types.Type, mp *mpool.MPool) *vector.Vector

func NewArrayVector added in v1.1.0

func NewArrayVector[T types.RealNumbers](n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs [][]T) *vector.Vector

func NewBatch

func NewBatch(ts []types.Type, random bool, n int, m *mpool.MPool) *batch.Batch

func NewBatchWithNulls added in v0.6.0

func NewBatchWithNulls(ts []types.Type, random bool, n int, m *mpool.MPool) *batch.Batch

func NewBatchWithVectors added in v0.6.0

func NewBatchWithVectors(vs []*vector.Vector, zs []int64) *batch.Batch

func NewBlockidVector added in v0.8.0

func NewBlockidVector(n int, typ types.Type, m *mpool.MPool, _ bool, nulls []bool, vs []types.Blockid) *vector.Vector

func NewBoolVector

func NewBoolVector(n int, typ types.Type, m *mpool.MPool, _ bool, nulls []bool, vs []bool) *vector.Vector

func NewDateVector

func NewDateVector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []string) *vector.Vector

func NewDatetimeVector

func NewDatetimeVector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []string) *vector.Vector

func NewDecimal64Vector

func NewDecimal64Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []types.Decimal64) *vector.Vector

func NewDecimal128Vector

func NewDecimal128Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []types.Decimal128) *vector.Vector

func NewETLFS added in v1.1.0

func NewETLFS() fileservice.FileService

func NewEnumVector added in v1.2.2

func NewEnumVector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []uint16) *vector.Vector

func NewFS added in v0.6.0

func NewFloat32Vector

func NewFloat32Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []float32) *vector.Vector

func NewFloat64Vector

func NewFloat64Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []float64) *vector.Vector

func NewInt8Vector

func NewInt8Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []int8) *vector.Vector

func NewInt16Vector

func NewInt16Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []int16) *vector.Vector

func NewInt32Vector

func NewInt32Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []int32) *vector.Vector

func NewInt64Vector

func NewInt64Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []int64) *vector.Vector

func NewJsonVector added in v0.6.0

func NewJsonVector(n int, typ types.Type, m *mpool.MPool, _ bool, nulls []bool, vs []string) *vector.Vector

func NewProcess added in v0.6.0

func NewProcess(t testing.TB, opts ...ProcOptions) *process.Process

func NewProcessWithMPool added in v0.6.0

func NewProcessWithMPool(t testing.TB, sid string, mp *mpool.MPool) *process.Process

func NewRegMsg added in v1.2.1

func NewRegMsg(bat *batch.Batch) *process.RegisterMessage

func NewRowidVector added in v0.7.0

func NewRowidVector(n int, typ types.Type, m *mpool.MPool, _ bool, nulls []bool, vs []types.Rowid) *vector.Vector

func NewSharedFS added in v1.1.0

func NewSharedFS() fileservice.FileService

func NewStringVector

func NewStringVector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []string) *vector.Vector

func NewTimeVector added in v0.6.0

func NewTimeVector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []string) *vector.Vector

func NewTimestampVector

func NewTimestampVector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []string) *vector.Vector

func NewTsVector added in v0.7.0

func NewTsVector(n int, typ types.Type, m *mpool.MPool, _ bool, nulls []bool, vs []types.TS) *vector.Vector

func NewUInt8Vector

func NewUInt8Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []uint8) *vector.Vector

func NewUInt16Vector

func NewUInt16Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []uint16) *vector.Vector

func NewUInt32Vector

func NewUInt32Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []uint32) *vector.Vector

func NewUInt64Vector

func NewUInt64Vector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []uint64) *vector.Vector

func NewUUIDVector

func NewUUIDVector(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, vs []types.Uuid) *vector.Vector

func NewVector

func NewVector(n int, typ types.Type, m *mpool.MPool, random bool, Values interface{}) *vector.Vector

func NewVectorWithNulls

func NewVectorWithNulls(n int, typ types.Type, m *mpool.MPool, random bool, nulls []bool, Values interface{}) *vector.Vector

func OperatorCatchBatch added in v0.8.0

func OperatorCatchBatch(operatorName string, bat *batch.Batch) string

OperatorCatchBatch return a string with format

`insert operator catch a batch, batch length is 100, [vec 0 : len is 100]`

func SetupAutoIncrService added in v0.8.0

func SetupAutoIncrService(sid string)

Types

type ProcOptions

type ProcOptions func(proc *process.Process)

func WithFileService

func WithFileService(fs fileservice.FileService) ProcOptions

func WithMPool

func WithMPool(pool *mpool.MPool) ProcOptions

func WithQueryClient

func WithQueryClient(queryClient client.QueryClient) ProcOptions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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