logical

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectionsToMultipliers added in v0.4.0

func DirectionsToMultipliers(directions []OrderDirection) []int

func EqualExpressions

func EqualExpressions(expr1, expr2 Expression) bool

func GetUniqueNameMatchingVariable added in v0.4.0

func GetUniqueNameMatchingVariable(mapping map[string]string, name string) (string, bool)

func ReverseMapping added in v0.4.0

func ReverseMapping(mapping map[string]string) map[string]string

func TypecheckExpression added in v0.4.0

func TypecheckExpression(ctx context.Context, env physical.Environment, logicalEnv Environment, expected octosql.Type, expression Expression) physical.Expression

func TypecheckPossiblyNullableStruct added in v0.5.0

func TypecheckPossiblyNullableStruct(ctx context.Context, env physical.Environment, logicalEnv Environment, expression Expression) physical.Expression

Types

type And added in v0.4.0

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

func NewAnd added in v0.4.0

func NewAnd(left, right Expression) *And

func (*And) Typecheck added in v0.4.0

func (and *And) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) physical.Expression

type Coalesce added in v0.4.0

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

func NewCoalesce added in v0.4.0

func NewCoalesce(args []Expression) *Coalesce

func (*Coalesce) Typecheck added in v0.4.0

func (c *Coalesce) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) physical.Expression

type CommonTableExpression added in v0.4.0

type CommonTableExpression struct {
	Node                  physical.Node
	UniqueVariableMapping map[string]string
}

type Constant

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

func NewConstant

func NewConstant(value octosql.Value) *Constant

func (*Constant) Typecheck added in v0.4.0

func (c *Constant) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) physical.Expression

type CountingTrigger added in v0.3.0

type CountingTrigger struct {
	Count uint
}

func NewCountingTrigger added in v0.3.0

func NewCountingTrigger(count uint) *CountingTrigger

func (*CountingTrigger) Typecheck added in v0.4.0

func (w *CountingTrigger) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment, keyTimeIndex int) physical.Trigger

type DataSource

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

func NewDataSource

func NewDataSource(name, alias string, options map[string]string) *DataSource

func (*DataSource) Typecheck added in v0.4.0

func (ds *DataSource) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

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) Typecheck added in v0.4.0

func (w *DelayTrigger) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment, keyTimeIndex int) physical.Trigger

type Distinct

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

func NewDistinct

func NewDistinct(source Node) *Distinct

func (*Distinct) Typecheck added in v0.4.0

func (node *Distinct) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

type EndOfStreamTrigger added in v0.4.0

type EndOfStreamTrigger struct {
}

func NewEndOfStreamTrigger added in v0.4.0

func NewEndOfStreamTrigger() *EndOfStreamTrigger

func (*EndOfStreamTrigger) Typecheck added in v0.4.0

func (w *EndOfStreamTrigger) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment, keyTimeIndex int) physical.Trigger

type Environment added in v0.4.0

type Environment struct {
	CommonTableExpressions map[string]CommonTableExpression
	TableValuedFunctions   map[string]TableValuedFunctionDescription
	UniqueVariableNames    *VariableMapping
	UniqueNameGenerator    map[string]int
}

func (*Environment) GetUnique added in v0.4.0

func (env *Environment) GetUnique(name string) string

func (*Environment) WithRecordUniqueVariableNames added in v0.4.0

func (env *Environment) WithRecordUniqueVariableNames(record map[string]string) Environment

type Expression

type Expression interface {
	Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) physical.Expression
}

type FieldNamer added in v0.4.0

type FieldNamer interface {
	FieldName() string
}

FieldNamer can be implemented by expressions with pretty default names based on their content.

type Filter

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

func NewFilter

func NewFilter(predicate Expression, child Node) *Filter

func (*Filter) Typecheck added in v0.4.0

func (node *Filter) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

type FunctionExpression

type FunctionExpression struct {
	Name      string
	Arguments []Expression
}

