logical

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AggregateFunctions = map[Aggregate]struct{}{
	Avg:           {},
	AvgDistinct:   {},
	Count:         {},
	CountDistinct: {},
	First:         {},
	Last:          {},
	Max:           {},
	Key:           {},
	Min:           {},
	Sum:           {},
	SumDistinct:   {},
}
View Source
var ErrFallbackToLookupJoin = errors.New("fallback to lookup join")

Functions

func EqualExpressions

func EqualExpressions(expr1, expr2 Expression) error

func EqualFormula

func EqualFormula(expr1, expr2 Formula) error

func EqualNodes

func EqualNodes(node1, node2 Node) error

func EqualTableValuedFunctionArgumentValue added in v0.2.0

func EqualTableValuedFunctionArgumentValue(value1 TableValuedFunctionArgumentValue, value2 TableValuedFunctionArgumentValue) error

Types

type Aggregate

type Aggregate string
const (
	Avg           Aggregate = "avg"
	AvgDistinct   Aggregate = "avg_distinct"
	Count         Aggregate = "count"
	CountDistinct Aggregate = "count_distinct"
	First         Aggregate = "first"
	Key           Aggregate = "key"
	Last          Aggregate = "last"
	Max           Aggregate = "max"
	Min           Aggregate = "min"
	Sum           Aggregate = "sum"
	SumDistinct   Aggregate = "sum_distinct"
)

type AliasedExpression

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

func (*AliasedExpression) Name

func (alExpr *AliasedExpression) Name() octosql.VariableName

func (*AliasedExpression) Physical

func (alExpr *AliasedExpression) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Expression, octosql.Variables, error)

func (*AliasedExpression) PhysicalNamed

func (alExpr *AliasedExpression) PhysicalNamed(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.NamedExpression, octosql.Variables, error)

func (*AliasedExpression) Visualize added in v0.3.0

func (alExpr *AliasedExpression) Visualize() *graph.Node

type BooleanConstant

type BooleanConstant struct {
	Value bool
}

func NewBooleanConstant

func NewBooleanConstant(value bool) *BooleanConstant

func (*BooleanConstant) Physical

func (f *BooleanConstant) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Formula, octosql.Variables, error)

func (*BooleanConstant) Visualize added in v0.3.0

func (f *BooleanConstant) Visualize() *graph.Node

type Constant

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

func NewConstant

func NewConstant(value interface{}) *Constant

func (*Constant) Physical

func (c *Constant) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Expression, octosql.Variables, error)

func (*Constant) Visualize added in v0.3.0

func (c *Constant) Visualize() *graph.Node

type CountingTrigger added in v0.3.0

type CountingTrigger struct {
	Count Expression
}

func NewCountingTrigger added in v0.3.0

func NewCountingTrigger(count Expression) *CountingTrigger

func (*CountingTrigger) Physical added in v0.3.0

func (w *CountingTrigger) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Trigger, octosql.Variables, error)

func (*CountingTrigger) Visualize added in v0.3.0

func (w *CountingTrigger) Visualize() *graph.Node

type DataSource

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

func NewDataSource

func NewDataSource(name string, alias string) *DataSource

func (*DataSource) Physical

func (ds *DataSource) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (*DataSource) Visualize added in v0.3.0

func (ds *DataSource) Visualize() *graph.Node

type DelayTrigger added in v0.3.0

type DelayTrigger struct {
	Delay Expression
}

func NewDelayTrigger added in v0.3.0

func NewDelayTrigger(delay Expression) *DelayTrigger

func (*DelayTrigger) Physical added in v0.3.0

func (w *DelayTrigger) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Trigger, octosql.Variables, error)

func (*DelayTrigger) Visualize added in v0.3.0

func (w *DelayTrigger) Visualize() *graph.Node

type Distinct

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

func NewDistinct

func NewDistinct(child Node) *Distinct

func (*Distinct) Physical

func (node *Distinct) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (*Distinct) Visualize added in v0.3.0

func (node *Distinct) Visualize() *graph.Node

type Expression

type Expression interface {
	graph.Visualizer

	Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Expression, octosql.Variables, error)
}

type Filter

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

func NewFilter

func NewFilter(formula Formula, child Node) *Filter

func (*Filter) Physical

func (node *Filter) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (*Filter) Visualize added in v0.3.0

func (node *Filter) Visualize() *graph.Node

type Formula

type Formula interface {
	graph.Visualizer

	Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Formula, octosql.Variables, error)
}

type FunctionExpression

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

func NewFunctionExpression

func NewFunctionExpression(name string, args []Expression) *FunctionExpression

func (*FunctionExpression) Physical

func (*FunctionExpression) Visualize added in v0.3.0

func (fe *FunctionExpression) Visualize() *graph.Node

type GroupBy

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

func NewGroupBy

func NewGroupBy(source Node, key []Expression, fields []octosql.VariableName, aggregates []Aggregate, as []octosql.VariableName, triggers []Trigger) *GroupBy

func (*GroupBy) Physical

func (node *GroupBy) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (*GroupBy) Visualize added in v0.3.0

func (node *GroupBy) Visualize() *graph.Node

