planner

package
v0.22.19 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExprWalk

func ExprWalk(v ExprVisitor, expr types.PlanExpression)

func ExprWithPlanOpWalk

func ExprWithPlanOpWalk(v PlanOpExprVisitor, op types.PlanOperator, expr types.PlanExpression)

ExprWithPlanOpWalk traverses the expression tree in depth-first order. It starts by calling v.VisitPlanOpExpr(op, expr); expr must not be nil. If the visitor returned by v.VisitPlanOpExpr(op, expr) is not nil, Walk is invoked recursively with the returned visitor for each children of the expr, followed by a call of v.VisitPlanOpExpr(nil, nil) to the returned visitor.

func ExpressionToColumn

func ExpressionToColumn(e types.PlanExpression) *types.PlannerColumn

func InspectExpression

func InspectExpression(expr types.PlanExpression, f func(expr types.PlanExpression) bool)

InspectExpression traverses expressions in depth-first order

func InspectExpressionsWithPlanOp

func InspectExpressionsWithPlanOp(op types.PlanOperator, f exprWithNodeInspector)

InspectExpressionsWithPlanOp traverses the plan and calls f on any expression it finds.

func InspectOperatorExpressions

func InspectOperatorExpressions(op types.PlanOperator, f exprInspector)

InspectOperatorExpressions traverses the plan and calls WalkExpressions on any expression it finds.

func InspectPlan

func InspectPlan(op types.PlanOperator, f planInspectionFunction)

InspectPlan traverses the plan op graph depth-first order if f(op) returns true, InspectPlan invokes f recursively for each of the children of op, followed by a call of f(nil).

func NewAggAvgBuffer

func NewAggAvgBuffer(child types.PlanExpression) *aggregateAvg

func NewAggCorrBuffer

func NewAggCorrBuffer(child *corrPlanExpression) *aggregateCorr

func NewAggCountBuffer

func NewAggCountBuffer(child types.PlanExpression) *aggregateCount

func NewAggCountDistinctBuffer

func NewAggCountDistinctBuffer(child types.PlanExpression) *aggregateCountDistinct

func NewAggLastBuffer

func NewAggLastBuffer(child types.PlanExpression) *aggregateLast

func NewAggMaxBuffer

func NewAggMaxBuffer(child types.PlanExpression) *aggregateMax

func NewAggMinBuffer

func NewAggMinBuffer(child types.PlanExpression) *aggregateMin

func NewAggSumBuffer

func NewAggSumBuffer(child types.PlanExpression) *aggregateSum

func NewAggVarBuffer

func NewAggVarBuffer(child *varPlanExpression) *aggregateVar

func NewFirstBuffer

func NewFirstBuffer(child types.PlanExpression) *aggregateFirst

func PlanWalk

func PlanWalk(v PlanVisitor, op types.PlanOperator)

PlanWalk traverses the plan depth-first. It starts by calling v.VisitOperator; node must not be nil. If the result returned by v.VisitOperator is not nil, PlanWalk is invoked recursively with the returned result for each of the children of the plan operator, followed by a call of v.VisitOperator(nil) to the returned result. If v.VisitOperator(op) returns non-nil, then all children are walked, even if one of them returns nil.

func ProjectRow

func ProjectRow(ctx context.Context, projections []types.PlanExpression, row types.Row) (types.Row, error)

ProjectRow evaluates a set of projections.

func TransformExpr

func TransformExpr(expr types.PlanExpression, transformFunction ExprFunc, selector ExprSelectorFunc) (types.PlanExpression, bool, error)

TransformExpr applies a depth first transformation function to an expression

func TransformPlanOp

TransformPlanOp applies a depth first transformation function to the given plan op It returns a tuple that is the result of the transformation; the new PlanOperator, a bool that is true if the resultant PlanOperator has not been transformed or an error. If the TransformPlanOp has children it will iterate the children and call the transformation function on each of them in turn. If those operators are transformed, it will create a new operator with those children. The last step is to call the transformation on the passed PlanOperator

func TransformPlanOpWithParent

func TransformPlanOpWithParent(op types.PlanOperator, s ParentSelectorFunc, f ParentContextFunc) (types.PlanOperator, bool, error)

TransformPlanOpWithParent applies a transformation function to a plan operator in the context that plan operators parent

func TransformSinglePlanOpExpressions

func TransformSinglePlanOpExpressions(op types.PlanOperator, f ExprFunc, selector ExprSelectorFunc) (types.PlanOperator, bool, error)

TransformSinglePlanOpExpressions applies a transformation function to all expressions on the given plan operator

func WalkExpressionsWithPlanOp

func WalkExpressionsWithPlanOp(v PlanOpExprVisitor, op types.PlanOperator)

WalkExpressionsWithPlanOp traverses the plan and calls ExprWithPlanOpWalk on any expression it finds.

