Documentation ¶
Overview ¶
Package executetest contains utilities for testing the query execution phase.
Index ¶
- Constants
- Variables
- func AggFuncBenchmarkHelper(b *testing.B, agg execute.Aggregate, data []float64, want interface{})
- func AggFuncTestHelper(t *testing.T, agg execute.Aggregate, data []float64, want interface{})
- func CreateFromSource(spec plan.ProcedureSpec, id execute.DatasetID, a execute.Administration) (execute.Source, error)
- func EqualResults(want, got []flux.Result) (bool, error)
- func IndexSelectorFuncBenchmarkHelper(b *testing.B, selector execute.IndexSelector, data flux.Table)
- func IndexSelectorFuncTestHelper(t *testing.T, selector execute.IndexSelector, data flux.Table, want [][]int)
- func MustCopyTable(tbl flux.Table) flux.Table
- func NewYieldProcedureSpec(name string) plan.PhysicalProcedureSpec
- func NormalizeTables(bs []*Table)
- func ProcessTestHelper(t *testing.T, data []flux.Table, want []*Table, wantErr error, ...)
- func RandomDatasetID() execute.DatasetID
- func RowSelectorFuncBenchmarkHelper(b *testing.B, selector execute.RowSelector, data flux.Table)
- func RowSelectorFuncTestHelper(t *testing.T, selector execute.RowSelector, data flux.Table, ...)
- func TransformationPassThroughTestHelper(t *testing.T, newTr NewTransformation)
- type ColReader
- func (cr ColReader) Bools(j int) []bool
- func (cr ColReader) Cols() []flux.ColMeta
- func (cr ColReader) Floats(j int) []float64
- func (cr ColReader) Ints(j int) []int64
- func (cr ColReader) Key() flux.GroupKey
- func (cr ColReader) Len() int
- func (cr ColReader) Strings(j int) []string
- func (cr ColReader) Times(j int) []execute.Time
- func (cr ColReader) UInts(j int) []uint64
- type Dataset
- func (d *Dataset) AddTransformation(t execute.Transformation)
- func (d *Dataset) Finish(err error)
- func (d *Dataset) RetractTable(key flux.GroupKey) error
- func (d *Dataset) SetTriggerSpec(t flux.TriggerSpec)
- func (d *Dataset) UpdateProcessingTime(t execute.Time) error
- func (d *Dataset) UpdateWatermark(mark execute.Time) error
- type FromProcedureSpec
- func (src *FromProcedureSpec) AddTransformation(t execute.Transformation)
- func (src *FromProcedureSpec) Copy() plan.ProcedureSpec
- func (src *FromProcedureSpec) Cost(inStats []plan.Statistics) (plan.Cost, plan.Statistics)
- func (src *FromProcedureSpec) Kind() plan.ProcedureKind
- func (src *FromProcedureSpec) Run(ctx context.Context)
- func (src *FromProcedureSpec) Statistics() flux.Statistics
- type NewTransformation
- type Result
- type SortedTables
- type Table
- type TableIterator
- type YieldProcedureSpec
Constants ¶
const FromTestKind = "from-test"
const YieldKind = "yield-test"
Variables ¶
var UnlimitedAllocator = &memory.Allocator{}
Functions ¶
func AggFuncBenchmarkHelper ¶
AggFuncBenchmarkHelper benchmarks the aggregate function over data and compares to wantValue
func AggFuncTestHelper ¶
AggFuncTestHelper splits the data in half, runs Do over each split and compares the Value to want.
func CreateFromSource ¶
func CreateFromSource(spec plan.ProcedureSpec, id execute.DatasetID, a execute.Administration) (execute.Source, error)
func EqualResults ¶ added in v0.7.1
EqualResults compares two lists of Flux Results for equlity
func NewYieldProcedureSpec ¶
func NewYieldProcedureSpec(name string) plan.PhysicalProcedureSpec
func NormalizeTables ¶
func NormalizeTables(bs []*Table)
NormalizeTables ensures that each table is normalized
func ProcessTestHelper ¶
func RandomDatasetID ¶
func TransformationPassThroughTestHelper ¶
func TransformationPassThroughTestHelper(t *testing.T, newTr NewTransformation)
Types ¶
type Dataset ¶
type Dataset struct { ID execute.DatasetID Retractions []flux.GroupKey ProcessingTimeUpdates []execute.Time WatermarkUpdates []execute.Time Finished bool FinishedErr error }
func NewDataset ¶
func (*Dataset) AddTransformation ¶
func (d *Dataset) AddTransformation(t execute.Transformation)
func (*Dataset) SetTriggerSpec ¶
func (d *Dataset) SetTriggerSpec(t flux.TriggerSpec)
type FromProcedureSpec ¶
type FromProcedureSpec struct {
// contains filtered or unexported fields
}
FromProcedureSpec is a procedure spec AND an execution Node. It simulates the execution of a basic physical scan operation.
func NewFromProcedureSpec ¶
func NewFromProcedureSpec(data []*Table) *FromProcedureSpec
NewFromProcedureSpec specifies a from-test procedure with source data
func (*FromProcedureSpec) AddTransformation ¶
func (src *FromProcedureSpec) AddTransformation(t execute.Transformation)
func (*FromProcedureSpec) Copy ¶
func (src *FromProcedureSpec) Copy() plan.ProcedureSpec
func (*FromProcedureSpec) Cost ¶
func (src *FromProcedureSpec) Cost(inStats []plan.Statistics) (plan.Cost, plan.Statistics)
func (*FromProcedureSpec) Kind ¶
func (src *FromProcedureSpec) Kind() plan.ProcedureKind
func (*FromProcedureSpec) Run ¶
func (src *FromProcedureSpec) Run(ctx context.Context)
func (*FromProcedureSpec) Statistics ¶ added in v0.7.1
func (src *FromProcedureSpec) Statistics() flux.Statistics
type NewTransformation ¶
type NewTransformation func(execute.Dataset, execute.TableBuilderCache) execute.Transformation
type Result ¶
type Result struct { Nm string Tbls []*Table Err error Stats flux.Statistics }
func (*Result) Statistics ¶ added in v0.7.1
func (r *Result) Statistics() flux.Statistics
func (*Result) Tables ¶
func (r *Result) Tables() flux.TableIterator
type SortedTables ¶
type SortedTables []*Table
func (SortedTables) Len ¶
func (b SortedTables) Len() int
func (SortedTables) Swap ¶
func (b SortedTables) Swap(i int, j int)
type Table ¶
type Table struct { // GroupKey of the table. Does not need to be set explicitly. GroupKey flux.GroupKey // KeyCols is a list of column that are part of the group key. // The column type is deduced from the ColMeta slice. KeyCols []string // KeyValues is a list of values for the group key columns. // Only needs to be set when no data is present on the table. KeyValues []interface{} // ColMeta is a list of columns of the table. ColMeta []flux.ColMeta // Data is a list of rows, i.e. Data[row][col] // Each row must be a list with length equal to len(ColMeta) Data [][]interface{} }
Table is an implementation of execute.Table It is designed to make it easy to statically declare the data within the table. Not all fields need to be set. See comments on each field. Use Normalize to ensure that all fields are set before equality comparisons.
func (*Table) Normalize ¶
func (t *Table) Normalize()
Normalize ensures all fields of the table are set correctly.
func (*Table) Statistics ¶ added in v0.7.1
func (t *Table) Statistics() flux.Statistics
type TableIterator ¶
type TableIterator struct {
// contains filtered or unexported fields
}
func (*TableIterator) Statistics ¶ added in v0.7.1
func (ti *TableIterator) Statistics() flux.Statistics
type YieldProcedureSpec ¶
type YieldProcedureSpec struct { plan.DefaultCost // contains filtered or unexported fields }
func (YieldProcedureSpec) Copy ¶
func (y YieldProcedureSpec) Copy() plan.ProcedureSpec
func (YieldProcedureSpec) Kind ¶
func (YieldProcedureSpec) Kind() plan.ProcedureKind
func (YieldProcedureSpec) YieldName ¶
func (y YieldProcedureSpec) YieldName() string