colexec

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AUTO_INCR_TABLE = "%!%mo_increment_columns"
View Source
var AUTO_INCR_TABLE_COLNAME []string = []string{catalog.Row_ID, "name", "offset", "step"}
View Source
var CnAddr string

Functions

func CommitTxn added in v0.6.0

func CommitTxn(eg engine.Engine, txn client.TxnOperator, ctx context.Context) error

func CreateAutoIncrCol added in v0.6.0

func CreateAutoIncrCol(eg engine.Engine, ctx context.Context, db engine.Database, proc *process.Process, cols []*plan.ColDef, dbName, tblName string) error

for create table operation, add col in mo_increment_columns table

func CreateAutoIncrTable added in v0.6.0

func CreateAutoIncrTable(e engine.Engine, ctx context.Context, proc *process.Process, dbName string) error

for create database operation, add col in mo_increment_columns table

func DeleteAutoIncrCol added in v0.6.0

func DeleteAutoIncrCol(eg engine.Engine, ctx context.Context, db engine.Database, rel engine.Relation, proc *process.Process, dbName string, tableID uint64) error

for delete table operation, delete col in mo_increment_columns table

func EvalExpr

func EvalExpr(bat *batch.Batch, proc *process.Process, expr *plan.Expr) (*vector.Vector, error)

func EvalExprByZonemapBat added in v0.6.0

func EvalExprByZonemapBat(ctx context.Context, bat *batch.Batch, proc *process.Process, expr *plan.Expr) (*vector.Vector, error)

func FilterAndDelByRowId added in v0.7.0

func FilterAndDelByRowId(proc *process.Process, bat *batch.Batch, idxList []int32, rels []engine.Relation) (uint64, error)

func FilterAndUpdateByRowId added in v0.7.0

func FilterAndUpdateByRowId(
	eg engine.Engine,
	proc *process.Process,
	bat *batch.Batch,
	idxList [][]int32,
	rels []engine.Relation,
	ref []*plan.ObjectRef,
	tableDefs []*plan.TableDef,
	updateCols []map[string]int32,
	parentIdxs []map[string]int32,
	uniqueRels [][]engine.Relation,
) (uint64, error)

func GenerateIndex added in v0.7.0

func GenerateIndex(container *WriteS3Container, fd objectio.BlockObject, objectWriter objectio.Writer, bat *batch.Batch) error

GenerateIndex generates relative indexes for the batch writed directly to s3 from cn For more information, please refer to the comment about func WriteIndex in Writer interface

func GenerateWriter added in v0.7.0

func GenerateWriter(container *WriteS3Container, proc *process.Process) error

func GetBlockMeta added in v0.7.0

func GetBlockMeta(bats []*batch.Batch, container *WriteS3Container, proc *process.Process, idx int) error

After cn writes the data to s3, it will get meta data about the block (aka metaloc) by calling func WriteEndBlocks and cn needs to pass it to dn for conflict detection Except for the case of writing s3 directly, cn doesn't need to sense how dn is labeling the blocks on s3

func GetDeleteBatch added in v0.6.0

func GetDeleteBatch(rel engine.Relation, ctx context.Context, colName string, mp *mpool.MPool) (*batch.Batch, uint64)

func GetNewRelation added in v0.6.0

func GetNewRelation(eg engine.Engine, dbName, tbleName string, txn client.TxnOperator, ctx context.Context) (engine.Relation, error)

func GetUpdateBatch added in v0.7.0

func GetUpdateBatch(proc *process.Process, bat *batch.Batch, idxList []int32, batLen int, attrs []string, rowSkip []bool, parentIdx map[string]int32) (*batch.Batch, error)

func InsertBatch added in v0.7.0

func InsertBatch(
	container *WriteS3Container,
	eg engine.Engine,
	proc *process.Process,
	bat *batch.Batch,
	rel engine.Relation,
	ref *plan.ObjectRef,
	tableDef *plan.TableDef,
	parentIdx map[string]int32,
	uniqueRel []engine.Relation) (uint64, error)

func JoinFilterEvalExpr

func JoinFilterEvalExpr(r, s *batch.Batch, rRow int, proc *process.Process, expr *plan.Expr) (*vector.Vector, error)

func JoinFilterEvalExprInBucket added in v0.6.0

func JoinFilterEvalExprInBucket(r, s *batch.Batch, rRow, sRow int, proc *process.Process, expr *plan.Expr) (*vector.Vector, error)

func MoveAutoIncrCol added in v0.6.0

func MoveAutoIncrCol(eg engine.Engine, ctx context.Context, tblName string, db engine.Database, proc *process.Process, oldTableID, newId uint64, dbName string) error

for delete table operation, move old col as new col in mo_increment_columns table

func NewTxn added in v0.6.0