Types

type ExecutionPlanner

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

ExecutionPlanner compiles SQL text into a query plan

func NewExecutionPlanner

func NewExecutionPlanner(executor api.Executor, schemaAPI api.Schema, systemLayerAPI api.SystemLayerAPI, logger *slog.Logger, sql string) *ExecutionPlanner

func (*ExecutionPlanner) CompilePlan

func (p *ExecutionPlanner) CompilePlan(ctx context.Context, stmt parser.Statement) (types.PlanOperator, error)

CompilePlan takes an AST (parser.Statement) and compiles into a query plan returning the root PlanOperator The act of compiling includes an analysis step that does semantic analysis of the AST, this includes type checking, and sometimes AST rewriting. The compile phase uses the type-checked and rewritten AST to produce a query plan.

type ExprFunc

type ExprFunc func(expr types.PlanExpression) (types.PlanExpression, bool, error)

ExprFunc is a function that given an expression will return that expression as is or transformed, or bool to indicate whether the expression was modified, and an error or nil.

type ExprSelectorFunc

type ExprSelectorFunc func(parentExpr, childExpr types.PlanExpression) bool

ExprSelectorFunc is a function that can be used as a filter selector during expression transformation - it is called before calling a transformation function on a child expression; if it returns false, the child is skipped

type ExprVisitor

type ExprVisitor interface {
	// VisitExpr method is invoked for each expr encountered by ExprWalk.
	// If the result is not nil, ExprWalk visits each of the children
	// of the expr, followed by a call of VisitExpr(nil) to the returned result.
	VisitExpr(expr types.PlanExpression) ExprVisitor
}

ExprVisitor visits expressions in an expression tree.

type ExprWithPlanOpFunc

type ExprWithPlanOpFunc func(op types.PlanOperator, expr types.PlanExpression) (types.PlanExpression, bool, error)

ExprWithPlanOpFunc is a function that given an expression and the node that contains it, will return that expression as is or transformed along with an error, if any.

type OptimizerFunc

OptimizerFunc is a function prototype for all optimizer rules.

type OptimizerScope

type OptimizerScope struct {
}

OptimizerScope will be used in future for symbol resolution when CTEs and subquery support matures and we need to introduce the concept of scope to symbol resolution.

type OrderByExpression

type OrderByExpression struct {
	Expr         types.PlanExpression
	Order        orderByOrder
	NullOrdering nullOrdering
}

OrderByExpression is the expression on which an order by can be computed

type OrderBySorter

type OrderBySorter struct {
	SortFields []*OrderByExpression
	Rows       []types.Row
	LastError  error
	Ctx        context.Context
}

func (*OrderBySorter) Len

func (s *OrderBySorter) Len() int

func (*OrderBySorter) Less

func (s *OrderBySorter) Less(i, j int) bool

func (*OrderBySorter) Swap

func (s *OrderBySorter) Swap(i, j int)

type ParentContext

type ParentContext struct {
	Operator   types.PlanOperator
	Parent     types.PlanOperator
	ChildCount int
}

ParentContext is a struct that enables transformation functions to include a parent operator

type ParentContextFunc

type ParentContextFunc func(c ParentContext) (types.PlanOperator, bool, error)

type ParentSelectorFunc

type ParentSelectorFunc func(c ParentContext) bool

type PlanOpDistinct

type PlanOpDistinct struct {
	ChildOp types.PlanOperator
	// contains filtered or unexported fields
}

PlanOpDistinct plan operator handles DISTINCT DISTINCT returns unique rows from its iterator and does this by creating a hash table and probing new rows against that hash table, if the row has already been seen, it is skipped, it it has not been seen, a 'key' is created from all the values in the row and this is inserted into the hash table. The hash table is implemented using Extendible Hashing and is backed by a buffer pool. The buffer pool is allocated to 128 pages (or 1Mb) and the disk manager used by the buffer pool will use an in-memory implementation up to 128 pages and thereafter spill to disk

func NewPlanOpDistinct

func NewPlanOpDistinct(p *ExecutionPlanner, child types.PlanOperator) *PlanOpDistinct

func (*PlanOpDistinct) AddWarning

func (p *PlanOpDistinct) AddWarning(warning string)

func (*PlanOpDistinct) Children

func (p *PlanOpDistinct) Children() []types.PlanOperator

func (*PlanOpDistinct) Iterator

func (p *PlanOpDistinct) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpDistinct) Plan

func (p *PlanOpDistinct) Plan() map[string]interface{}

func (*PlanOpDistinct) Schema

func (p *PlanOpDistinct) Schema() types.Schema

func (*PlanOpDistinct) String

func (p *PlanOpDistinct) String() string

func (*PlanOpDistinct) Warnings

func (p *PlanOpDistinct) Warnings() []string

func (*PlanOpDistinct) WithChildren

