executor

package
v0.0.0-...-3903214 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructResultOfShowCreateTable

func ConstructResultOfShowCreateTable(ctx sctx.Context, tableInfo *model.TableMeta, buf *bytes.Buffer) (err error)

ConstructResultOfShowCreateTable constructs the result for show create table.

func NewFirstChunk

func NewFirstChunk(e Executor) *chunk.Chunk

newFirstChunk creates a new chunk to buffer current executor's result.

func Next

func Next(ctx context.Context, e Executor, req *chunk.Chunk) error

Next is a wrapper function on e.Next(), it handles some common codes.

func PrintStack

func PrintStack()

Types

type AggExec

type AggExec struct {
	AggFuncs []aggfuncs.AggFunc
	// contains filtered or unexported fields
}

func (*AggExec) Close

func (e *AggExec) Close() error

func (*AggExec) Next

func (e *AggExec) Next(ctx context.Context, req *chunk.Chunk) error

func (*AggExec) Open

func (e *AggExec) Open(ctx context.Context) error

func (*AggExec) Schema

func (e *AggExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type AggWorker

type AggWorker struct {
	AggFunc aggfuncs.AggFunc
	// contains filtered or unexported fields
}

type BatchPointGetExecutor

type BatchPointGetExecutor struct {
	// contains filtered or unexported fields
}

func (*BatchPointGetExecutor) Close

func (e *BatchPointGetExecutor) Close() error

Close closes all executors and release all resources.

func (*BatchPointGetExecutor) Next

func (*BatchPointGetExecutor) Open

func (e *BatchPointGetExecutor) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*BatchPointGetExecutor) Schema

func (e *BatchPointGetExecutor) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type Compiler

type Compiler struct {
	Ctx sctx.Context
}

func (*Compiler) Compile

func (c *Compiler) Compile(ctx context.Context, stmtNode ast.StmtNode) (*ExecutorBuilder, error)

type CountWorker

type CountWorker struct {
	// contains filtered or unexported fields
}

type DDLExec

type DDLExec struct {
	// contains filtered or unexported fields
}

DDLExec represents a DDL executor. It grabs a DDL instance from Domain, calling the DDL methods to do the work.

func (*DDLExec) Close

func (e *DDLExec) Close() error

Close closes all executors and release all resources.

func (*DDLExec) Next

func (e *DDLExec) Next(ctx context.Context, req *chunk.Chunk) (err error)

func (*DDLExec) Open

func (e *DDLExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*DDLExec) Schema

