dml

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatePlan

type AggregatePlan struct {
	proto.Plan
	Fields []ast.SelectElement
}

func (*AggregatePlan) ExecIn

func (ap *AggregatePlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

type CompositePlan

type CompositePlan struct {
	Plans []proto.Plan
}

CompositePlan merges multiple query plan.

func (CompositePlan) ExecIn

func (u CompositePlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

func (CompositePlan) Type

func (u CompositePlan) Type() proto.PlanType

type DropWeakPlan

type DropWeakPlan struct {
	proto.Plan
	WeakList []*ext.WeakSelectElement
}

DropWeakPlan drops weak fields from upstream dataset.

For example:

SELECT id,uid,name FROM student WHERE ... ORDER BY age DESC

will be written:

SELECT id,uid,name,age FROM student WHERE ... ORDER BY age DESC

the `age` field is weak, will be dropped finally.

func (DropWeakPlan) ExecIn

func (dr DropWeakPlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

type GroupPlan

type GroupPlan struct {
	Plan       proto.Plan
	AggItems   map[int]func() merge.Aggregator
	GroupItems []dataset.OrderByItem

	OriginColumnCount int
}

GroupPlan TODO now only support stmt which group by items equal with order by items, such as `select uid, max(score) from student group by uid order by uid`

func (*GroupPlan) ExecIn

func (g *GroupPlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

func (*GroupPlan) Type

func (g *GroupPlan) Type() proto.PlanType

type HashJoinPlan

type HashJoinPlan struct {
	BuildPlan proto.Plan
	ProbePlan proto.Plan

	BuildKey string
	ProbeKey string

	IsFilterProbeRow bool
	IsReversedColumn bool

	Stmt *ast.SelectStatement
	// contains filtered or unexported fields
}

func (*HashJoinPlan) ExecIn

func (h *HashJoinPlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

func (*HashJoinPlan) Type

func (h *HashJoinPlan) Type() proto.PlanType

type InsertSelectPlan

type InsertSelectPlan struct {
	plan.BasePlan
	Batch map[string]*ast.InsertSelectStatement
}

func NewInsertSelectPlan

func NewInsertSelectPlan() *InsertSelectPlan

func (*InsertSelectPlan) ExecIn

func (sp *InsertSelectPlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

func (*InsertSelectPlan) Type

func (sp *InsertSelectPlan) Type() proto.PlanType

type JoinTable

type JoinTable struct {
	Tables []string
	Alias  string
}

type LimitPlan

type LimitPlan struct {
	ParentPlan     proto.Plan
	OriginOffset   int64
	OverwriteLimit int64
}

func (*LimitPlan) ExecIn

func (limitPlan *LimitPlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

func (*LimitPlan) Type

func (limitPlan *LimitPlan) Type() proto.PlanType

type LocalSelectPlan

type LocalSelectPlan struct {
	plan.BasePlan
	Stmt       *ast.SelectStatement
	Result     []proto.Value
	ColumnList []string
}

func (*LocalSelectPlan) ExecIn

func (s *LocalSelectPlan) ExecIn(ctx context.Context, _ proto.VConn) (proto.Result, error)

func (*LocalSelectPlan) Type

func (s *LocalSelectPlan) Type() proto.PlanType

type LocalSequencePlan

type LocalSequencePlan struct {
	plan.BasePlan
	Stmt       *ast.SelectStatement
	VTs        []*rule.VTable
	ColumnList []string
}

func (*LocalSequencePlan) ExecIn

func (*LocalSequencePlan) Type

func (s *LocalSequencePlan) Type() proto.PlanType

type MappingPlan

type MappingPlan struct {
	proto.Plan
	Fields []ast.SelectElement
}

MappingPlan represents a query plan which will mapping column values.

func (*MappingPlan) ExecIn

func (mp *MappingPlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

type OrderPlan

type OrderPlan struct {
	ParentPlan   proto.Plan
	OrderByItems []dataset.OrderByItem
}

func (*OrderPlan) ExecIn

func (op *OrderPlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

func (*OrderPlan) Type

func (op *OrderPlan) Type() proto.PlanType

type RenamePlan

type RenamePlan struct {
	proto.Plan
	RenameList []string
}

func (RenamePlan) ExecIn

func (rp RenamePlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

type SimpleDeletePlan

type SimpleDeletePlan struct {
	plan.BasePlan
	// contains filtered or unexported fields
}

SimpleDeletePlan represents a simple delete plan for sharding table.

func NewSimpleDeletePlan

func NewSimpleDeletePlan(stmt *ast.DeleteStatement) *SimpleDeletePlan

NewSimpleDeletePlan creates a simple delete plan.

func (*SimpleDeletePlan) ExecIn

func (s *SimpleDeletePlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

func (*SimpleDeletePlan) SetShards

func (s *SimpleDeletePlan) SetShards(shards rule.DatabaseTables)

func (*SimpleDeletePlan) Type

func (s *SimpleDeletePlan) Type() proto.PlanType

type SimpleInsertPlan

type SimpleInsertPlan struct {
	plan.BasePlan
	// contains filtered or unexported fields
}

func NewSimpleInsertPlan

func NewSimpleInsertPlan() *SimpleInsertPlan

func (*SimpleInsertPlan) ExecIn

func (sp *SimpleInsertPlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

func (*SimpleInsertPlan) Put

func (sp *SimpleInsertPlan) Put(db string, stmt *ast.InsertStatement)

func (*SimpleInsertPlan) Type

func (sp *SimpleInsertPlan) Type() proto.PlanType

type SimpleJoinPlan

type SimpleJoinPlan struct {
	plan.BasePlan
	Database string
	Left     *JoinTable
	Join     *ast.JoinNode
	Right    *JoinTable
	Stmt     *ast.SelectStatement
}

func (*SimpleJoinPlan) ExecIn

func (s *SimpleJoinPlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

func (*SimpleJoinPlan) Type

func (s *SimpleJoinPlan) Type() proto.PlanType

type SimpleQueryPlan

type SimpleQueryPlan struct {
	plan.BasePlan
	Database string
	Tables   []string
	Stmt     *ast.SelectStatement
}

func (*SimpleQueryPlan) ExecIn

func (s *SimpleQueryPlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

func (*SimpleQueryPlan) Type

func (s *SimpleQueryPlan) Type() proto.PlanType

type UpdatePlan

type UpdatePlan struct {
	plan.BasePlan
	// contains filtered or unexported fields
}

UpdatePlan represents a plan to execute sharding-update.

func NewUpdatePlan

func NewUpdatePlan(stmt *ast.UpdateStatement) *UpdatePlan

NewUpdatePlan creates a sharding-update plan.

func (*UpdatePlan) ExecIn

func (up *UpdatePlan) ExecIn(ctx context.Context, conn proto.VConn) (proto.Result, error)

func (*UpdatePlan) SetShards

func (up *UpdatePlan) SetShards(shards rule.DatabaseTables)

func (*UpdatePlan) Type

func (up *UpdatePlan) Type() proto.PlanType

Jump to

Keyboard shortcuts

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