func (p *PlanOpDistinct) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpExprVisitor

type PlanOpExprVisitor interface {
	// VisitPlanOpExpr method is invoked for each expr encountered by Walk. If the result Visitor is not nil, Walk visits each of
	// the children of the expr with that visitor, followed by a call of VisitPlanOpExpr(nil, nil) to the returned visitor.
	VisitPlanOpExpr(op types.PlanOperator, expression types.PlanExpression) PlanOpExprVisitor
}

PlanOpExprVisitor visits expressions in an expression tree. Like ExprVisitor, but with the added context of the plan op in which an expression is embedded.

type PlanOpFanout

type PlanOpFanout struct {
	ChildOp types.PlanOperator
	// contains filtered or unexported fields
}

PlanOpFanout is a query fanout operator that will execute an operator across all cluster nodes

func NewPlanOpFanout

func NewPlanOpFanout(planner *ExecutionPlanner, child types.PlanOperator) *PlanOpFanout

func (*PlanOpFanout) AddWarning

func (p *PlanOpFanout) AddWarning(warning string)

func (*PlanOpFanout) Children

func (p *PlanOpFanout) Children() []types.PlanOperator

func (*PlanOpFanout) Expressions

func (p *PlanOpFanout) Expressions() []types.PlanExpression

func (*PlanOpFanout) Iterator

func (p *PlanOpFanout) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpFanout) Plan

func (p *PlanOpFanout) Plan() map[string]interface{}

func (*PlanOpFanout) Schema

func (p *PlanOpFanout) Schema() types.Schema

func (*PlanOpFanout) String

func (p *PlanOpFanout) String() string

func (*PlanOpFanout) Warnings

func (p *PlanOpFanout) Warnings() []string

func (*PlanOpFanout) WithChildren

func (p *PlanOpFanout) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

func (*PlanOpFanout) WithUpdatedExpressions

func (p *PlanOpFanout) WithUpdatedExpressions(exprs ...types.PlanExpression) (types.PlanOperator, error)

type PlanOpFilter

type PlanOpFilter struct {
	ChildOp   types.PlanOperator
	Predicate types.PlanExpression
	// contains filtered or unexported fields
}

PlanOpFilter is a filter operator

func NewPlanOpFilter

func NewPlanOpFilter(planner *ExecutionPlanner, predicate types.PlanExpression, child types.PlanOperator) *PlanOpFilter

func (*PlanOpFilter) AddWarning

func (p *PlanOpFilter) AddWarning(warning string)

func (*PlanOpFilter) Children

func (p *PlanOpFilter) Children() []types.PlanOperator

func (*PlanOpFilter) Expressions

func (p *PlanOpFilter) Expressions() []types.PlanExpression

func (*PlanOpFilter) Iterator

func (p *PlanOpFilter) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpFilter) Plan

func (p *PlanOpFilter) Plan() map[string]interface{}

func (*PlanOpFilter) Schema

func (p *PlanOpFilter) Schema() types.Schema

func (*PlanOpFilter) String

func (p *PlanOpFilter) String() string

func (*PlanOpFilter) Warnings

func (p *PlanOpFilter) Warnings() []string

func (*PlanOpFilter) WithChildren

func (p *PlanOpFilter) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

func (*PlanOpFilter) WithUpdatedExpressions

func (p *PlanOpFilter) WithUpdatedExpressions(exprs ...types.PlanExpression) (types.PlanOperator, error)

type PlanOpGroupBy

type PlanOpGroupBy struct {
	ChildOp      types.PlanOperator
	Aggregates   []types.PlanExpression
	GroupByExprs []types.PlanExpression
	// contains filtered or unexported fields
}

PlanOpGroupBy handles the GROUP BY clause this is the default GROUP BY operator and may be replaced by the optimizer with one or more of the PQL related group by or aggregate operators

func NewPlanOpGroupBy

func NewPlanOpGroupBy(aggregates []types.PlanExpression, groupByExprs []types.PlanExpression, child types.PlanOperator) *PlanOpGroupBy

func (*PlanOpGroupBy) AddWarning

func (p *PlanOpGroupBy) AddWarning(warning string)

func (*PlanOpGroupBy) Children

func (p *PlanOpGroupBy) Children() []types.PlanOperator

func (*PlanOpGroupBy) Expressions

func (p *PlanOpGroupBy) Expressions() []types.PlanExpression

func (*PlanOpGroupBy) Iterator

func (p *PlanOpGroupBy) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpGroupBy) Plan

func (p *PlanOpGroupBy) Plan() map[string]interface{}

func (*PlanOpGroupBy) Schema

func (p *PlanOpGroupBy) Schema() types.Schema

Schema for GroupBy is the group by expressions followed by the aggregate expressions

func (*PlanOpGroupBy) String

func (p *PlanOpGroupBy) String() string

