logical

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: MPL-2.0 Imports: 7 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

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

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

func NewCast added in v0.4.0

func NewCast(arg Expression, targetType octosql.Type) *Cast

func (*Cast) Typecheck added in v0.4.0

func (c *Cast) 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) *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 Join added in v0.3.0

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

func NewJoin added in v0.3.0

func NewJoin(left, right Node) *Join

func (*Join) Typecheck added in v0.4.0

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

type JoinStrategy added in v0.4.0

type JoinStrategy string
const (
	JoinStrategyUndefined JoinStrategy = "UNDEFINED"
	JoinStrategyLookup    JoinStrategy = "LOOKUP"
	JoinStrategyStream    JoinStrategy = "STREAM"
)

type JoinType added in v0.4.0

type JoinType string
const (
	JoinTypeLeft  JoinType = "Left"
	JoinTypeInner JoinType = "Inner"
)

type LateralJoin added in v0.4.0

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

func NewLateralJoin added in v0.4.0

func NewLateralJoin(left, right Node) *LateralJoin

func (*LateralJoin) Typecheck added in v0.4.0

func (node *LateralJoin) 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, 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 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 OrderBy

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

func NewOrderBy

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

func (*OrderBy) Typecheck added in v0.4.0

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

type OrderDirection

type OrderDirection 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 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 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