Documentation ¶
Index ¶
- func GenRandomChunks(schema []*types.FieldType, size int) *chunk.Chunk
- type AggTestCase
- type LimitCase
- type MockActionOnExceed
- type MockDataPhysicalPlan
- func (*MockDataPhysicalPlan) ExplainID() fmt.Stringer
- func (mp *MockDataPhysicalPlan) GetExecutor() exec.Executor
- func (*MockDataPhysicalPlan) ID() int
- func (*MockDataPhysicalPlan) MemoryUsage() (sum int64)
- func (*MockDataPhysicalPlan) QueryBlockOffset() int
- func (mp *MockDataPhysicalPlan) Schema() *expression.Schema
- func (*MockDataPhysicalPlan) Stats() *property.StatsInfo
- type MockDataSource
- type MockDataSourceParameters
- type MockPhysicalPlan
- type SortCase
- type WindowTestCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AggTestCase ¶
type AggTestCase struct { Ctx sessionctx.Context ExecType string AggFunc string GroupByNDV int Rows int Concurrency int DataSourceSorted bool HasDistinct bool }
AggTestCase has a fixed schema (aggCol Double, groupBy LongLong).
func DefaultAggTestCase ¶
func DefaultAggTestCase(ctx sessionctx.Context, exec string) *AggTestCase
DefaultAggTestCase returns default agg test case
func (AggTestCase) Columns ¶
func (AggTestCase) Columns() []*expression.Column
Columns creates columns
type LimitCase ¶
type LimitCase struct { Ctx sessionctx.Context ChildUsedSchema []bool Rows int Offset int Count int UsingInlineProjection bool }
LimitCase is the limit case
func DefaultLimitTestCase ¶
func DefaultLimitTestCase(ctx sessionctx.Context) *LimitCase
DefaultLimitTestCase returns default limit test case
type MockActionOnExceed ¶
type MockActionOnExceed struct { memory.BaseOOMAction // contains filtered or unexported fields }
MockActionOnExceed is for test.
func (*MockActionOnExceed) Action ¶
func (m *MockActionOnExceed) Action(*memory.Tracker)
Action add the triggered number.
func (*MockActionOnExceed) GetPriority ¶
func (*MockActionOnExceed) GetPriority() int64
GetPriority get the priority of the Action.
func (*MockActionOnExceed) GetTriggeredNum ¶
func (m *MockActionOnExceed) GetTriggeredNum() int
GetTriggeredNum get the triggered number of the Action
type MockDataPhysicalPlan ¶
type MockDataPhysicalPlan struct { MockPhysicalPlan DataSchema *expression.Schema Exec exec.Executor }
MockDataPhysicalPlan mocks physical plan
func BuildMockDataPhysicalPlan ¶
func BuildMockDataPhysicalPlan(_ sessionctx.Context, srcExec exec.Executor) *MockDataPhysicalPlan
BuildMockDataPhysicalPlan builds MockDataPhysicalPlan
func (*MockDataPhysicalPlan) ExplainID ¶
func (*MockDataPhysicalPlan) ExplainID() fmt.Stringer
ExplainID returns explain id
func (*MockDataPhysicalPlan) GetExecutor ¶
func (mp *MockDataPhysicalPlan) GetExecutor() exec.Executor
GetExecutor gets executor
func (*MockDataPhysicalPlan) MemoryUsage ¶
func (*MockDataPhysicalPlan) MemoryUsage() (sum int64)
MemoryUsage of mockDataPhysicalPlan is only for testing
func (*MockDataPhysicalPlan) QueryBlockOffset ¶
func (*MockDataPhysicalPlan) QueryBlockOffset() int
QueryBlockOffset returns 0
func (*MockDataPhysicalPlan) Schema ¶
func (mp *MockDataPhysicalPlan) Schema() *expression.Schema
Schema returns schema
func (*MockDataPhysicalPlan) Stats ¶
func (*MockDataPhysicalPlan) Stats() *property.StatsInfo
Stats returns nil
type MockDataSource ¶
type MockDataSource struct { GenData []*chunk.Chunk Chunks []*chunk.Chunk P MockDataSourceParameters exec.BaseExecutor ChunkPtr int }
MockDataSource mocks data source
func BuildMockDataSource ¶
func BuildMockDataSource(opt MockDataSourceParameters) *MockDataSource
BuildMockDataSource builds MockDataSource
func BuildMockDataSourceWithIndex ¶
func BuildMockDataSourceWithIndex(opt MockDataSourceParameters, index []int) *MockDataSource
BuildMockDataSourceWithIndex builds MockDataSourceWithIndex
func (*MockDataSource) GenColDatums ¶
func (mds *MockDataSource) GenColDatums(col int) (results []any)
GenColDatums get column datums
func (*MockDataSource) PrepareChunks ¶
func (mds *MockDataSource) PrepareChunks()
PrepareChunks prepares chunks
type MockDataSourceParameters ¶
type MockDataSourceParameters struct { Ctx sessionctx.Context DataSchema *expression.Schema GenDataFunc func(row int, typ *types.FieldType) any Ndvs []int Orders []bool // Sometimes, user wants to manually provide test data // and he can save provided test data at here. Datums [][]any Rows int HasSel bool }
MockDataSourceParameters mpcks data source parameters
type MockPhysicalPlan ¶
type MockPhysicalPlan interface { plannercore.PhysicalPlan GetExecutor() exec.Executor }
MockPhysicalPlan is used to return a specified executor in when build. It is mainly used for testing.
type SortCase ¶
type SortCase struct { Ctx sessionctx.Context OrderByIdx []int Ndvs []int Rows int }
SortCase is the sort case
func DefaultSortTestCase ¶
func DefaultSortTestCase(ctx sessionctx.Context) *SortCase
DefaultSortTestCase returns default sort test case
func SortTestCaseWithMemoryLimit ¶
func SortTestCaseWithMemoryLimit(ctx sessionctx.Context, bytesLimit int64) *SortCase
SortTestCaseWithMemoryLimit returns sort test case
type WindowTestCase ¶
type WindowTestCase struct { Ctx sessionctx.Context Frame *logicalop.WindowFrame WindowFunc string RawDataSmall string Columns []*expression.Column NumFunc int Ndv int Rows int Concurrency int Pipelined int DataSourceSorted bool }
WindowTestCase has a fixed schema (col Double, partitionBy LongLong, rawData VarString(16), col LongLong).
func DefaultWindowTestCase ¶
func DefaultWindowTestCase(ctx sessionctx.Context) *WindowTestCase
DefaultWindowTestCase returns default window test case