func (*PlanOpGroupBy) Warnings

func (p *PlanOpGroupBy) Warnings() []string

func (*PlanOpGroupBy) WithChildren

func (p *PlanOpGroupBy) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

func (*PlanOpGroupBy) WithUpdatedExpressions

func (p *PlanOpGroupBy) WithUpdatedExpressions(exprs ...types.PlanExpression) (types.PlanOperator, error)

type PlanOpHaving

type PlanOpHaving struct {
	ChildOp   types.PlanOperator
	Predicate types.PlanExpression
	// contains filtered or unexported fields
}

PlanOpHaving is a filter operator for the HAVING clause

func NewPlanOpHaving

func NewPlanOpHaving(planner *ExecutionPlanner, predicate types.PlanExpression, child types.PlanOperator) *PlanOpHaving

func (*PlanOpHaving) AddWarning

func (p *PlanOpHaving) AddWarning(warning string)

func (*PlanOpHaving) Children

func (p *PlanOpHaving) Children() []types.PlanOperator

func (*PlanOpHaving) Expressions

func (p *PlanOpHaving) Expressions() []types.PlanExpression

func (*PlanOpHaving) Iterator

func (p *PlanOpHaving) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpHaving) Plan

func (p *PlanOpHaving) Plan() map[string]interface{}

func (*PlanOpHaving) Schema

func (p *PlanOpHaving) Schema() types.Schema

func (*PlanOpHaving) String

func (p *PlanOpHaving) String() string

func (*PlanOpHaving) Warnings

func (p *PlanOpHaving) Warnings() []string

func (*PlanOpHaving) WithChildren

func (p *PlanOpHaving) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

func (*PlanOpHaving) WithUpdatedExpressions

func (p *PlanOpHaving) WithUpdatedExpressions(exprs ...types.PlanExpression) (types.PlanOperator, error)

type PlanOpNestedLoops

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

PlanOpNestedLoops plan operator handles a join For each row in the top input, scan the bottom input and output matching rows

func NewPlanOpNestedLoops

func NewPlanOpNestedLoops(top, bottom types.PlanOperator, jType joinType, condition types.PlanExpression) *PlanOpNestedLoops

func (*PlanOpNestedLoops) AddWarning

func (p *PlanOpNestedLoops) AddWarning(warning string)

func (*PlanOpNestedLoops) Children

func (p *PlanOpNestedLoops) Children() []types.PlanOperator

func (*PlanOpNestedLoops) Expressions

func (p *PlanOpNestedLoops) Expressions() []types.PlanExpression

func (*PlanOpNestedLoops) Iterator

func (p *PlanOpNestedLoops) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpNestedLoops) Plan

func (p *PlanOpNestedLoops) Plan() map[string]interface{}

func (*PlanOpNestedLoops) Schema

func (p *PlanOpNestedLoops) Schema() types.Schema

func (*PlanOpNestedLoops) String

func (p *PlanOpNestedLoops) String() string

func (*PlanOpNestedLoops) Warnings

func (p *PlanOpNestedLoops) Warnings() []string

func (*PlanOpNestedLoops) WithChildren

func (p *PlanOpNestedLoops) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

func (*PlanOpNestedLoops) WithUpdatedExpressions

func (p *PlanOpNestedLoops) WithUpdatedExpressions(exprs ...types.PlanExpression) (types.PlanOperator, error)

type PlanOpNullTable

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

PlanOpNullTable is an operator for a null table basically when you do select 1, you're using the null table

func NewPlanOpNullTable

func NewPlanOpNullTable() *PlanOpNullTable

func (*PlanOpNullTable) AddWarning

func (p *PlanOpNullTable) AddWarning(warning string)

func (*PlanOpNullTable) Children

func (p *PlanOpNullTable) Children() []types.PlanOperator

func (*PlanOpNullTable) Iterator

func (p *PlanOpNullTable) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpNullTable) Plan

func (p *PlanOpNullTable) Plan() map[string]interface{}

func (*PlanOpNullTable) Schema

func (p *PlanOpNullTable) Schema() types.Schema

func (*PlanOpNullTable) String

func (p *PlanOpNullTable) String() string

func (*PlanOpNullTable) Warnings

func (p *PlanOpNullTable) Warnings() []string

func (*PlanOpNullTable) WithChildren

func (p *PlanOpNullTable) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpOrderBy

type PlanOpOrderBy struct {
	ChildOp types.PlanOperator
	// contains filtered or unexported fields
}

PlanOpOrderBy plan operator handles ORDER BY

func NewPlanOpOrderBy

func NewPlanOpOrderBy(orderByFields []*OrderByExpression, child types.PlanOperator) *PlanOpOrderBy

func (*PlanOpOrderBy) AddWarning

func (n *PlanOpOrderBy) AddWarning(warning string)

func (*PlanOpOrderBy) Children

