Documentation
¶
Index ¶
- Variables
- func NewNopCompilePlanner() *nopCompilePlanner
- type Aggregable
- type AggregationBuffer
- type CompilePlanner
- type ContainsExpressions
- type FilteredRelation
- type IdentifiableByName
- type PlanExpression
- type PlanOperator
- type PlannerColumn
- type Relation
- type Row
- type RowIterable
- type RowIterator
- type Rows
- type Schema
Constants ¶
This section is empty.
Variables ¶
var ErrNoMoreRows = errors.New("ErrNoMoreRows")
ErrNoMoreRows is a 'special' error returned to signify no more rows
Functions ¶
func NewNopCompilePlanner ¶
func NewNopCompilePlanner() *nopCompilePlanner
Types ¶
type Aggregable ¶
type Aggregable interface {
fmt.Stringer
// creates a new aggregation buffer for this aggregate
NewBuffer() (AggregationBuffer, error)
// convenience to get the first argument of the aggregate
FirstChildExpr() PlanExpression
// returns all the child expressions for this aggregate
Children() []PlanExpression
// returns the type of the aggregate
Type() parser.ExprDataType
}
Aggregable is an interface for an expression that is a an aggregate.
type AggregationBuffer ¶
type AggregationBuffer interface {
Eval(ctx context.Context) (interface{}, error)
Update(ctx context.Context, row Row) error
}
AggregationBuffer is an interface to something that maintains an aggregate during query execution.
type CompilePlanner ¶
type ContainsExpressions ¶
type ContainsExpressions interface {
// returns the list of expressions contained by the plan operator
Expressions() []PlanExpression
// WithUpdatedExpressions returns a the operator with expressions updated
WithUpdatedExpressions(exprs ...PlanExpression) (PlanOperator, error)
}
ContainsExpressions exposes expressions in plan operators
type FilteredRelation ¶
type FilteredRelation interface {
Relation
IsFilterable() bool
UpdateFilters(filterCondition PlanExpression) (PlanOperator, error)
UpdateTimeQuantumFilters(filters ...PlanExpression) (PlanOperator, error)
}
FilteredRelation is an interface to something that can be treated as a relation that can be filtered
type IdentifiableByName ¶
type IdentifiableByName interface {
Name() string
}
IdentifiableByName is an interface for something that can be identified by a name.
type PlanExpression ¶
type PlanExpression interface {
fmt.Stringer
// evaluates expression based on current row
Evaluate(currentRow []interface{}) (interface{}, error)
// returns the type of the expression
Type() parser.ExprDataType
// returns the child expressions for this expression
Children() []PlanExpression
// creates a new expression node with the children replaced
WithChildren(children ...PlanExpression) (PlanExpression, error)
// returns a map containing a rich description of this expression; intended to be
// marshalled into json
Plan() map[string]interface{}
}
PlanExpression is an expression node for an execution plan
type PlanOperator ¶
type PlanOperator interface {
fmt.Stringer
// Children of this operator.
Children() []PlanOperator
// Schema of this operator.
Schema() Schema
// Iterator produces an iterator from this node. The current row being
// evaluated is provided, as well as the context of the query.
Iterator(ctx context.Context, row Row) (RowIterator, error)
// WithChildren creates a new node with the children passed
WithChildren(children ...PlanOperator) (PlanOperator, error)
// Plan returns a map containing a rich description of this operator;
// intended to be marshalled into json.
Plan() map[string]interface{}
// AddWarning adds a warning to the plan.
AddWarning(warning string)
// Warnings returns a list of warnings as strings.
Warnings() []string
}
PlanOperator is a node in an execution plan.
type PlannerColumn ¶
type PlannerColumn struct {
ColumnName string
RelationName string
AliasName string
Type parser.ExprDataType
}
PlannerColumn is the definition of a column returned as a set from each operator
type Relation ¶
type Relation interface {
Name() string
}
Relation is an interface to something that can be treated as a relation
type RowIterable ¶
type RowIterable interface {
Iterator(ctx context.Context, row Row) (RowIterator, error)
}
type RowIterator ¶
RowIterator is an iterator that produces rows (or an error)