func (e *DDLExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type DeleteExec

type DeleteExec struct {
	// contains filtered or unexported fields
}

func (*DeleteExec) Close

func (e *DeleteExec) Close() error

func (*DeleteExec) Next

func (e *DeleteExec) Next(ctx context.Context, req *chunk.Chunk) error

func (*DeleteExec) Open

func (e *DeleteExec) Open(ctx context.Context) error

func (*DeleteExec) Schema

func (e *DeleteExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type Executor

type Executor interface {
	Open(context.Context) error
	Next(ctx context.Context, req *chunk.Chunk) error
	Close() error
	Schema() *expression.Schema
	// contains filtered or unexported methods
}

Executor is the physical implementation of a algebra operator.

In TiDB, all algebra operators are implemented as iterators, i.e., they support a simple Open-Next-Close protocol. See this paper for more details:

"Volcano-An Extensible and Parallel Query Evaluation System"

Different from Volcano's execution model, a "Next" function call in TiDB will return a batch of rows, other than a single row in Volcano. NOTE: Executors must call "chk.Reset()" before appending their results to it.

type ExecutorBuilder

type ExecutorBuilder struct {
	Plan     planner.Plan
	Ctx      sctx.Context
	StmtNode ast.StmtNode

	OutputNames types.NameSlice
	// contains filtered or unexported fields
}

func (*ExecutorBuilder) Build

func (eb *ExecutorBuilder) Build(ctx context.Context) (*recordSet, error)

type FakerExec

type FakerExec struct {
	// contains filtered or unexported fields
}

func (*FakerExec) Close

func (e *FakerExec) Close() error

Close closes all executors and release all resources.

func (*FakerExec) Next

func (e *FakerExec) Next(ctx context.Context, req *chunk.Chunk) error

Next fills multiple rows into a chunk.

func (*FakerExec) Open

func (e *FakerExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*FakerExec) Schema

func (e *FakerExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type InsertExec

type InsertExec struct {
	// contains filtered or unexported fields
}

func (*InsertExec) Close

func (e *InsertExec) Close() error

Close closes all executors and release all resources.

func (*InsertExec) Next

func (e *InsertExec) Next(ctx context.Context, req *chunk.Chunk) error

func (*InsertExec) Open

func (e *InsertExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*InsertExec) Schema

func (e *InsertExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type LimitExec

type LimitExec struct {
	// contains filtered or unexported fields
}

LimitExec represents limit executor It ignores 'Offset' rows from src, then returns 'Count' rows at maximum.

func (*LimitExec) Close

func (e *LimitExec) Close() error

Close implements the Executor Close interface.

func (*LimitExec) Next

func (e *LimitExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*LimitExec) Open

func (e *LimitExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*LimitExec) Schema

func (e *LimitExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ParallelScanExecutor

type ParallelScanExecutor struct {
	// contains filtered or unexported fields
}

use for table rows counting for now.

func (*ParallelScanExecutor) Close

func (e *ParallelScanExecutor) Close() error

Close closes all executors and release all resources.

func (*ParallelScanExecutor) Next

func (e *ParallelScanExecutor) Next(ctx context.Context, req *chunk.Chunk) error

func (*ParallelScanExecutor) Open

func (*ParallelScanExecutor) Schema

func (e *ParallelScanExecutor) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ProjExec

type ProjExec struct {
	Exprs []expression.Expression
	// contains filtered or unexported fields
}

func (*ProjExec) Close

func (p *ProjExec) Close() error

func (*ProjExec) Next

func (p *ProjExec) Next(ctx context.Context, req *chunk.Chunk) error

func (*ProjExec) Open

func (p *ProjExec) Open(ctx context.Context) error

func (*ProjExec) Schema

func (e *ProjExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SelectionExec

type SelectionExec struct {
	// contains filtered or unexported fields
}

func (*SelectionExec) Close

func (e *SelectionExec) Close() error

func (*SelectionExec) Next

func (e *SelectionExec) Next(ctx context.Context, req *chunk.Chunk) error

func (*SelectionExec) Open

func (e *SelectionExec) Open(ctx context.Context) error

func (*SelectionExec) Schema

func (e *SelectionExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SetExec

type SetExec struct {
	// contains filtered or unexported fields
}

func (*SetExec) Close

func (e *SetExec) Close() error

Close closes all executors and release all resources.

func (*SetExec) Next

func (e *SetExec) Next(ctx context.Context, req *chunk.Chunk) error

func (*SetExec) Open

func (e *SetExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*SetExec) Schema

func (e *SetExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ShowExec

type ShowExec struct {
	Tp ast.ShowStmtType

	Plan *planner.LogicalShow

	GlobalScope bool
	// contains filtered or unexported fields
}

func (*ShowExec) Close

func (e *ShowExec) Close() error

Close closes all executors and release all resources.

func (*ShowExec) Next

func (s *ShowExec) Next(ctx context.Context, req *chunk.Chunk) error

func (*ShowExec) Open

func (e *ShowExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*ShowExec) Schema

func (s *ShowExec) Schema() *expression.Schema

type SimpleExec

type SimpleExec struct {
	Statement ast.StmtNode
	// contains filtered or unexported fields
}

func (*SimpleExec) Close

func (e *SimpleExec) Close() error

Close closes all executors and release all resources.

func (*SimpleExec) Next

func (s *SimpleExec) Next(ctx context.Context, req *chunk.Chunk) error

func (*SimpleExec) Open

func (e *SimpleExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*SimpleExec) Schema

func (e *SimpleExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SimpleScanExecutor

type SimpleScanExecutor struct {
	// contains filtered or unexported fields
}

func (*SimpleScanExecutor) Close

func (e *SimpleScanExecutor) Close() error

Close closes all executors and release all resources.

func (*SimpleScanExecutor) Next

func (e *SimpleScanExecutor) Next(ctx context.Context, req *chunk.Chunk) error

func (*SimpleScanExecutor) Open

func (e *SimpleScanExecutor) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*SimpleScanExecutor) Schema

func (e *SimpleScanExecutor) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SortExec

type SortExec struct {
	ByItems []*planner.ByItems
	Idx     int
	// contains filtered or unexported fields
}

SortExec represents sorting executor.

func (*SortExec) Close

func (e *SortExec) Close() error

Close implements the Executor Close interface.

func (*SortExec) Next

func (e *SortExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface. Sort constructs the result following these step:

  1. Read as mush as rows into memory.
  2. If memory quota is triggered, sort these rows in memory and put them into disk as partition 1, then reset the memory quota trigger and return to step 1
  3. If memory quota is not triggered and child is consumed, sort these rows in memory as partition N.
  4. Merge sort if the count of partitions is larger than 1. If there is only one partition in step 4, it works just like in-memory sort before.

func (*SortExec) Open

func (e *SortExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*SortExec) Schema

func (e *SortExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SplitIndexRegionExec

type SplitIndexRegionExec struct {
	// contains filtered or unexported fields
}

func (*SplitIndexRegionExec) Close

func (e *SplitIndexRegionExec) Close() error

Close closes all executors and release all resources.

func (*SplitIndexRegionExec) Next

func (e *SplitIndexRegionExec) Next(ctx context.Context, chk *chunk.Chunk) error

func (*SplitIndexRegionExec) Open

func (e *SplitIndexRegionExec) Open(ctx context.Context) (err error)

func (*SplitIndexRegionExec) Schema

func (e *SplitIndexRegionExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type TableDualExec

type TableDualExec struct {
	// contains filtered or unexported fields
}

TableDualExec represents a dual table executor.

func (*TableDualExec) Close

func (e *TableDualExec) Close() error

Close closes all executors and release all resources.

func (*TableDualExec) Next

func (e *TableDualExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*TableDualExec) Open

func (e *TableDualExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*TableDualExec) Schema

func (e *TableDualExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type TableScanExec

type TableScanExec struct {
	IdxVals []types.Datum
	Index   *model.IndexMeta
	PkVals  []types.Datum

	Limit uint64
	// contains filtered or unexported fields
}

func (*TableScanExec) Close

func (t *TableScanExec) Close() error

func (*TableScanExec) Next

func (t *TableScanExec) Next(ctx context.Context, req *chunk.Chunk) error

func (*TableScanExec) Open

func (t *TableScanExec) Open(ctx context.Context) error

func (*TableScanExec) Schema

func (e *TableScanExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type UpdateExec

type UpdateExec struct {
	// contains filtered or unexported fields
}

func (*UpdateExec) Close

func (e *UpdateExec) Close() error

func (*UpdateExec) Next

func (e *UpdateExec) Next(ctx context.Context, req *chunk.Chunk) error

func (*UpdateExec) Open

func (e *UpdateExec) Open(ctx context.Context) error

func (*UpdateExec) Schema

func (e *UpdateExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ZettaScanExec

type ZettaScanExec struct {
	// contains filtered or unexported fields
}

func (*ZettaScanExec) Close

func (e *ZettaScanExec) Close() error

Close closes all executors and release all resources.

func (*ZettaScanExec) Next

func (e *ZettaScanExec) Next(ctx context.Context, req *chunk.Chunk) error

Next fills multiple rows into a chunk.

func (*ZettaScanExec) Open

func (e *ZettaScanExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*ZettaScanExec) Schema

func (e *ZettaScanExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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