func (n *PlanOpOrderBy) Children() []types.PlanOperator

func (*PlanOpOrderBy) Expressions

func (n *PlanOpOrderBy) Expressions() []types.PlanExpression

func (*PlanOpOrderBy) Iterator

func (n *PlanOpOrderBy) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpOrderBy) Plan

func (n *PlanOpOrderBy) Plan() map[string]interface{}

func (*PlanOpOrderBy) Schema

func (n *PlanOpOrderBy) Schema() types.Schema

func (*PlanOpOrderBy) String

func (n *PlanOpOrderBy) String() string

func (*PlanOpOrderBy) Warnings

func (n *PlanOpOrderBy) Warnings() []string

func (*PlanOpOrderBy) WithChildren

func (n *PlanOpOrderBy) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

func (*PlanOpOrderBy) WithUpdatedExpressions

func (n *PlanOpOrderBy) WithUpdatedExpressions(exprs ...types.PlanExpression) (types.PlanOperator, error)

type PlanOpPQLAggregate

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

PlanOpPQLAggregate plan operator handles a single pql aggregate

func NewPlanOpPQLAggregate

func NewPlanOpPQLAggregate(p *ExecutionPlanner, tableName string, aggregate types.Aggregable, filter types.PlanExpression) *PlanOpPQLAggregate

func (*PlanOpPQLAggregate) AddWarning

func (p *PlanOpPQLAggregate) AddWarning(warning string)

func (*PlanOpPQLAggregate) Children

func (p *PlanOpPQLAggregate) Children() []types.PlanOperator

func (*PlanOpPQLAggregate) Iterator

func (p *PlanOpPQLAggregate) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpPQLAggregate) Plan

func (p *PlanOpPQLAggregate) Plan() map[string]interface{}

func (*PlanOpPQLAggregate) Schema

func (p *PlanOpPQLAggregate) Schema() types.Schema

func (*PlanOpPQLAggregate) String

func (p *PlanOpPQLAggregate) String() string

func (*PlanOpPQLAggregate) Warnings

func (p *PlanOpPQLAggregate) Warnings() []string

func (*PlanOpPQLAggregate) WithChildren

func (p *PlanOpPQLAggregate) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpPQLDistinctScan

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

PlanOpPQLDistinctScan plan operator handles a PQL distinct scan i.e. a scan with only one column that is used in a distinct query

func NewPlanOpPQLDistinctScan

func NewPlanOpPQLDistinctScan(p *ExecutionPlanner, tableName string, column string) (*PlanOpPQLDistinctScan, error)

func (*PlanOpPQLDistinctScan) AddWarning

func (p *PlanOpPQLDistinctScan) AddWarning(warning string)

func (*PlanOpPQLDistinctScan) Children

func (p *PlanOpPQLDistinctScan) Children() []types.PlanOperator

func (*PlanOpPQLDistinctScan) IsFilterable

func (p *PlanOpPQLDistinctScan) IsFilterable() bool

func (*PlanOpPQLDistinctScan) Iterator

func (*PlanOpPQLDistinctScan) Name

func (p *PlanOpPQLDistinctScan) Name() string

func (*PlanOpPQLDistinctScan) Plan

func (p *PlanOpPQLDistinctScan) Plan() map[string]interface{}

func (*PlanOpPQLDistinctScan) Schema

func (p *PlanOpPQLDistinctScan) Schema() types.Schema

func (*PlanOpPQLDistinctScan) String

func (p *PlanOpPQLDistinctScan) String() string

func (*PlanOpPQLDistinctScan) UpdateFilters

func (p *PlanOpPQLDistinctScan) UpdateFilters(filterCondition types.PlanExpression) (types.PlanOperator, error)

func (*PlanOpPQLDistinctScan) UpdateTimeQuantumFilters

func (p *PlanOpPQLDistinctScan) UpdateTimeQuantumFilters(filters ...types.PlanExpression) (types.PlanOperator, error)

func (*PlanOpPQLDistinctScan) Warnings

func (p *PlanOpPQLDistinctScan) Warnings() []string

func (*PlanOpPQLDistinctScan) WithChildren

func (p *PlanOpPQLDistinctScan) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpPQLGroupBy

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

PlanOpPQLGroupBy plan operator handles a PQL group by with a single aggregate

func NewPlanOpPQLGroupBy

func NewPlanOpPQLGroupBy(p *ExecutionPlanner, tableName string, groupByExprs []types.PlanExpression, filter types.PlanExpression, aggregate types.Aggregable) *PlanOpPQLGroupBy

func (*PlanOpPQLGroupBy) AddWarning

func (p *PlanOpPQLGroupBy) AddWarning(warning string)

func (*PlanOpPQLGroupBy) Children

func (p *PlanOpPQLGroupBy) Children() []types.PlanOperator

