logical

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AggregateFunctions = map[Aggregate]struct{}{
	Avg:           struct{}{},
	AvgDistinct:   struct{}{},
	Count:         struct{}{},
	CountDistinct: struct{}{},
	First:         struct{}{},
	Last:          struct{}{},
	Max:           struct{}{},
	Min:           struct{}{},
	Sum:           struct{}{},
	SumDistinct:   struct{}{},
}

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"
	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)

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)

type Constant

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

func NewConstant

func NewConstant(value interface{}) *Constant

func (*Constant) Physical

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

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)

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)

type Expression

type Expression interface {
	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)

type Formula

type Formula interface {
	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

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) *GroupBy

func (*GroupBy) Physical

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

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)

type InnerJoin

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

func NewInnerJoin

func NewInnerJoin(source Node, joined Node) *InnerJoin

func (*InnerJoin) Physical

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

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)

type LeftJoin

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

func NewLeftJoin

func NewLeftJoin(source Node, joined Node) *LeftJoin

func (*LeftJoin) Physical

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

type Limit

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

func (*Limit) Physical

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

type LogicExpression

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

func NewLogicExpression

func NewLogicExpression(formula Formula) *LogicExpression

func (*LogicExpression) Physical

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)

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 {
	Physical(ctx context.Context, physicalCreator *PhysicalPlanCreator) (physical.Node, octosql.Variables, error)
}

func NewLimit

func NewLimit(data Node, expr Expression) Node

func NewOffset

func NewOffset(data Node, expr Expression) Node

type NodeExpression

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

func NewNodeExpression

func NewNodeExpression(node Node) *NodeExpression

func (*NodeExpression) Physical

type Offset

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

func (*Offset) Physical

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

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)

type OrderDirection

type OrderDirection string

type PhysicalPlanCreator

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

func (*PhysicalPlanCreator) GetVariableName

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

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)

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)

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 = "<="
)

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)

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)

type TableValuedFunctionArgumentValue added in v0.2.0

type TableValuedFunctionArgumentValue interface {
	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

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

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

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)

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)

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)

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)

Jump to

Keyboard shortcuts

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