exec

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Empty = &StaticRows{rows: common.NewRows(nil, 0)}

Empty executor.

Functions

func ConnectPullExecutors

func ConnectPullExecutors(childExecutors []PullExecutor, parent PullExecutor)

Types

type ExecutorType

type ExecutorType uint32

type PullChain

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

PullChain combines a sequence of executors in a linked list and exposes them as a single executor.

func NewPullChain

func NewPullChain(head PullExecutor, tail ...PullExecutor) *PullChain

func (*PullChain) AddChild

func (c *PullChain) AddChild(child PullExecutor)

func (*PullChain) Close added in v0.1.1

func (c *PullChain) Close()

func (*PullChain) ColNames

func (c *PullChain) ColNames() []string

func (*PullChain) ColTypes

func (c *PullChain) ColTypes() []common.ColumnType

func (*PullChain) GetChildren

func (c *PullChain) GetChildren() []PullExecutor

func (*PullChain) GetParent

func (c *PullChain) GetParent() PullExecutor

func (*PullChain) GetRows

func (c *PullChain) GetRows(limit int) (*common.Rows, error)

func (*PullChain) RowsFactory added in v0.1.1

func (c *PullChain) RowsFactory() *common.RowsFactory

func (*PullChain) SetColNames

func (c *PullChain) SetColNames(colNames []string)

func (*PullChain) SetParent

func (c *PullChain) SetParent(parent PullExecutor)

type PullExecutor

type PullExecutor interface {
	/*
		GetRows returns up to a maximum of limit rows. If less than limit rows are returned that means there are no more
		rows to return. If limit rows are returned it means there may be more rows to return and the caller should call
		GetRows again until less than limit rows are returned.
	*/
	GetRows(limit int) (rows *common.Rows, err error)
	SetParent(parent PullExecutor)
	AddChild(child PullExecutor)
	GetParent() PullExecutor
	GetChildren() []PullExecutor
	ColNames() []string
	ColTypes() []common.ColumnType
	SetColNames(colNames []string)
	RowsFactory() *common.RowsFactory
	Close()
}

type PullIndexReader

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

func NewPullIndexReader

func NewPullIndexReader(tableInfo *common.TableInfo,
	indexInfo *common.IndexInfo,
	colIndexes []int,
	storage cluster.Cluster,
	shardID uint64,
	scanRanges []*ScanRange) (*PullIndexReader, error)

func (*PullIndexReader) AddChild

func (p *PullIndexReader) AddChild(child PullExecutor)

func (*PullIndexReader) Close added in v0.1.1

func (p *PullIndexReader) Close()

func (*PullIndexReader) ColNames

func (p *PullIndexReader) ColNames() []string

func (*PullIndexReader) ColTypes

func (p *PullIndexReader) ColTypes() []common.ColumnType

func (*PullIndexReader) GetChildren

func (p *PullIndexReader) GetChildren() []PullExecutor

func (*PullIndexReader) GetParent

func (p *PullIndexReader) GetParent() PullExecutor

func (*PullIndexReader) GetRows

func (p *PullIndexReader) GetRows(limit int) (rows *common.Rows, err error)

func (*PullIndexReader) KeyCols

func (p *PullIndexReader) KeyCols() []int

func (*PullIndexReader) RowsFactory added in v0.1.1

func (p *PullIndexReader) RowsFactory() *common.RowsFactory

func (*PullIndexReader) SetColNames

func (p *PullIndexReader) SetColNames(colNames []string)

func (*PullIndexReader) SetParent

func (p *PullIndexReader) SetParent(parent PullExecutor)

type PullLimit

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

PullLimit is an executor for LIMIT <offset>, <count> statement and its variations.

func NewPullLimit

func NewPullLimit(colNames []string, colTypes []common.ColumnType, count, offset uint64) *PullLimit

func (*PullLimit) AddChild

func (p *PullLimit) AddChild(child PullExecutor)

func (*PullLimit) Close added in v0.1.1

func (p *PullLimit) Close()

func (*PullLimit) ColNames

func (p *PullLimit) ColNames() []string

func (*PullLimit) ColTypes

func (p *PullLimit) ColTypes() []common.ColumnType

func (*PullLimit) GetChildren

func (p *PullLimit) GetChildren() []PullExecutor

func (*PullLimit) GetParent

func (p *PullLimit) GetParent() PullExecutor

func (*PullLimit) GetRows

func (l *PullLimit) GetRows(maxRowsToReturn int) (*common.Rows, error)

