types

package
v3.35.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 CompilePlanner interface {
	CompilePlan(context.Context, parser.Statement) (PlanOperator, error)
}

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 Row

type Row []interface{}

Row is a tuple (of values)

func (Row) Append

func (r Row) Append(r2 Row) Row

Append appends all the values in r2 to this row and returns the result

type RowIterable

type RowIterable interface {
	Iterator(ctx context.Context, row Row) (RowIterator, error)
}

type RowIterator

type RowIterator interface {
	Next(ctx context.Context) (Row, error)
}

RowIterator is an iterator that produces rows (or an error)

type Rows added in v3.29.0

type Rows []Row

Rows is a table of rows

type Schema

type Schema []*PlannerColumn

Schema is the definition a set of columns from each operator

func (Schema) Plan added in v3.27.0

func (r Schema) Plan() []map[string]interface{}

Jump to

Keyboard shortcuts

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