func NewTxn(eg engine.Engine, proc *process.Process, ctx context.Context) (txn client.TxnOperator, err error)

func ResetAutoInsrCol added in v0.6.0

func ResetAutoInsrCol(eg engine.Engine, ctx context.Context, tblName string, db engine.Database, proc *process.Process, tableID, newId uint64, dbName string) error

for truncate table operation, reset col in mo_increment_columns table

func RewriteFilterExprList

func RewriteFilterExprList(list []*plan.Expr) *plan.Expr

RewriteFilterExprList will convert an expression list to be an AndExpr

func RolllbackTxn added in v0.6.0

func RolllbackTxn(eg engine.Engine, txn client.TxnOperator, ctx context.Context) error

func SortByPrimaryKey added in v0.7.0

func SortByPrimaryKey(proc *process.Process, bat *batch.Batch, pkIdx []int, m *mpool.MPool) error

referece to pkg/sql/colexec/order/order.go logic

func SplitAndExprs added in v0.6.0

func SplitAndExprs(list []*plan.Expr) []*plan.Expr

func UpdateInsertBatch added in v0.6.0

func UpdateInsertBatch(e engine.Engine, ctx context.Context, proc *process.Process, ColDefs []*plan.ColDef, bat *batch.Batch, tableID uint64, dbName, tblName string) error

func WriteBlock added in v0.7.0

func WriteBlock(container *WriteS3Container, bat *batch.Batch, proc *process.Process) error

WriteBlock WriteBlock writes one batch to a buffer and generate related indexes for this batch For more information, please refer to the comment about func Write in Writer interface

func WriteEndBlocks added in v0.7.0

func WriteEndBlocks(container *WriteS3Container, proc *process.Process, idx int) error

WriteEndBlocks WriteEndBlocks write batches in buffer to fileservice(aka s3 in this feature) and get meta data about block on fileservice and put it into metaLocBat For more information, please refer to the comment about func WriteEnd in Writer interface

Types

type AutoIncrParam added in v0.6.0

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

func (*AutoIncrParam) SetLastInsertID added in v0.7.0

func (aip *AutoIncrParam) SetLastInsertID(id uint64)

type ReceiveInfo added in v0.7.0

type ReceiveInfo struct {
	NodeAddr string
	Uuid     uuid.UUID
}

ReceiveInfo used to spec which node, and which registers you need

type ResultPos added in v0.6.0

type ResultPos struct {
	Rel int32
	Pos int32
}

func NewResultPos added in v0.6.0

func NewResultPos(rel int32, pos int32) ResultPos

type Server added in v0.7.0

type Server struct {
	sync.Mutex

	CNSegmentId   [12]byte
	InitSegmentId bool
	// contains filtered or unexported fields
}

TODO: remove batchCntMap when dispatch executor using the stream correctly Server used to support cn2s3 directly, for more info, refer to docs about it

var Srv *Server

func NewServer added in v0.7.0

func NewServer(client logservice.CNHAKeeperClient) *Server

func (*Server) GenerateSegment added in v0.7.0

func (srv *Server) GenerateSegment() (string, error)

SegmentId is part of Id for cn2s3 directly, for more info, refer to docs about it

func (*Server) GetConnector added in v0.7.0

func (srv *Server) GetConnector(id uint64) *process.WaitRegister

func (*Server) GetNotifyChByUuid added in v0.7.0

func (srv *Server) GetNotifyChByUuid(u uuid.UUID) (chan process.WrapCs, bool)

func (*Server) HandleRequest added in v0.7.0

func (srv *Server) HandleRequest(ctx context.Context, req morpc.Message, _ uint64, cs morpc.ClientSession) error

func (*Server) PutNotifyChIntoUuidMap added in v0.7.0

func (srv *Server) PutNotifyChIntoUuidMap(u uuid.UUID, ch chan process.WrapCs) error

func (*Server) RegistConnector added in v0.7.0

func (srv *Server) RegistConnector(reg *process.WaitRegister) uint64

type UuidCsChanMap added in v0.7.0

type UuidCsChanMap struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type WriteS3Container added in v0.7.0

type WriteS3Container struct {
	UniqueRels []engine.Relation
	// contains filtered or unexported fields
}

func NewWriteS3Container added in v0.7.0

func NewWriteS3Container(tableDef *plan.TableDef) *WriteS3Container

func (*WriteS3Container) WriteEnd added in v0.7.0

func (container *WriteS3Container) WriteEnd(proc *process.Process)

func (*WriteS3Container) WriteS3Batch added in v0.7.0

func (container *WriteS3Container) WriteS3Batch(bat *batch.Batch, proc *process.Process, idx int) error

func (*WriteS3Container) WriteS3CacheBatch added in v0.7.0

func (container *WriteS3Container) WriteS3CacheBatch(proc *process.Process) error

Jump to

Keyboard shortcuts

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