executor

package
v0.0.0-...-5f37ea0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

@author: panfengguo @since: 2022/11/19 @desc: desc

@author: panfengguo @since: 2022/11/19 @desc: desc

@author: panfengguo @since: 2022/11/20 @desc: desc

@author: panfengguo @since: 2022/11/19 @desc: desc

@author: panfengguo @since: 2022/11/19 @desc: desc

Index

Constants

View Source
const (
	ScanSqlStr  = "SELECT * FROM %s;"
	CreateTbStr = `
CREATE TABLE IF NOT EXISTS %s(%s
)ENGINE=InnoDB DEFAULT CHARSET=utf8;`
	InsertSqlStr      = `INSERT INTO %s (%s) VALUES (%s);`
	DeleteSqlStr      = `DELETE FROM %s;`
	SelectCountSqlStr = `SELECT COUNT(1) FROM %s;`
)
View Source
const (
	CellIntType = iota
	CellStringType
)
View Source
const (
	ExecutorSvc = "ExecutorService"
	ExecuteQT   = "ExecuteQT"
	GetDataNum  = "GetDataNum"
)

Variables

This section is empty.

Functions

func Compare

func Compare(cell1 Cell, cell2 Cell, comp plan.CompareType_) bool

func RegisterService

func RegisterService(service ExecutorService) error

func RemoteGetDataNum

func RemoteGetDataNum(site, table string) (int, error)

func RunExecutor

func RunExecutor(config *config.ServerConfig)

Types

type Cell

type Cell interface {
	fmt.Stringer
	Type() CellType
}

type CellInt

type CellInt uint32

func (CellInt) String

func (c CellInt) String() string

func (CellInt) Type

func (c CellInt) Type() CellType

type CellString

type CellString string

func (CellString) String

func (c CellString) String() string

func (CellString) Type

func (c CellString) Type() CellType

type CellType

type CellType int

type ExecuteQTArgs

type ExecuteQTArgs struct {
	QT plan.Plantree
}

type ExecuteQTReply

type ExecuteQTReply struct {
	QueryResult *QueryResult
}

type Executor

type Executor struct {
	Ip   string  // executor服务ip
	Port int     // executor服务端口
	Db   *sql.DB // executor本地db
}

func NewExecutor

func NewExecutor(config *config.ServerConfig) *Executor

func (*Executor) ExecuteCreateFrag

func (e *Executor) ExecuteCreateFrag(op *plan.Operator_) (*QueryResult, error)

func (*Executor) ExecuteDelete

func (e *Executor) ExecuteDelete(op *plan.Operator_) (*QueryResult, error)

func (*Executor) ExecuteFunc

func (e *Executor) ExecuteFunc(op *plan.Operator_) (*QueryResult, error)

func (*Executor) ExecuteInsert

func (e *Executor) ExecuteInsert(op *plan.Operator_) (*QueryResult, error)

func (*Executor) ExecuteJoin

func (e *Executor) ExecuteJoin(op *plan.Operator_) (*QueryResult, error)

func (*Executor) ExecutePredicate

func (e *Executor) ExecutePredicate(op *plan.Operator_) (*QueryResult, error)

func (*Executor) ExecuteProject

func (e *Executor) ExecuteProject(op *plan.Operator_) (*QueryResult, error)

func (*Executor) ExecuteQT

func (e *Executor) ExecuteQT(args ExecuteQTArgs, reply *ExecuteQTReply) error

func (*Executor) ExecuteScan

func (e *Executor) ExecuteScan(op *plan.Operator_) (*QueryResult, error)

func (*Executor) ExecuteSelectCount

func (e *Executor) ExecuteSelectCount(table string) (int, error)

func (*Executor) ExecuteUnion

func (e *Executor) ExecuteUnion(op *plan.Operator_) (*QueryResult, error)

func (*Executor) GetDataNum

func (e *Executor) GetDataNum(args GetDataNumArgs, reply *GetDataNumReply) error

type ExecutorService

type ExecutorService interface {
	ExecuteQT(args ExecuteQTArgs, reply *ExecuteQTReply) error
	GetDataNum(args GetDataNumArgs, reply *GetDataNumReply) error
}

type Field

type Field struct {
	TableName string
	FieldName string
	Type      reflect.Kind
}

type GetDataNumArgs

type GetDataNumArgs struct {
	Table string
}

type GetDataNumReply

type GetDataNumReply struct {
	DataNum int
}

type QueryResult

type QueryResult struct {
	Field []Field  // 字段名
	Data  [][]Cell // 字段值
}

func NewQueryResult

func NewQueryResult(columnTypes []*sql.ColumnType, tableName string) (*QueryResult, error)

func RemoteExecuteQT

func RemoteExecuteQT(host string, planT *plan.Plantree) (*QueryResult, error)

func (*QueryResult) NewDataRow

func (q *QueryResult) NewDataRow() ([]interface{}, error)

func (*QueryResult) PrintResult

func (q *QueryResult) PrintResult()

func (*QueryResult) String

func (q *QueryResult) String() string

type TempType

type TempType uint32

Jump to

Keyboard shortcuts

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