func (*PlanOpPQLGroupBy) Iterator

func (p *PlanOpPQLGroupBy) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpPQLGroupBy) Plan

func (p *PlanOpPQLGroupBy) Plan() map[string]interface{}

func (*PlanOpPQLGroupBy) Schema

func (p *PlanOpPQLGroupBy) Schema() types.Schema

func (*PlanOpPQLGroupBy) String

func (p *PlanOpPQLGroupBy) String() string

func (*PlanOpPQLGroupBy) Warnings

func (p *PlanOpPQLGroupBy) Warnings() []string

func (*PlanOpPQLGroupBy) WithChildren

func (p *PlanOpPQLGroupBy) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpPQLMultiAggregate

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

PlanOpPQLMultiAggregate plan operator handles executing multiple 'sibling' pql aggregate queries

func NewPlanOpPQLMultiAggregate

func NewPlanOpPQLMultiAggregate(p *ExecutionPlanner, operators []*PlanOpPQLAggregate) *PlanOpPQLMultiAggregate

func (*PlanOpPQLMultiAggregate) AddWarning

func (p *PlanOpPQLMultiAggregate) AddWarning(warning string)

func (*PlanOpPQLMultiAggregate) Children

func (p *PlanOpPQLMultiAggregate) Children() []types.PlanOperator

func (*PlanOpPQLMultiAggregate) Iterator

func (*PlanOpPQLMultiAggregate) Plan

func (p *PlanOpPQLMultiAggregate) Plan() map[string]interface{}

func (*PlanOpPQLMultiAggregate) Schema

func (p *PlanOpPQLMultiAggregate) Schema() types.Schema

func (*PlanOpPQLMultiAggregate) String

func (p *PlanOpPQLMultiAggregate) String() string

func (*PlanOpPQLMultiAggregate) Warnings

func (p *PlanOpPQLMultiAggregate) Warnings() []string

func (*PlanOpPQLMultiAggregate) WithChildren

func (p *PlanOpPQLMultiAggregate) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpPQLMultiGroupBy

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

PlanOpPQLMultiGroupBy plan operator handles executing multiple 'sibling' pql group by queries it will materialize the result sets from each of its operators and then merge them. Its iterator will return a row consisting of all the group by columns in the order specified followed by all aggregates in order

func NewPlanOpPQLMultiGroupBy

func NewPlanOpPQLMultiGroupBy(p *ExecutionPlanner, operators []*PlanOpPQLGroupBy, groupByExprs []types.PlanExpression) *PlanOpPQLMultiGroupBy

func (*PlanOpPQLMultiGroupBy) AddWarning

func (p *PlanOpPQLMultiGroupBy) AddWarning(warning string)

func (*PlanOpPQLMultiGroupBy) Children

func (p *PlanOpPQLMultiGroupBy) Children() []types.PlanOperator

func (*PlanOpPQLMultiGroupBy) Expressions

func (p *PlanOpPQLMultiGroupBy) Expressions() []types.PlanExpression

func (*PlanOpPQLMultiGroupBy) Iterator

func (*PlanOpPQLMultiGroupBy) Plan

func (p *PlanOpPQLMultiGroupBy) Plan() map[string]interface{}

func (*PlanOpPQLMultiGroupBy) Schema

func (p *PlanOpPQLMultiGroupBy) Schema() types.Schema

func (*PlanOpPQLMultiGroupBy) String

func (p *PlanOpPQLMultiGroupBy) String() string

func (*PlanOpPQLMultiGroupBy) Warnings

func (p *PlanOpPQLMultiGroupBy) Warnings() []string

func (*PlanOpPQLMultiGroupBy) WithChildren

func (p *PlanOpPQLMultiGroupBy) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

func (*PlanOpPQLMultiGroupBy) WithUpdatedExpressions

func (p *PlanOpPQLMultiGroupBy) WithUpdatedExpressions(exprs ...types.PlanExpression) (types.PlanOperator, error)

type PlanOpPQLTableScan

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

PlanOpPQLTableScan plan operator handles a PQL table scan

func NewPlanOpPQLTableScan

func NewPlanOpPQLTableScan(p *ExecutionPlanner, tableName string, columns []string, hints []*TableQueryHint) *PlanOpPQLTableScan

func (*PlanOpPQLTableScan) AddWarning

func (p *PlanOpPQLTableScan) AddWarning(warning string)

func (*PlanOpPQLTableScan) Children

func (p *PlanOpPQLTableScan) Children() []types.PlanOperator

func (*PlanOpPQLTableScan) IsFilterable

func (p *PlanOpPQLTableScan) IsFilterable() bool

func (*PlanOpPQLTableScan) Iterator

func (p *PlanOpPQLTableScan) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpPQLTableScan) Name

func (p *PlanOpPQLTableScan) Name() string

func (*PlanOpPQLTableScan) Plan