func NewFunctionExpression

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

func (*FunctionExpression) Typecheck added in v0.4.0

type GroupBy

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

func NewGroupBy

func NewGroupBy(source Node, key []Expression, keyNames []string, expressions []Expression, aggregates []string, aggregateNames []string, triggers []Trigger) *GroupBy

func (*GroupBy) Typecheck added in v0.4.0

func (node *GroupBy) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

type LookupJoin added in v0.8.0

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

func NewLookupJoin added in v0.8.0

func NewLookupJoin(left, right Node) *LookupJoin

func (*LookupJoin) Typecheck added in v0.8.0

func (node *LookupJoin) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

type Map

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

func NewMap

func NewMap(expressions []Expression, aliases []string, starQualifiers []string, isStar []bool, objectExplosions []Expression, isObjectExplosion []bool, child Node) *Map

func (*Map) Typecheck added in v0.4.0

func (node *Map) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

type Node

type Node interface {
	// Typechecking panics on error, because it will never be handled in a different way than being bubbled up to the top.
	Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)
}

type ObjectFieldAccess added in v0.5.0

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

func NewObjectFieldAccess added in v0.5.0

func NewObjectFieldAccess(object Expression, field string) *ObjectFieldAccess

func (*ObjectFieldAccess) Typecheck added in v0.5.0

type Or added in v0.4.0

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

func NewOr added in v0.4.0

func NewOr(left, right Expression) *Or

func (*Or) Typecheck added in v0.4.0

func (or *Or) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) physical.Expression

type OrderDirection

type OrderDirection string

type OrderSensitiveTransform added in v0.8.0

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

func NewOrderSensitiveTransform added in v0.8.0

func NewOrderSensitiveTransform(keyExprs []Expression, directions []OrderDirection, limit *Expression, source Node) *OrderSensitiveTransform

func (*OrderSensitiveTransform) Typecheck added in v0.8.0

func (node *OrderSensitiveTransform) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

type OuterJoin added in v0.8.0

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

func NewOuterJoin added in v0.8.0

func NewOuterJoin(left, right Node, predicate Expression, isLeft, isRight bool) *OuterJoin

func (*OuterJoin) Typecheck added in v0.8.0

func (node *OuterJoin) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

type QueryExpression added in v0.4.0

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

func NewQueryExpression added in v0.4.0

func NewQueryExpression(node Node) *QueryExpression

func (*QueryExpression) Typecheck added in v0.4.0

func (ne *QueryExpression) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) physical.Expression

type Requalifier

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

func NewRequalifier

func NewRequalifier(qualifier string, child Node) *Requalifier

func (*Requalifier) Typecheck added in v0.4.0

func (node *Requalifier) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

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) Typecheck added in v0.4.0

func (se *StarExpression) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) physical.Expression

type StreamJoin added in v0.8.0

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

func NewStreamJoin added in v0.8.0

func NewStreamJoin(left, right Node) *StreamJoin

func (*StreamJoin) Typecheck added in v0.8.0

func (node *StreamJoin) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

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[string]TableValuedFunctionArgumentValue) *TableValuedFunction

func (*TableValuedFunction) Typecheck added in v0.4.0

func (node *TableValuedFunction) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

type TableValuedFunctionArgumentMatcher added in v0.4.0

type TableValuedFunctionArgumentMatcher struct {
	Required                               bool
	TableValuedFunctionArgumentMatcherType physical.TableValuedFunctionArgumentType
	// Only one of the below may be non-null.
	Expression *TableValuedFunctionArgumentMatcherExpression
	Table      *TableValuedFunctionArgumentMatcherTable
	Descriptor *TableValuedFunctionArgumentMatcherDescriptor
}

type TableValuedFunctionArgumentMatcherDescriptor added in v0.4.0

type TableValuedFunctionArgumentMatcherDescriptor struct {
}

type TableValuedFunctionArgumentMatcherExpression added in v0.4.0

