Documentation ¶
Index ¶
- func RewriteExpr(expr ast.ExprNode, p LogicalPlan) (expression.Expression, error)
- type Builder
- type ByItem
- type CommonPathExpression
- func (b *CommonPathExpression) AnyDirected() bool
- func (b *CommonPathExpression) DstVarName() model.CIStr
- func (b *CommonPathExpression) Name() model.CIStr
- func (b *CommonPathExpression) SetAnyDirected(anyDirected bool)
- func (b *CommonPathExpression) SetDstVarName(name model.CIStr)
- func (b *CommonPathExpression) SetName(name model.CIStr)
- func (b *CommonPathExpression) SetSrcVarName(name model.CIStr)
- func (b *CommonPathExpression) SrcVarName() model.CIStr
- type DDL
- type Edge
- func (b *Edge) AnyDirected() bool
- func (b *Edge) DstVarName() model.CIStr
- func (b *Edge) Name() model.CIStr
- func (b *Edge) SetAnyDirected(anyDirected bool)
- func (b *Edge) SetDstVarName(name model.CIStr)
- func (b *Edge) SetName(name model.CIStr)
- func (b *Edge) SetSrcVarName(name model.CIStr)
- func (b *Edge) SrcVarName() model.CIStr
- type ElementInsertion
- type GraphVar
- type Insert
- type LogicalDual
- type LogicalLimit
- type LogicalMatch
- type LogicalPlan
- type LogicalProjection
- type LogicalSelection
- type LogicalSort
- type PathFindingGoal
- type PhysicalLimit
- type PhysicalMatch
- type PhysicalPlan
- type PhysicalProjection
- type PhysicalSelection
- type PhysicalSort
- type Plan
- type ResultColumn
- type ResultColumns
- type Simple
- type Subgraph
- type SubgraphBuilder
- type VariableLengthPath
- func (b *VariableLengthPath) AnyDirected() bool
- func (b *VariableLengthPath) DstVarName() model.CIStr
- func (b *VariableLengthPath) Name() model.CIStr
- func (b *VariableLengthPath) SetAnyDirected(anyDirected bool)
- func (b *VariableLengthPath) SetDstVarName(name model.CIStr)
- func (b *VariableLengthPath) SetName(name model.CIStr)
- func (b *VariableLengthPath) SetSrcVarName(name model.CIStr)
- func (b *VariableLengthPath) SrcVarName() model.CIStr
- type Vertex
- type VertexPairConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RewriteExpr ¶
func RewriteExpr(expr ast.ExprNode, p LogicalPlan) (expression.Expression, error)
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is used to build the AST into a plan.
type ByItem ¶
type ByItem struct { Expr expression.Expression AsName model.CIStr Desc bool NullOrder bool }
ByItem wraps a "by" item.
type CommonPathExpression ¶
type CommonPathExpression struct { Leftmost *Vertex Rightmost *Vertex Vertices map[string]*Vertex Connections map[string]VertexPairConnection Constraints ast.ExprNode // contains filtered or unexported fields }
func (*CommonPathExpression) AnyDirected ¶
func (b *CommonPathExpression) AnyDirected() bool
func (*CommonPathExpression) DstVarName ¶
func (*CommonPathExpression) SetAnyDirected ¶
func (b *CommonPathExpression) SetAnyDirected(anyDirected bool)
func (*CommonPathExpression) SetDstVarName ¶
func (*CommonPathExpression) SetSrcVarName ¶
func (*CommonPathExpression) SrcVarName ¶
type DDL ¶
DDL represents the physical plan of DDL statement.
func (*DDL) Columns ¶
func (p *DDL) Columns() ResultColumns
Columns implements the Plan.Columns interface.
func (*DDL) SetColumns ¶
func (p *DDL) SetColumns(cols ResultColumns)
type Edge ¶
func (*Edge) AnyDirected ¶
func (b *Edge) AnyDirected() bool
func (*Edge) DstVarName ¶
func (*Edge) SetAnyDirected ¶
func (b *Edge) SetAnyDirected(anyDirected bool)
func (*Edge) SetDstVarName ¶
func (*Edge) SetSrcVarName ¶
func (*Edge) SrcVarName ¶
type ElementInsertion ¶
type ElementInsertion struct { Type ast.InsertionType // INSERT EDGE e BETWEEN x AND y FROM MATCH (x) , MATCH (y) WHERE id(x) = 1 AND id(y) = 2 // FromIDExpr and ToIDExpr are the expressions to get the ID of the source and destination vertex. FromIDExpr expression.Expression ToIDExpr expression.Expression Labels []*catalog.Label Assignments []*expression.Assignment }
ElementInsertion represents a graph insertion element.
type Insert ¶
type Insert struct { Graph *catalog.Graph Insertions []*ElementInsertion MatchPlan Plan // contains filtered or unexported fields }
Insert represents the plan of INSERT statement.
func (*Insert) Columns ¶
func (p *Insert) Columns() ResultColumns
Columns implements the Plan.Columns interface.
func (*Insert) ExplainID ¶
func (p *Insert) ExplainID() string
ExplainID implements the Plan interface.
func (*Insert) ExplainInfo ¶
func (*Insert) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*Insert) SetColumns ¶
func (p *Insert) SetColumns(cols ResultColumns)
type LogicalDual ¶
type LogicalDual struct {
// contains filtered or unexported fields
}
LogicalDual represents the plan which returns empty result set.
func (*LogicalDual) Children ¶
func (p *LogicalDual) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalDual) Columns ¶
func (p *LogicalDual) Columns() ResultColumns
func (*LogicalDual) SetChild ¶
func (p *LogicalDual) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalDual) SetChildren ¶
func (p *LogicalDual) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
type LogicalLimit ¶
type LogicalLimit struct { Offset expression.Expression Count expression.Expression // contains filtered or unexported fields }
func (*LogicalLimit) Children ¶
func (p *LogicalLimit) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalLimit) Columns ¶
func (p *LogicalLimit) Columns() ResultColumns
func (*LogicalLimit) SetChild ¶
func (p *LogicalLimit) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalLimit) SetChildren ¶
func (p *LogicalLimit) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
type LogicalMatch ¶
type LogicalMatch struct { Subgraph *Subgraph // contains filtered or unexported fields }
func (*LogicalMatch) Children ¶
func (p *LogicalMatch) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalMatch) Columns ¶
func (p *LogicalMatch) Columns() ResultColumns
func (*LogicalMatch) SetChild ¶
func (p *LogicalMatch) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalMatch) SetChildren ¶
func (p *LogicalMatch) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
type LogicalPlan ¶
type LogicalPlan interface { Plan // Children returns all the children. Children() []LogicalPlan // SetChildren sets the children for the plan. SetChildren(...LogicalPlan) // SetChild sets the ith child for the plan. SetChild(i int, child LogicalPlan) }
type LogicalProjection ¶
type LogicalProjection struct { Exprs []expression.Expression // contains filtered or unexported fields }
func (*LogicalProjection) Children ¶
func (p *LogicalProjection) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalProjection) Columns ¶
func (p *LogicalProjection) Columns() ResultColumns
func (*LogicalProjection) SetChild ¶
func (p *LogicalProjection) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalProjection) SetChildren ¶
func (p *LogicalProjection) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
type LogicalSelection ¶
type LogicalSelection struct { Condition expression.Expression // contains filtered or unexported fields }
func (*LogicalSelection) Children ¶
func (p *LogicalSelection) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalSelection) Columns ¶
func (p *LogicalSelection) Columns() ResultColumns
func (*LogicalSelection) SetChild ¶
func (p *LogicalSelection) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalSelection) SetChildren ¶
func (p *LogicalSelection) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
type LogicalSort ¶
type LogicalSort struct { ByItems []*ByItem // contains filtered or unexported fields }
func (*LogicalSort) Children ¶
func (p *LogicalSort) Children() []LogicalPlan
Children implements LogicalPlan Children interface.
func (*LogicalSort) Columns ¶
func (p *LogicalSort) Columns() ResultColumns
func (*LogicalSort) SetChild ¶
func (p *LogicalSort) SetChild(i int, child LogicalPlan)
SetChild implements LogicalPlan SetChild interface.
func (*LogicalSort) SetChildren ¶
func (p *LogicalSort) SetChildren(children ...LogicalPlan)
SetChildren implements LogicalPlan SetChildren interface.
type PathFindingGoal ¶
type PathFindingGoal int
const ( PathFindingAll PathFindingGoal = iota PathFindingReaches PathFindingShortest PathFindingCheapest )
type PhysicalLimit ¶
type PhysicalLimit struct { Offset expression.Expression Count expression.Expression // contains filtered or unexported fields }
func (*PhysicalLimit) Children ¶
func (p *PhysicalLimit) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalLimit) Columns ¶
func (p *PhysicalLimit) Columns() ResultColumns
func (*PhysicalLimit) SetChild ¶
func (p *PhysicalLimit) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalLimit) SetChildren ¶
func (p *PhysicalLimit) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
type PhysicalMatch ¶
type PhysicalMatch struct { Subgraph *Subgraph // contains filtered or unexported fields }
func (*PhysicalMatch) Children ¶
func (p *PhysicalMatch) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalMatch) Columns ¶
func (p *PhysicalMatch) Columns() ResultColumns
func (*PhysicalMatch) SetChild ¶
func (p *PhysicalMatch) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalMatch) SetChildren ¶
func (p *PhysicalMatch) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
type PhysicalPlan ¶
type PhysicalPlan interface { Plan // Children returns all the children. Children() []PhysicalPlan // SetChildren sets the children for the plan. SetChildren(...PhysicalPlan) // SetChild sets the ith child for the plan. SetChild(i int, child PhysicalPlan) }
type PhysicalProjection ¶
type PhysicalProjection struct { Exprs []expression.Expression // contains filtered or unexported fields }
func (*PhysicalProjection) Children ¶
func (p *PhysicalProjection) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalProjection) Columns ¶
func (p *PhysicalProjection) Columns() ResultColumns
func (*PhysicalProjection) SetChild ¶
func (p *PhysicalProjection) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalProjection) SetChildren ¶
func (p *PhysicalProjection) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
type PhysicalSelection ¶
type PhysicalSelection struct { Condition expression.Expression // contains filtered or unexported fields }
func (*PhysicalSelection) Children ¶
func (p *PhysicalSelection) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalSelection) Columns ¶
func (p *PhysicalSelection) Columns() ResultColumns
func (*PhysicalSelection) SetChild ¶
func (p *PhysicalSelection) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalSelection) SetChildren ¶
func (p *PhysicalSelection) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
type PhysicalSort ¶
type PhysicalSort struct { ByItems []*ByItem // contains filtered or unexported fields }
func (*PhysicalSort) Children ¶
func (p *PhysicalSort) Children() []PhysicalPlan
Children implements PhysicalPlan Children interface.
func (*PhysicalSort) Columns ¶
func (p *PhysicalSort) Columns() ResultColumns
func (*PhysicalSort) SetChild ¶
func (p *PhysicalSort) SetChild(i int, child PhysicalPlan)
SetChild implements PhysicalPlan SetChild interface.
func (*PhysicalSort) SetChildren ¶
func (p *PhysicalSort) SetChildren(children ...PhysicalPlan)
SetChildren implements PhysicalPlan SetChildren interface.
type Plan ¶
type Plan interface { // ID gets the ID. ID() int // TP gets the plan type. TP() string // Columns gets the result columns. Columns() ResultColumns // SetColumns sets the result columns SetColumns(cols ResultColumns) // ExplainID gets the ID in explain statement ExplainID() string // ExplainInfo returns operator information to be explained. ExplainInfo() string }
func Optimize ¶
func Optimize(plan LogicalPlan) Plan
Optimize optimizes the plan to the optimal physical plan.
type ResultColumns ¶
type ResultColumns []ResultColumn
func ResultColumnsFromSubgraph ¶
func ResultColumnsFromSubgraph(sg *Subgraph) ResultColumns
func (ResultColumns) FindColumnIndex ¶
func (r ResultColumns) FindColumnIndex(name model.CIStr) int
type Simple ¶
Simple represents the physical plan of simple statements.
func (*Simple) Columns ¶
func (p *Simple) Columns() ResultColumns
Columns implements the Plan.Columns interface.
func (*Simple) ExplainID ¶
func (p *Simple) ExplainID() string
ExplainID implements the Plan interface.
func (*Simple) ExplainInfo ¶
func (*Simple) ExplainInfo() string
ExplainInfo implements Plan interface.
func (*Simple) SetColumns ¶
func (p *Simple) SetColumns(cols ResultColumns)
type SubgraphBuilder ¶
type SubgraphBuilder struct {
// contains filtered or unexported fields
}
func NewSubgraphBuilder ¶
func NewSubgraphBuilder(graph *catalog.Graph) *SubgraphBuilder
func (*SubgraphBuilder) AddPathPatternMacros ¶
func (s *SubgraphBuilder) AddPathPatternMacros(macros ...*ast.PathPatternMacro) *SubgraphBuilder
func (*SubgraphBuilder) AddPathPatterns ¶
func (s *SubgraphBuilder) AddPathPatterns(paths ...*ast.PathPattern) *SubgraphBuilder
func (*SubgraphBuilder) Build ¶
func (s *SubgraphBuilder) Build() (*Subgraph, error)
type VariableLengthPath ¶
type VariableLengthPath struct { Conn VertexPairConnection Goal PathFindingGoal MinHops int64 MaxHops int64 TopK int64 WithTies bool Constraints ast.ExprNode Cost ast.ExprNode HopSrc *Vertex HopDst *Vertex // contains filtered or unexported fields }
func (*VariableLengthPath) AnyDirected ¶
func (b *VariableLengthPath) AnyDirected() bool
func (*VariableLengthPath) DstVarName ¶
func (*VariableLengthPath) SetAnyDirected ¶
func (b *VariableLengthPath) SetAnyDirected(anyDirected bool)
func (*VariableLengthPath) SetDstVarName ¶
func (*VariableLengthPath) SetSrcVarName ¶
func (*VariableLengthPath) SrcVarName ¶
type VertexPairConnection ¶
type VertexPairConnection interface { Name() model.CIStr AnyDirected() bool SetAnyDirected(anyDirected bool) SrcVarName() model.CIStr SetSrcVarName(name model.CIStr) DstVarName() model.CIStr SetDstVarName(name model.CIStr) }
VertexPairConnection represents a connection between two vertices.