type InfixOperator

type InfixOperator struct {
	Left     Formula
	Operator string
	Right    Formula
}

func NewInfixOperator

func NewInfixOperator(left Formula, right Formula, operator string) *InfixOperator

func (*InfixOperator) Physical

func (f *InfixOperator) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Formula, octosql.Variables, error)

func (*InfixOperator) Visualize added in v0.3.0

func (f *InfixOperator) Visualize() *graph.Node

type Interval added in v0.2.0

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

func NewInterval added in v0.2.0

func NewInterval(count Expression, unit Expression) *Interval

func (*Interval) Physical added in v0.2.0

func (v *Interval) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Expression, octosql.Variables, error)

func (*Interval) Visualize added in v0.3.0

func (v *Interval) Visualize() *graph.Node

type Join added in v0.3.0

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

func NewJoin added in v0.3.0

func NewJoin(source, joined Node, joinType execution.JoinType) *Join

func (*Join) Physical added in v0.3.0

func (node *Join) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (*Join) Visualize added in v0.3.0

func (node *Join) Visualize() *graph.Node

func (*Join) WithTriggers added in v0.3.0

func (node *Join) WithTriggers(triggers []Trigger) *Join

type LogicExpression

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

func NewLogicExpression

func NewLogicExpression(formula Formula) *LogicExpression

func (*LogicExpression) Physical

func (*LogicExpression) Visualize added in v0.3.0

func (le *LogicExpression) Visualize() *graph.Node

type Map

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

func NewMap

func NewMap(expressions []NamedExpression, child Node, keep bool) *Map

func (*Map) Physical

func (node *Map) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (*Map) Visualize added in v0.3.0

func (node *Map) Visualize() *graph.Node

type NamedExpression

type NamedExpression interface {
	Expression
	Name() octosql.VariableName
	PhysicalNamed(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.NamedExpression, octosql.Variables, error)
}

func NewAliasedExpression

func NewAliasedExpression(name octosql.VariableName, expr Expression) NamedExpression

type Node

type Node interface {
	graph.Visualizer

	Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)
}

type NodeExpression

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

func NewNodeExpression

func NewNodeExpression(node Node) *NodeExpression

func (*NodeExpression) Physical

func (*NodeExpression) Visualize added in v0.3.0

func (ne *NodeExpression) Visualize() *graph.Node

type OrderBy

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

func NewOrderBy

func NewOrderBy(expressions []Expression, directions []OrderDirection, source Node) *OrderBy

func (*OrderBy) Physical

func (node *OrderBy) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (*OrderBy) Visualize added in v0.3.0

func (node *OrderBy) Visualize() *graph.Node

type OrderDirection

type OrderDirection string

type OutputOptions added in v0.3.0

type OutputOptions struct {
	OrderByExpressions []Expression
	OrderByDirections  []OrderDirection
	Limit              Expression
	Offset             Expression
}

func (*OutputOptions) Physical added in v0.3.0

func (opts *OutputOptions) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (*physical.OutputOptions, octosql.Variables, error)

type PhysicalPlanCreator

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

func NewPhysicalPlanCreator

func NewPhysicalPlanCreator(repo *physical.DataSourceRepository, physicalConfig map[string]interface{}) *PhysicalPlanCreator

func (*PhysicalPlanCreator) GetVariableName

func (creator *PhysicalPlanCreator) GetVariableName() (out octosql.VariableName)

func (*PhysicalPlanCreator) WithCommonTableExpression added in v0.3.0

func (creator *PhysicalPlanCreator) WithCommonTableExpression(name string, nodes []physical.Node) *PhysicalPlanCreator

type Predicate

type Predicate struct {
	Left     Expression
	Relation Relation
	Right    Expression
}

func NewPredicate

func NewPredicate(left Expression, relation Relation, right Expression) *Predicate

func (*Predicate) Physical

func (f *Predicate) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Formula, octosql.Variables, error)

func (*Predicate) Visualize added in v0.3.0

func (f *Predicate) Visualize() *graph.Node

type PrefixOperator

type PrefixOperator struct {
	Child    Formula
	Operator string
}

func NewPrefixOperator

func NewPrefixOperator(child Formula, operator string) *PrefixOperator

func (*PrefixOperator) Physical

func (f *PrefixOperator) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Formula, octosql.Variables, error)

func (*PrefixOperator) Visualize added in v0.3.0

func (f *PrefixOperator) Visualize() *graph.Node

type Relation

type Relation string
const (
	Equal        Relation = "="
	NotEqual     Relation = "!="
	MoreThan     Relation = ">"
	LessThan     Relation = "<"
	Like         Relation = "like"
	In           Relation = "in"
	NotIn        Relation = "not in"
	GreaterEqual Relation = ">="
	LessEqual    Relation = "<="
	Regexp       Relation = "regexp"
)

func NewRelation

func NewRelation(relation string) Relation

func (Relation) Physical

func (rel Relation) Physical(ctx context.Context) (physical.Relation, error)

type Requalifier

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

func NewRequalifier

func NewRequalifier(qualifier string, child Node) *Requalifier