type TableValuedFunctionArgumentMatcherExpression struct {
	Type octosql.Type
}

type TableValuedFunctionArgumentMatcherTable added in v0.4.0

type TableValuedFunctionArgumentMatcherTable struct {
}

type TableValuedFunctionArgumentValue added in v0.2.0

type TableValuedFunctionArgumentValue interface {
	// 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 string) *TableValuedFunctionArgumentValueDescriptor

func (*TableValuedFunctionArgumentValueDescriptor) Typecheck added in v0.4.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) Typecheck added in v0.4.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) Typecheck added in v0.4.0

type TableValuedFunctionDescription added in v0.4.0

type TableValuedFunctionDescription struct {
	TypecheckArguments func(context.Context, physical.Environment, Environment, map[string]TableValuedFunctionArgumentValue) map[string]TableValuedFunctionTypecheckedArgument
	Descriptors        []TableValuedFunctionDescriptor
}

type TableValuedFunctionDescriptor added in v0.4.0

type TableValuedFunctionDescriptor struct {
	Arguments map[string]TableValuedFunctionArgumentMatcher
	// Here we can check the inputs.
	OutputSchema func(context.Context, physical.Environment, Environment, map[string]TableValuedFunctionTypecheckedArgument) (physical.Schema, map[string]string, error)
	Materialize  func(context.Context, physical.Environment, map[string]physical.TableValuedFunctionArgument) (execution.Node, error)
}

type TableValuedFunctionTypecheckedArgument added in v0.4.0

type TableValuedFunctionTypecheckedArgument struct {
	Mapping  map[string]string
	Argument physical.TableValuedFunctionArgument
}

type Trigger added in v0.3.0

type Trigger interface {
	Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment, keyTimeIndex int) physical.Trigger
}

type Tuple

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

func NewTuple

func NewTuple(expressions []Expression) *Tuple

func (*Tuple) Typecheck added in v0.4.0

func (t *Tuple) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) physical.Expression

type TypeCast added in v0.9.2

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

func NewTypeCast added in v0.9.2

func NewTypeCast(arg Expression, targetTypeID octosql.TypeID) *TypeCast

func (*TypeCast) Typecheck added in v0.9.2

func (c *TypeCast) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) physical.Expression

type UnionAll

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

func NewUnionAll

func NewUnionAll(first, second Node) *UnionAll

func (*UnionAll) Typecheck added in v0.4.0

func (node *UnionAll) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

type UnionDistinct

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

func NewUnionDistinct

func NewUnionDistinct(first, second Node) *UnionDistinct

func (*UnionDistinct) Typecheck added in v0.4.0

func (node *UnionDistinct) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

type Variable

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

func NewVariable

func NewVariable(name string) *Variable

func (*Variable) FieldName added in v0.4.0

func (v *Variable) FieldName() string

func (*Variable) Typecheck added in v0.4.0

func (v *Variable) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) physical.Expression

type VariableMapping added in v0.4.0

type VariableMapping struct {
	Parent  *VariableMapping
	Mapping map[string]string
}

func (*VariableMapping) GetUniqueName added in v0.4.0

func (mapping *VariableMapping) GetUniqueName(name string) (string, bool)

func (*VariableMapping) WithRecordMapping added in v0.4.0

func (mapping *VariableMapping) WithRecordMapping(record map[string]string) *VariableMapping

type WatermarkTrigger added in v0.3.0

type WatermarkTrigger struct {
}

func NewWatermarkTrigger added in v0.3.0

func NewWatermarkTrigger() *WatermarkTrigger

func (*WatermarkTrigger) Typecheck added in v0.4.0

func (w *WatermarkTrigger) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment, keyTimeIndex int) physical.Trigger

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) Typecheck added in v0.4.0

func (node *With) Typecheck(ctx context.Context, env physical.Environment, logicalEnv Environment) (physical.Node, map[string]string)

Jump to

Keyboard shortcuts

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