func (*PullLimit) KeyCols

func (p *PullLimit) KeyCols() []int

func (*PullLimit) RowsFactory added in v0.1.1

func (p *PullLimit) RowsFactory() *common.RowsFactory

func (*PullLimit) SetColNames

func (p *PullLimit) SetColNames(colNames []string)

func (*PullLimit) SetParent

func (p *PullLimit) SetParent(parent PullExecutor)

type PullProjection

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

func NewPullProjection

func NewPullProjection(colNames []string, colTypes []common.ColumnType, projColumns []*common.Expression) (*PullProjection, error)

func (*PullProjection) AddChild

func (p *PullProjection) AddChild(child PullExecutor)

func (*PullProjection) Close added in v0.1.1

func (p *PullProjection) Close()

func (*PullProjection) ColNames

func (p *PullProjection) ColNames() []string

func (*PullProjection) ColTypes

func (p *PullProjection) ColTypes() []common.ColumnType

func (*PullProjection) GetChildren

func (p *PullProjection) GetChildren() []PullExecutor

func (*PullProjection) GetParent

func (p *PullProjection) GetParent() PullExecutor

func (*PullProjection) GetRows

func (p *PullProjection) GetRows(limit int) (rows *common.Rows, err error)

func (*PullProjection) KeyCols

func (p *PullProjection) KeyCols() []int

func (*PullProjection) RowsFactory added in v0.1.1

func (p *PullProjection) RowsFactory() *common.RowsFactory

func (*PullProjection) SetColNames

func (p *PullProjection) SetColNames(colNames []string)

func (*PullProjection) SetParent

func (p *PullProjection) SetParent(parent PullExecutor)

type PullSelect

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

func NewPullSelect

func NewPullSelect(colNames []string, colTypes []common.ColumnType, predicates []*common.Expression) *PullSelect

func (*PullSelect) AddChild

func (p *PullSelect) AddChild(child PullExecutor)

func (*PullSelect) Close added in v0.1.1

func (p *PullSelect) Close()

func (*PullSelect) ColNames

func (p *PullSelect) ColNames() []string

func (*PullSelect) ColTypes

func (p *PullSelect) ColTypes() []common.ColumnType

func (*PullSelect) GetChildren

func (p *PullSelect) GetChildren() []PullExecutor

func (*PullSelect) GetParent

func (p *PullSelect) GetParent() PullExecutor

func (*PullSelect) GetRows

func (p *PullSelect) GetRows(limit int) (rows *common.Rows, err error)

func (*PullSelect) KeyCols

func (p *PullSelect) KeyCols() []int

func (*PullSelect) RowsFactory added in v0.1.1

func (p *PullSelect) RowsFactory() *common.RowsFactory

func (*PullSelect) SetColNames

func (p *PullSelect) SetColNames(colNames []string)

func (*PullSelect) SetParent

func (p *PullSelect) SetParent(parent PullExecutor)

type PullSort

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

PullSort - a simple in memory sort executor TODO this won't work for large resultsets - we need to store in chunks on disk and use a multi-way merge sort in that case

func NewPullSort

func NewPullSort(colNames []string, colTypes []common.ColumnType, desc []bool, sortByExpressions []*common.Expression) *PullSort

func (*PullSort) AddChild

func (p *PullSort) AddChild(child PullExecutor)

func (*PullSort) Close added in v0.1.1

func (p *PullSort) Close()

func (*PullSort) ColNames

func (p *PullSort) ColNames() []string

func (*PullSort) ColTypes

func (p *PullSort) ColTypes() []common.ColumnType

func (*PullSort) GetChildren

func (p *PullSort) GetChildren() []PullExecutor

func (*PullSort) GetParent

func (p *PullSort) GetParent() PullExecutor

func (*PullSort) GetRows

func (p *PullSort) GetRows(limit int) (*common.Rows, error)

func (*PullSort) KeyCols

func (p *PullSort) KeyCols() []int

func (*PullSort) RowsFactory added in v0.1.1

func (p *PullSort) RowsFactory() *common.RowsFactory

func (*PullSort) SetColNames

func (p *PullSort) SetColNames(colNames []string)

func (*PullSort) SetParent

func (p *PullSort) SetParent(parent PullExecutor)

type PullTableScan

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

func NewPullTableScan

func NewPullTableScan(tableInfo *common.TableInfo, colIndexes []int, storage cluster.Cluster, shardID uint64,
	scanRanges []*ScanRange) (*PullTableScan, error)