func (p *PlanOpPQLTableScan) Plan() map[string]interface{}

func (*PlanOpPQLTableScan) PrimaryKeyType

func (p *PlanOpPQLTableScan) PrimaryKeyType() (parser.ExprDataType, error)

func (*PlanOpPQLTableScan) Schema

func (p *PlanOpPQLTableScan) Schema() types.Schema

func (*PlanOpPQLTableScan) String

func (p *PlanOpPQLTableScan) String() string

func (*PlanOpPQLTableScan) UpdateFilters

func (p *PlanOpPQLTableScan) UpdateFilters(filterCondition types.PlanExpression) (types.PlanOperator, error)

func (*PlanOpPQLTableScan) UpdateTimeQuantumFilters

func (p *PlanOpPQLTableScan) UpdateTimeQuantumFilters(filters ...types.PlanExpression) (types.PlanOperator, error)

func (*PlanOpPQLTableScan) Warnings

func (p *PlanOpPQLTableScan) Warnings() []string

func (*PlanOpPQLTableScan) WithChildren

func (p *PlanOpPQLTableScan) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpProjection

type PlanOpProjection struct {
	ChildOp     types.PlanOperator
	Projections []types.PlanExpression
	// contains filtered or unexported fields
}

PlanOpProjection handles row projection and expression evaluation

func NewPlanOpProjection

func NewPlanOpProjection(expressions []types.PlanExpression, child types.PlanOperator) *PlanOpProjection

func (*PlanOpProjection) AddWarning

func (p *PlanOpProjection) AddWarning(warning string)

func (*PlanOpProjection) Children

func (p *PlanOpProjection) Children() []types.PlanOperator

func (*PlanOpProjection) Expressions

func (p *PlanOpProjection) Expressions() []types.PlanExpression

func (*PlanOpProjection) Iterator

func (p *PlanOpProjection) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpProjection) Plan

func (p *PlanOpProjection) Plan() map[string]interface{}

func (*PlanOpProjection) Schema

func (p *PlanOpProjection) Schema() types.Schema

func (*PlanOpProjection) String

func (p *PlanOpProjection) String() string

func (*PlanOpProjection) Warnings

func (p *PlanOpProjection) Warnings() []string

func (*PlanOpProjection) WithChildren

func (p *PlanOpProjection) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

func (*PlanOpProjection) WithUpdatedExpressions

func (p *PlanOpProjection) WithUpdatedExpressions(exprs ...types.PlanExpression) (types.PlanOperator, error)

type PlanOpQuery

type PlanOpQuery struct {
	ChildOp types.PlanOperator
	// contains filtered or unexported fields
}

PlanOpQuery is a query - this is the root node of an execution plan

func NewPlanOpQuery

func NewPlanOpQuery(p *ExecutionPlanner, child types.PlanOperator, sql string) *PlanOpQuery

func (*PlanOpQuery) AddWarning

func (p *PlanOpQuery) AddWarning(warning string)

func (*PlanOpQuery) Child

func (p *PlanOpQuery) Child() types.PlanOperator

func (*PlanOpQuery) Children

func (p *PlanOpQuery) Children() []types.PlanOperator

func (*PlanOpQuery) Iterator

func (p *PlanOpQuery) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpQuery) Plan

func (p *PlanOpQuery) Plan() map[string]interface{}

func (*PlanOpQuery) Schema

func (p *PlanOpQuery) Schema() types.Schema

func (*PlanOpQuery) String

func (p *PlanOpQuery) String() string

func (*PlanOpQuery) Warnings

func (p *PlanOpQuery) Warnings() []string

func (*PlanOpQuery) WithChildren

func (p *PlanOpQuery) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpRelAlias

type PlanOpRelAlias struct {
	ChildOp types.PlanOperator
	// contains filtered or unexported fields
}

PlanOpRelAlias implements an alias for a relation

func NewPlanOpRelAlias

func NewPlanOpRelAlias(alias string, child types.PlanOperator) *PlanOpRelAlias

func (*PlanOpRelAlias) AddWarning

func (p *PlanOpRelAlias) AddWarning(warning string)

func (*PlanOpRelAlias) Children

func (p *PlanOpRelAlias) Children() []types.PlanOperator

func (*PlanOpRelAlias) IsFilterable

func (p *PlanOpRelAlias) IsFilterable() bool

func (*PlanOpRelAlias) Iterator

func (p *PlanOpRelAlias) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpRelAlias) Name

func (p *PlanOpRelAlias) Name() string

func (*PlanOpRelAlias) Plan

func (p *PlanOpRelAlias) Plan() map[string]interface{}

func (*PlanOpRelAlias) Schema

func (p *PlanOpRelAlias) Schema() types.Schema

func (*PlanOpRelAlias) String

func (p *PlanOpRelAlias) String() string