func (*Requalifier) Physical

func (node *Requalifier) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (Requalifier) Visualize added in v0.3.0

func (node Requalifier) Visualize() *graph.Node

type StarExpression added in v0.3.0

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

func NewStarExpression added in v0.3.0

func NewStarExpression(qualifier string) *StarExpression

func (*StarExpression) Name added in v0.3.0

func (se *StarExpression) Name() octosql.VariableName

func (*StarExpression) Physical added in v0.3.0

func (*StarExpression) PhysicalNamed added in v0.3.0

func (se *StarExpression) PhysicalNamed(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.NamedExpression, octosql.Variables, error)

func (*StarExpression) Visualize added in v0.3.0

func (se *StarExpression) Visualize() *graph.Node

type TableValuedFunction added in v0.2.0

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

func NewTableValuedFunction added in v0.2.0

func NewTableValuedFunction(name string, arguments map[octosql.VariableName]TableValuedFunctionArgumentValue) *TableValuedFunction

func (*TableValuedFunction) Physical added in v0.2.0

func (node *TableValuedFunction) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (*TableValuedFunction) Visualize added in v0.3.0

func (node *TableValuedFunction) Visualize() *graph.Node

type TableValuedFunctionArgumentValue added in v0.2.0

type TableValuedFunctionArgumentValue interface {
	graph.Visualizer

	Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.TableValuedFunctionArgumentValue, octosql.Variables, error)
	// contains filtered or unexported methods
}

type TableValuedFunctionArgumentValueDescriptor added in v0.2.0

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

func NewTableValuedFunctionArgumentValueDescriptor added in v0.2.0

func NewTableValuedFunctionArgumentValueDescriptor(descriptor octosql.VariableName) *TableValuedFunctionArgumentValueDescriptor

func (*TableValuedFunctionArgumentValueDescriptor) Physical added in v0.2.0

func (*TableValuedFunctionArgumentValueDescriptor) Visualize added in v0.3.0

type TableValuedFunctionArgumentValueExpression added in v0.2.0

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

func NewTableValuedFunctionArgumentValueExpression added in v0.2.0

func NewTableValuedFunctionArgumentValueExpression(expression Expression) *TableValuedFunctionArgumentValueExpression

func (*TableValuedFunctionArgumentValueExpression) Physical added in v0.2.0

func (*TableValuedFunctionArgumentValueExpression) Visualize added in v0.3.0

type TableValuedFunctionArgumentValueTable added in v0.2.0

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

func NewTableValuedFunctionArgumentValueTable added in v0.2.0

func NewTableValuedFunctionArgumentValueTable(source Node) *TableValuedFunctionArgumentValueTable

func (*TableValuedFunctionArgumentValueTable) Physical added in v0.2.0

func (*TableValuedFunctionArgumentValueTable) Visualize added in v0.3.0

type Trigger added in v0.3.0

type Trigger interface {
	Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Trigger, octosql.Variables, error)
	Visualize() *graph.Node
}

type Tuple

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

func NewTuple

func NewTuple(expressions []Expression) *Tuple

func (*Tuple) Physical

func (tup *Tuple) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Expression, octosql.Variables, error)

func (*Tuple) Visualize added in v0.3.0

func (tup *Tuple) Visualize() *graph.Node

type UnionAll

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

func NewUnionAll

func NewUnionAll(first, second Node) *UnionAll

func (*UnionAll) Physical

func (node *UnionAll) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (*UnionAll) Visualize added in v0.3.0

func (node *UnionAll) Visualize() *graph.Node

type UnionDistinct

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

func NewUnionDistinct

func NewUnionDistinct(first, second Node) *UnionDistinct

func (*UnionDistinct) Physical

func (node *UnionDistinct) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (*UnionDistinct) Visualize added in v0.3.0

func (node *UnionDistinct) Visualize() *graph.Node

type Variable

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

func NewVariable

func NewVariable(name octosql.VariableName) *Variable

func (*Variable) Name

func (v *Variable) Name() octosql.VariableName

func (*Variable) Physical

func (v *Variable) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Expression, octosql.Variables, error)

func (*Variable) PhysicalNamed

func (v *Variable) PhysicalNamed(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.NamedExpression, octosql.Variables, error)

func (*Variable) Visualize added in v0.3.0

func (v *Variable) Visualize() *graph.Node

type WatermarkTrigger added in v0.3.0

type WatermarkTrigger struct {
}

func NewWatermarkTrigger added in v0.3.0

func NewWatermarkTrigger() *WatermarkTrigger

func (*WatermarkTrigger) Physical added in v0.3.0

func (*WatermarkTrigger) Visualize added in v0.3.0

func (w *WatermarkTrigger) Visualize() *graph.Node

type With added in v0.3.0

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

func NewWith added in v0.3.0

func NewWith(cteNames []string, cteNodes []Node, source Node) *With

func (*With) Physical added in v0.3.0

func (node *With) Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) ([]physical.Node, octosql.Variables, error)

func (*With) Visualize added in v0.3.0

func (node *With) Visualize() *graph.Node

Jump to

Keyboard shortcuts

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