func (*PullTableScan) AddChild

func (p *PullTableScan) AddChild(child PullExecutor)

func (*PullTableScan) Close added in v0.1.1

func (p *PullTableScan) Close()

func (*PullTableScan) ColNames

func (p *PullTableScan) ColNames() []string

func (*PullTableScan) ColTypes

func (p *PullTableScan) ColTypes() []common.ColumnType

func (*PullTableScan) GetChildren

func (p *PullTableScan) GetChildren() []PullExecutor

func (*PullTableScan) GetParent

func (p *PullTableScan) GetParent() PullExecutor

func (*PullTableScan) GetRows

func (p *PullTableScan) GetRows(limit int) (rows *common.Rows, err error)

func (*PullTableScan) KeyCols

func (p *PullTableScan) KeyCols() []int

func (*PullTableScan) RowsFactory added in v0.1.1

func (p *PullTableScan) RowsFactory() *common.RowsFactory

func (*PullTableScan) SetColNames

func (p *PullTableScan) SetColNames(colNames []string)

func (*PullTableScan) SetParent

func (p *PullTableScan) SetParent(parent PullExecutor)

type RemoteExecutor

type RemoteExecutor struct {
	RemoteDag PullExecutor
	ShardIDs  []uint64
	// contains filtered or unexported fields
}

func NewRemoteExecutor

func NewRemoteExecutor(remoteDAG PullExecutor, queryInfo *cluster.QueryExecutionInfo, colNames []string,
	colTypes []common.ColumnType, schemaName string, clust cluster.Cluster, pointGetShardIDs []uint64) *RemoteExecutor

func (*RemoteExecutor) AddChild

func (p *RemoteExecutor) AddChild(child PullExecutor)

func (*RemoteExecutor) Close added in v0.1.1

func (re *RemoteExecutor) Close()

Close - We override the Close method for PullExecutor and we call our remote shards with limit zero. This signals them to release any resources. Close is only called when the query is closed before all rows are returned - e.g. if a limit has been provided on the query and has been reached

func (*RemoteExecutor) ColNames

func (p *RemoteExecutor) ColNames() []string

func (*RemoteExecutor) ColTypes

func (p *RemoteExecutor) ColTypes() []common.ColumnType

func (*RemoteExecutor) GetChildren

func (p *RemoteExecutor) GetChildren() []PullExecutor

func (*RemoteExecutor) GetParent

func (p *RemoteExecutor) GetParent() PullExecutor

func (*RemoteExecutor) GetRows

func (re *RemoteExecutor) GetRows(limit int) (rows *common.Rows, err error)

func (*RemoteExecutor) KeyCols

func (p *RemoteExecutor) KeyCols() []int

func (*RemoteExecutor) RowsFactory added in v0.1.1

func (p *RemoteExecutor) RowsFactory() *common.RowsFactory

func (*RemoteExecutor) SetColNames

func (p *RemoteExecutor) SetColNames(colNames []string)

func (*RemoteExecutor) SetParent

func (p *RemoteExecutor) SetParent(parent PullExecutor)

type ScanRange

type ScanRange struct {
	LowVals  []interface{}
	HighVals []interface{}
	LowExcl  bool
	HighExcl bool
}

type StaticRows

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

func NewStaticRows

func NewStaticRows(colNames []string, rows *common.Rows) (*StaticRows, error)

NewStaticRows created static rows pull executor.

func (*StaticRows) AddChild

func (p *StaticRows) AddChild(child PullExecutor)

func (*StaticRows) Close added in v0.1.1

func (p *StaticRows) Close()

func (*StaticRows) ColNames

func (p *StaticRows) ColNames() []string

func (*StaticRows) ColTypes

func (p *StaticRows) ColTypes() []common.ColumnType

func (*StaticRows) GetChildren

func (p *StaticRows) GetChildren() []PullExecutor

func (*StaticRows) GetParent

func (p *StaticRows) GetParent() PullExecutor

func (*StaticRows) GetRows

func (s *StaticRows) GetRows(limit int) (rows *common.Rows, err error)

func (*StaticRows) KeyCols

func (p *StaticRows) KeyCols() []int

func (*StaticRows) RowsFactory added in v0.1.1

func (p *StaticRows) RowsFactory() *common.RowsFactory

func (*StaticRows) SetColNames

func (p *StaticRows) SetColNames(colNames []string)

func (*StaticRows) SetParent

func (p *StaticRows) SetParent(parent PullExecutor)

Jump to

Keyboard shortcuts

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