func (*PlanOpRelAlias) UpdateFilters

func (p *PlanOpRelAlias) UpdateFilters(filterCondition types.PlanExpression) (types.PlanOperator, error)

func (*PlanOpRelAlias) UpdateTimeQuantumFilters

func (p *PlanOpRelAlias) UpdateTimeQuantumFilters(filters ...types.PlanExpression) (types.PlanOperator, error)

func (*PlanOpRelAlias) Warnings

func (p *PlanOpRelAlias) Warnings() []string

func (*PlanOpRelAlias) WithChildren

func (p *PlanOpRelAlias) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpSubquery

type PlanOpSubquery struct {
	ChildOp types.PlanOperator
	// contains filtered or unexported fields
}

PlanOpSubquery is an operator for a subquery

func NewPlanOpSubquery

func NewPlanOpSubquery(child types.PlanOperator) *PlanOpSubquery

func (*PlanOpSubquery) AddWarning

func (p *PlanOpSubquery) AddWarning(warning string)

func (*PlanOpSubquery) Children

func (p *PlanOpSubquery) Children() []types.PlanOperator

func (*PlanOpSubquery) Iterator

func (p *PlanOpSubquery) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpSubquery) Name

func (p *PlanOpSubquery) Name() string

func (*PlanOpSubquery) Plan

func (p *PlanOpSubquery) Plan() map[string]interface{}

func (*PlanOpSubquery) Schema

func (p *PlanOpSubquery) Schema() types.Schema

func (*PlanOpSubquery) String

func (p *PlanOpSubquery) String() string

func (*PlanOpSubquery) Warnings

func (p *PlanOpSubquery) Warnings() []string

func (*PlanOpSubquery) WithChildren

func (p *PlanOpSubquery) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpTableValuedFunction

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

PlanOpTableValuedFunction is an operator for a subquery

func NewPlanOpTableValuedFunction

func NewPlanOpTableValuedFunction(p *ExecutionPlanner, callExpr types.PlanExpression) *PlanOpTableValuedFunction

func (*PlanOpTableValuedFunction) AddWarning

func (p *PlanOpTableValuedFunction) AddWarning(warning string)

func (*PlanOpTableValuedFunction) Children

func (*PlanOpTableValuedFunction) Iterator

func (*PlanOpTableValuedFunction) Name

func (*PlanOpTableValuedFunction) Plan

func (p *PlanOpTableValuedFunction) Plan() map[string]interface{}

func (*PlanOpTableValuedFunction) Schema

func (*PlanOpTableValuedFunction) String

func (p *PlanOpTableValuedFunction) String() string

func (*PlanOpTableValuedFunction) Warnings

func (p *PlanOpTableValuedFunction) Warnings() []string

func (*PlanOpTableValuedFunction) WithChildren

func (p *PlanOpTableValuedFunction) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpTop

type PlanOpTop struct {
	ChildOp types.PlanOperator
	// contains filtered or unexported fields
}

PlanOpTop implements the TOP operator

func NewPlanOpTop

func NewPlanOpTop(expr types.PlanExpression, child types.PlanOperator) *PlanOpTop

func (*PlanOpTop) AddWarning

func (p *PlanOpTop) AddWarning(warning string)

func (*PlanOpTop) Children

func (p *PlanOpTop) Children() []types.PlanOperator

func (*PlanOpTop) Iterator

func (p *PlanOpTop) Iterator(ctx context.Context, row types.Row) (types.RowIterator, error)

func (*PlanOpTop) Plan

func (p *PlanOpTop) Plan() map[string]interface{}

func (*PlanOpTop) Schema

func (p *PlanOpTop) Schema() types.Schema

func (*PlanOpTop) String

func (p *PlanOpTop) String() string

func (*PlanOpTop) Warnings

func (p *PlanOpTop) Warnings() []string

func (*PlanOpTop) WithChildren

func (p *PlanOpTop) WithChildren(children ...types.PlanOperator) (types.PlanOperator, error)

type PlanOpTransformFunc

type PlanOpTransformFunc func(op types.PlanOperator) (types.PlanOperator, bool, error)

PlanOpTransformFunc is a function that given a plan op will return either a transformed plan op or the original plan op. If there was a transformation, the bool will be true, and an error if there was an error

type PlanVisitor

type PlanVisitor interface {
	// VisitOperator method is invoked for each node during PlanWalk. If the
	// resulting PlanVisitor is not nil, PlanWalk visits each of the children of
	// the node with that visitor, followed by a call of VisitOperator(nil) to
	// the returned visitor.
	VisitOperator(op types.PlanOperator) PlanVisitor
}

PlanVisitor visits nodes in the plan.

type RelationAliasesMap

type RelationAliasesMap map[string]types.IdentifiableByName

RelationAliasesMap is a map of aliases to Relations

type TableQueryHint

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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