physical

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: 15 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

func NewAggregate

func NewAggregate(aggregate string) Aggregate

type AliasedExpression

type AliasedExpression struct {
	ExpressionAlias octosql.VariableName
	Expr            Expression
}

AliasedExpression describes an expression which is explicitly named.

func NewAliasedExpression

func NewAliasedExpression(name octosql.VariableName, expr Expression) *AliasedExpression

func (*AliasedExpression) DoesMatchNamespace added in v0.3.0

func (alExpr *AliasedExpression) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*AliasedExpression) ExpressionName added in v0.3.0

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

func (*AliasedExpression) Materialize

func (alExpr *AliasedExpression) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Expression, error)

func (*AliasedExpression) MaterializeNamed

func (alExpr *AliasedExpression) MaterializeNamed(ctx context.Context, matCtx *MaterializationContext) (execution.NamedExpression, error)

func (*AliasedExpression) Transform

func (alExpr *AliasedExpression) Transform(ctx context.Context, transformers *Transformers) Expression

func (*AliasedExpression) TransformNamed

func (alExpr *AliasedExpression) TransformNamed(ctx context.Context, transformers *Transformers) NamedExpression

func (*AliasedExpression) Visualize added in v0.3.0

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

type And

type And struct {
	Left, Right Formula
}

func NewAnd

func NewAnd(left Formula, right Formula) *And

func (*And) DoesMatchNamespace added in v0.3.0

func (f *And) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*And) ExtractPredicates

func (f *And) ExtractPredicates() []*Predicate

func (*And) Materialize

func (f *And) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Formula, error)

func (*And) SplitByAnd

func (f *And) SplitByAnd() []Formula

func (*And) Transform

func (f *And) Transform(ctx context.Context, transformers *Transformers) Formula

func (*And) Visualize added in v0.3.0

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

type Constant

type Constant struct {
	Value bool
}

func NewConstant

func NewConstant(value bool) *Constant

func (*Constant) DoesMatchNamespace added in v0.3.0

func (f *Constant) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*Constant) ExtractPredicates

func (f *Constant) ExtractPredicates() []*Predicate

func (*Constant) Materialize

func (f *Constant) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Formula, error)

func (*Constant) SplitByAnd

func (f *Constant) SplitByAnd() []Formula

func (*Constant) Transform

func (f *Constant) Transform(ctx context.Context, transformers *Transformers) Formula

func (*Constant) Visualize added in v0.3.0

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

type ConstantStrategy added in v0.3.0

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

func (*ConstantStrategy) Materialize added in v0.3.0

func (*ConstantStrategy) Transform added in v0.3.0

func (s *ConstantStrategy) Transform(ctx context.Context, transformers *Transformers) ShuffleStrategy

func (*ConstantStrategy) Visualize added in v0.3.0

func (s *ConstantStrategy) 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) Materialize added in v0.3.0

func (*CountingTrigger) Transform added in v0.3.0

func (c *CountingTrigger) Transform(ctx context.Context, transformers *Transformers) Trigger

func (*CountingTrigger) Visualize added in v0.3.0

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

type DataSourceBuilder

type DataSourceBuilder struct {
	Materializer     DataSourceMaterializerFunc
	PrimaryKeys      []octosql.VariableName
	AvailableFilters map[FieldType]map[Relation]struct{}
	Filter           Formula
	Name             string
	Alias            string
	Partition        int

	// This field will be used to decide on join strategies or if the source is a stream.
	Cardinality metadata.Cardinality
}

DataSourceBuilder is used to build a data source instance with an alias. It may be given filters, which are later executed at the database level.

func (*DataSourceBuilder) Materialize

func (dsb *DataSourceBuilder) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*DataSourceBuilder) Metadata added in v0.2.0

func (dsb *DataSourceBuilder) Metadata() *metadata.NodeMetadata

func (*DataSourceBuilder) Transform

func (dsb *DataSourceBuilder) Transform(ctx context.Context, transformers *Transformers) Node

func (*DataSourceBuilder) Visualize added in v0.3.0

func (dsb *DataSourceBuilder) Visualize() *graph.Node

type DataSourceBuilderFactory

type DataSourceBuilderFactory func(name, alias string) []Node

DataSourceBuilderFactory is a function used to create a new aliased data source builder.

func NewDataSourceBuilderFactory

func NewDataSourceBuilderFactory(materializer DataSourceMaterializerFunc, primaryKeys []octosql.VariableName, availableFilters map[FieldType]map[Relation]struct{}, cardinality metadata.Cardinality, partitions int) DataSourceBuilderFactory

type DataSourceMaterializerFunc added in v0.3.0

type DataSourceMaterializerFunc func(ctx context.Context, matCtx *MaterializationContext, dbConfig map[string]interface{}, filter Formula, alias string, partition int) (execution.Node, error)

type DataSourceRepository

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

DataSourceRepository is used to register factories for builders for any data source. It can also later create a builder for any of those data source.

func CreateDataSourceRepositoryFromConfig added in v0.1.1

func CreateDataSourceRepositoryFromConfig(factories map[string]Factory, config *config.Config) (*DataSourceRepository, error)

CreateDataSourceRepositoryFromConfig creates a DataSourceRepository from a config, using the given configuration reading data source factories. The map should be given as databaseType -> Factory.

func NewDataSourceRepository

func NewDataSourceRepository() *DataSourceRepository

func (*DataSourceRepository) Get

func (repo *DataSourceRepository) Get(dataSourceName, alias string) ([]Node, error)

Get gets a new builder for a given data source.

func (*DataSourceRepository) Register

func (repo *DataSourceRepository) Register(dataSourceName string, factory DataSourceBuilderFactory) error

Register registers a builder factory for the given data source ColumnName.

func (*DataSourceRepository) WithFactory added in v0.3.0

func (repo *DataSourceRepository) WithFactory(dataSourceName string, factory DataSourceBuilderFactory) *DataSourceRepository

Register registers a builder factory for the given data source ColumnName.

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) Materialize added in v0.3.0

func (*DelayTrigger) Transform added in v0.3.0

func (c *DelayTrigger) Transform(ctx context.Context, transformers *Transformers) Trigger

func (*DelayTrigger) Visualize added in v0.3.0

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

type Distinct

type Distinct struct {
	Source Node
}

func NewDistinct

func NewDistinct(child Node) *Distinct

func (*Distinct) Materialize

func (node *Distinct) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*Distinct) Metadata added in v0.2.0

func (node *Distinct) Metadata() *metadata.NodeMetadata

func (*Distinct) Transform

func (node *Distinct) Transform(ctx context.Context, transformers *Transformers) Node

func (*Distinct) Visualize added in v0.3.0

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

type Expression

type Expression interface {
	// Transform returns a new Expression after recursively calling Transform
	Transform(ctx context.Context, transformers *Transformers) Expression
	Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Expression, error)
	DoesMatchNamespace(namespace *metadata.Namespace) bool
	graph.Visualizer
}

Expressions describes a single value source.

func NewRecordExpression added in v0.3.0

func NewRecordExpression() Expression

type Factory added in v0.1.1

type Factory func(dbConfig map[string]interface{}) (DataSourceBuilderFactory, error)

type FieldType

type FieldType string

FieldType describes if a key is a primary or secondary attribute.

const (
	Primary   FieldType = "primary"
	Secondary FieldType = "secondary"
)

type Filter

type Filter struct {
	Formula Formula
	Source  Node
}

func NewFilter

func NewFilter(formula Formula, child Node) *Filter

func (*Filter) Materialize

func (node *Filter) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*Filter) Metadata added in v0.2.0

func (node *Filter) Metadata() *metadata.NodeMetadata

func (*Filter) Transform

func (node *Filter) Transform(ctx context.Context, transformers *Transformers) Node

func (*Filter) Visualize added in v0.3.0

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

type Formula

type Formula interface {
	// Transform returns a new Formula after recursively calling Transform
	Transform(ctx context.Context, transformers *Transformers) Formula
	SplitByAnd() []Formula
	ExtractPredicates() []*Predicate
	Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Formula, error)
	DoesMatchNamespace(namespace *metadata.Namespace) bool
	graph.Visualizer
}

Formula describes any source of a logical value.

type FunctionExpression

type FunctionExpression struct {
	Name      string
	Arguments []Expression
}

func NewFunctionExpression

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

func (*FunctionExpression) DoesMatchNamespace added in v0.3.0

func (fe *FunctionExpression) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*FunctionExpression) Materialize

func (*FunctionExpression) Transform

func (fe *FunctionExpression) Transform(ctx context.Context, transformers *Transformers) Expression

func (*FunctionExpression) Visualize added in v0.3.0

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

type GroupBy

type GroupBy struct {
	Source Node
	Key    []Expression

	Fields     []octosql.VariableName
	Aggregates []Aggregate

	As []octosql.VariableName

	Triggers []Trigger
}

func NewGroupBy

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

func (*GroupBy) Materialize

func (node *GroupBy) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*GroupBy) Metadata added in v0.2.0

func (node *GroupBy) Metadata() *metadata.NodeMetadata

func (*GroupBy) Transform

func (node *GroupBy) Transform(ctx context.Context, transformers *Transformers) Node

func (*GroupBy) Visualize added in v0.3.0

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

type KeyHashingStrategy added in v0.3.0

type KeyHashingStrategy struct {
	Key []Expression
}

func (*KeyHashingStrategy) Materialize added in v0.3.0

func (*KeyHashingStrategy) Transform added in v0.3.0

func (s *KeyHashingStrategy) Transform(ctx context.Context, transformers *Transformers) ShuffleStrategy

func (*KeyHashingStrategy) Visualize added in v0.3.0

func (s *KeyHashingStrategy) Visualize() *graph.Node

type LogicExpression

type LogicExpression struct {
	Formula Formula
}

LogicExpressions describes a boolean expression which get's it's value from the logic formula underneath.

func NewLogicExpression

func NewLogicExpression(formula Formula) *LogicExpression

func (*LogicExpression) DoesMatchNamespace added in v0.3.0

func (le *LogicExpression) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*LogicExpression) Materialize

func (*LogicExpression) Transform

func (le *LogicExpression) Transform(ctx context.Context, transformers *Transformers) Expression

func (*LogicExpression) Visualize added in v0.3.0

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

type LookupJoin added in v0.3.0

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

func NewLookupJoin added in v0.3.0

func NewLookupJoin(source, joined Node, isLeftJoin bool) *LookupJoin

func (*LookupJoin) Materialize added in v0.3.0

func (node *LookupJoin) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*LookupJoin) Metadata added in v0.3.0

func (node *LookupJoin) Metadata() *metadata.NodeMetadata

func (*LookupJoin) Transform added in v0.3.0

func (node *LookupJoin) Transform(ctx context.Context, transformers *Transformers) Node

func (*LookupJoin) Visualize added in v0.3.0

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

type Map

type Map struct {
	Expressions []NamedExpression
	Source      Node
	Keep        bool
}

func NewMap

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

func (*Map) Materialize

func (node *Map) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*Map) Metadata added in v0.2.0

func (node *Map) Metadata() *metadata.NodeMetadata

func (*Map) Transform

func (node *Map) Transform(ctx context.Context, transformers *Transformers) Node

func (*Map) Visualize added in v0.3.0

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

type MaterializationContext added in v0.1.1

type MaterializationContext struct {
	Config  *config.Config
	Storage storage.Storage
}

MaterializationContext is a structure containing the configuration for the materialization.

func NewMaterializationContext added in v0.1.1

func NewMaterializationContext(config *config.Config, storage storage.Storage) *MaterializationContext

type NamedExpression

type NamedExpression interface {
	Expression
	// TransformNamed returns a new NamedExpression after recursively calling Transform
	ExpressionName() octosql.VariableName
	TransformNamed(ctx context.Context, transformers *Transformers) NamedExpression
	MaterializeNamed(ctx context.Context, matCtx *MaterializationContext) (execution.NamedExpression, error)
}

NamedExpressions describes a single named value source.

type NextShuffleMetadataChange added in v0.3.0

type NextShuffleMetadataChange struct {
	ShuffleIDAddSuffix string
	Partition          int
	Source             Node
}

func NewNextShuffleMetadataChange added in v0.3.0

func NewNextShuffleMetadataChange(shuffleIDAddSuffix string, partition int, source Node) *NextShuffleMetadataChange

func (*NextShuffleMetadataChange) Materialize added in v0.3.0

func (*NextShuffleMetadataChange) Metadata added in v0.3.0

func (*NextShuffleMetadataChange) Transform added in v0.3.0

func (node *NextShuffleMetadataChange) Transform(ctx context.Context, transformers *Transformers) Node

func (*NextShuffleMetadataChange) Visualize added in v0.3.0

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

type Node

type Node interface {
	// Transform returns a new Node after recursively calling Transform
	Transform(ctx context.Context, transformers *Transformers) Node
	Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)
	Metadata() *metadata.NodeMetadata
	graph.Visualizer
}

Node describes a single record stream source.

func NewShuffle added in v0.3.0

func NewShuffle(outputPartitionCount int, strategy ShuffleStrategy, sourceNodes []Node) []Node

type NodeExpression

type NodeExpression struct {
	Node Node
}

NodeExpressions describes an expression which gets it's value from a node underneath.

func NewNodeExpression

func NewNodeExpression(node Node) *NodeExpression

func (*NodeExpression) DoesMatchNamespace added in v0.3.0

func (ne *NodeExpression) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*NodeExpression) Materialize

func (*NodeExpression) Transform

func (ne *NodeExpression) Transform(ctx context.Context, transformers *Transformers) Expression

func (*NodeExpression) Visualize added in v0.3.0

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

type Not

type Not struct {
	Child Formula
}

func NewNot

func NewNot(child Formula) *Not

func (*Not) DoesMatchNamespace added in v0.3.0

func (f *Not) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*Not) ExtractPredicates

func (f *Not) ExtractPredicates() []*Predicate

func (*Not) Materialize

func (f *Not) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Formula, error)

func (*Not) SplitByAnd

func (f *Not) SplitByAnd() []Formula

func (*Not) Transform

func (f *Not) Transform(ctx context.Context, transformers *Transformers) Formula

func (*Not) Visualize added in v0.3.0

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

type Or

type Or struct {
	Left, Right Formula
}

func NewOr

func NewOr(left Formula, right Formula) *Or

func (*Or) DoesMatchNamespace added in v0.3.0

func (f *Or) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*Or) ExtractPredicates

func (f *Or) ExtractPredicates() []*Predicate

func (*Or) Materialize

func (f *Or) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Formula, error)

func (*Or) SplitByAnd

func (f *Or) SplitByAnd() []Formula

func (*Or) Transform

func (f *Or) Transform(ctx context.Context, transformers *Transformers) Formula

func (*Or) Visualize added in v0.3.0

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

type OrderBy

type OrderBy struct {
	Expressions []Expression
	Directions  []OrderDirection
	Source      Node
}

func NewOrderBy

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

func (*OrderBy) Materialize

func (node *OrderBy) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*OrderBy) Metadata added in v0.2.0

func (node *OrderBy) Metadata() *metadata.NodeMetadata

func (*OrderBy) Transform

func (node *OrderBy) Transform(ctx context.Context, transformers *Transformers) Node

func (*OrderBy) Visualize added in v0.3.0

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

type OrderDirection

type OrderDirection string
const (
	Ascending  OrderDirection = "asc"
	Descending OrderDirection = "desc"
)

type OutputOptions added in v0.3.0

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

func NewOutputOptions added in v0.3.0

func NewOutputOptions(
	orderByExpressions []Expression,
	orderByDirections []OrderDirection,
	limit Expression,
	offset Expression,
) *OutputOptions

func (*OutputOptions) Materialize added in v0.3.0

func (opts *OutputOptions) Materialize(ctx context.Context, matCtx *MaterializationContext) (*execution.OutputOptions, error)

type Predicate

type Predicate struct {
	Left     Expression
	Relation Relation
	Right    Expression
}

func NewPredicate

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

func (*Predicate) DoesMatchNamespace added in v0.3.0

func (f *Predicate) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*Predicate) ExtractPredicates

func (f *Predicate) ExtractPredicates() []*Predicate

func (*Predicate) Materialize

func (f *Predicate) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Formula, error)

func (*Predicate) SplitByAnd

func (f *Predicate) SplitByAnd() []Formula

func (*Predicate) Transform

func (f *Predicate) Transform(ctx context.Context, transformers *Transformers) Formula

func (*Predicate) Visualize added in v0.3.0

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

type RecordExpression added in v0.3.0

type RecordExpression struct {
}

func (*RecordExpression) DoesMatchNamespace added in v0.3.0

func (r *RecordExpression) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*RecordExpression) Materialize added in v0.3.0

func (*RecordExpression) Transform added in v0.3.0

func (r *RecordExpression) Transform(ctx context.Context, transformers *Transformers) Expression

func (*RecordExpression) Visualize added in v0.3.0

func (r *RecordExpression) Visualize() *graph.Node

type Relation

type Relation string

Relation describes a comparison operator.

const (
	Equal        Relation = "equal"
	NotEqual     Relation = "not_equal"
	MoreThan     Relation = "more_than"
	LessThan     Relation = "less_than"
	Like         Relation = "like"
	In           Relation = "in"
	NotIn        Relation = "not_in"
	GreaterEqual Relation = "greater_equal"
	LessEqual    Relation = "less_equal"
	Regexp       Relation = "regexp"
)

func NewRelation

func NewRelation(relation string) Relation

func (Relation) Materialize

func (rel Relation) Materialize(ctx context.Context, matCtx *MaterializationContext) execution.Relation

type Requalifier

type Requalifier struct {
	Qualifier string
	Source    Node
}

func NewRequalifier

func NewRequalifier(qualifier string, child Node) *Requalifier

func (*Requalifier) Materialize

func (node *Requalifier) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*Requalifier) Metadata added in v0.2.0

func (node *Requalifier) Metadata() *metadata.NodeMetadata

func (*Requalifier) Transform

func (node *Requalifier) Transform(ctx context.Context, transformers *Transformers) Node

func (*Requalifier) Visualize added in v0.3.0

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

type Shuffle added in v0.3.0

type Shuffle struct {
	OutputPartitionCount int
	Strategy             ShuffleStrategy
	Sources              []Node
}

func (*Shuffle) Materialize added in v0.3.0

func (node *Shuffle) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*Shuffle) Metadata added in v0.3.0

func (node *Shuffle) Metadata() *metadata.NodeMetadata

func (*Shuffle) Transform added in v0.3.0

func (node *Shuffle) Transform(ctx context.Context, transformers *Transformers) Node

func (*Shuffle) Visualize added in v0.3.0

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

type ShuffleStrategy added in v0.3.0

type ShuffleStrategy interface {
	Transform(ctx context.Context, transformers *Transformers) ShuffleStrategy
	Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.ShuffleStrategyPrototype, error)
	Visualize() *graph.Node
}

func NewConstantStrategy added in v0.3.0

func NewConstantStrategy(partition int) ShuffleStrategy

func NewKeyHashingStrategy added in v0.3.0

func NewKeyHashingStrategy(key []Expression) ShuffleStrategy

type StarExpression added in v0.3.0

type StarExpression struct {
	Qualifier string
}

func NewStarExpression added in v0.3.0

func NewStarExpression(qualifier string) *StarExpression

func (*StarExpression) DoesMatchNamespace added in v0.3.0

func (se *StarExpression) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*StarExpression) ExpressionName added in v0.3.0

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

func (*StarExpression) Materialize added in v0.3.0

func (*StarExpression) MaterializeNamed added in v0.3.0

func (se *StarExpression) MaterializeNamed(ctx context.Context, matCtx *MaterializationContext) (execution.NamedExpression, error)

func (*StarExpression) Transform added in v0.3.0

func (se *StarExpression) Transform(ctx context.Context, transformers *Transformers) Expression

func (*StarExpression) TransformNamed added in v0.3.0

func (se *StarExpression) TransformNamed(ctx context.Context, transformers *Transformers) NamedExpression

func (*StarExpression) Visualize added in v0.3.0

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

type StreamJoin added in v0.3.0

type StreamJoin struct {
	Source         Node
	Joined         Node
	SourceKey      []Expression
	JoinedKey      []Expression
	EventTimeField octosql.VariableName
	JoinType       execution.JoinType
	Triggers       []Trigger
}

func NewStreamJoin added in v0.3.0

func NewStreamJoin(source, joined Node, sourceKey, joinedKey []Expression, eventTimeField octosql.VariableName, joinType execution.JoinType, triggers []Trigger) *StreamJoin

func (*StreamJoin) Materialize added in v0.3.0

func (node *StreamJoin) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*StreamJoin) Metadata added in v0.3.0

func (node *StreamJoin) Metadata() *metadata.NodeMetadata

func (*StreamJoin) Transform added in v0.3.0

func (node *StreamJoin) Transform(ctx context.Context, transformers *Transformers) Node

func (*StreamJoin) Visualize added in v0.3.0

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

type StubNode added in v0.3.0

type StubNode struct {
	NodeMetadata *metadata.NodeMetadata
}

func NewStubNode added in v0.3.0

func NewStubNode(metadata *metadata.NodeMetadata) *StubNode

func (*StubNode) Materialize added in v0.3.0

func (s *StubNode) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*StubNode) Metadata added in v0.3.0

func (s *StubNode) Metadata() *metadata.NodeMetadata

func (*StubNode) Transform added in v0.3.0

func (s *StubNode) Transform(ctx context.Context, transformers *Transformers) Node

func (*StubNode) Visualize added in v0.3.0

func (s *StubNode) Visualize() *graph.Node

type TableValuedFunction added in v0.2.0

type TableValuedFunction struct {
	Name      string
	Arguments map[octosql.VariableName]TableValuedFunctionArgumentValue
}

func NewTableValuedFunction added in v0.2.0

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

func (*TableValuedFunction) Materialize added in v0.2.0

func (node *TableValuedFunction) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Node, error)

func (*TableValuedFunction) Metadata added in v0.2.0

func (node *TableValuedFunction) Metadata() *metadata.NodeMetadata

TODO: fix Namespace here

func (*TableValuedFunction) Transform added in v0.2.0

func (node *TableValuedFunction) Transform(ctx context.Context, transformers *Transformers) Node

func (*TableValuedFunction) Visualize added in v0.3.0

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

type TableValuedFunctionArgumentValue added in v0.2.0

type TableValuedFunctionArgumentValue interface {
	Transform(ctx context.Context, transformers *Transformers) TableValuedFunctionArgumentValue
	graph.Visualizer
	// contains filtered or unexported methods
}

type TableValuedFunctionArgumentValueDescriptor added in v0.2.0

type TableValuedFunctionArgumentValueDescriptor struct {
	Descriptor octosql.VariableName
}

func NewTableValuedFunctionArgumentValueDescriptor added in v0.2.0

func NewTableValuedFunctionArgumentValueDescriptor(descriptor octosql.VariableName) *TableValuedFunctionArgumentValueDescriptor

func (*TableValuedFunctionArgumentValueDescriptor) Transform added in v0.2.0

func (*TableValuedFunctionArgumentValueDescriptor) Visualize added in v0.3.0

type TableValuedFunctionArgumentValueExpression added in v0.2.0

type TableValuedFunctionArgumentValueExpression struct {
	Expression Expression
}

func NewTableValuedFunctionArgumentValueExpression added in v0.2.0

func NewTableValuedFunctionArgumentValueExpression(expression Expression) *TableValuedFunctionArgumentValueExpression

func (*TableValuedFunctionArgumentValueExpression) Transform added in v0.2.0

func (*TableValuedFunctionArgumentValueExpression) Visualize added in v0.3.0

type TableValuedFunctionArgumentValueTable added in v0.2.0

type TableValuedFunctionArgumentValueTable struct {
	Source Node
}

func NewTableValuedFunctionArgumentValueTable added in v0.2.0

func NewTableValuedFunctionArgumentValueTable(source Node) *TableValuedFunctionArgumentValueTable

func (*TableValuedFunctionArgumentValueTable) Transform added in v0.2.0

func (*TableValuedFunctionArgumentValueTable) Visualize added in v0.3.0

type Transformers

type Transformers struct {
	NodeT                             func(Node) Node
	ExprT                             func(Expression) Expression
	NamedExprT                        func(NamedExpression) NamedExpression
	FormulaT                          func(Formula) Formula
	TableValuedFunctionArgumentValueT func(TableValuedFunctionArgumentValue) TableValuedFunctionArgumentValue
	TriggerT                          func(Trigger) Trigger
	ShuffleStrategyT                  func(ShuffleStrategy) ShuffleStrategy
}

Transformers is a structure containing functions to transform each of the physical plan components.

type Trigger added in v0.3.0

type Trigger interface {
	// Transform returns a new Expression after recursively calling Transform
	Transform(ctx context.Context, transformers *Transformers) Trigger
	Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.TriggerPrototype, error)
	graph.Visualizer
}

type Tuple

type Tuple struct {
	Expressions []Expression
}

TupleExpression describes an expression which is a tuple of subexpressions.

func NewTuple

func NewTuple(expressions []Expression) *Tuple

func (*Tuple) DoesMatchNamespace added in v0.3.0

func (tup *Tuple) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*Tuple) Materialize

func (tup *Tuple) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Expression, error)

func (*Tuple) Transform

func (tup *Tuple) Transform(ctx context.Context, transformers *Transformers) Expression

func (*Tuple) Visualize added in v0.3.0

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

type Variable

type Variable struct {
	Name octosql.VariableName
}

Variables describes a variable name.

func NewVariable

func NewVariable(name octosql.VariableName) *Variable

func (*Variable) DoesMatchNamespace added in v0.3.0

func (v *Variable) DoesMatchNamespace(namespace *metadata.Namespace) bool

func (*Variable) ExpressionName added in v0.3.0

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

func (*Variable) Materialize

func (v *Variable) Materialize(ctx context.Context, matCtx *MaterializationContext) (execution.Expression, error)

func (*Variable) MaterializeNamed

func (v *Variable) MaterializeNamed(ctx context.Context, matCtx *MaterializationContext) (execution.NamedExpression, error)

func (*Variable) Transform

func (v *Variable) Transform(ctx context.Context, transformers *Transformers) Expression

func (*Variable) TransformNamed

func (v *Variable) TransformNamed(ctx context.Context, transformers *Transformers) NamedExpression

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) Materialize added in v0.3.0

func (*WatermarkTrigger) Transform added in v0.3.0

func (c *WatermarkTrigger) Transform(ctx context.Context, transformers *Transformers) Trigger

func (*WatermarkTrigger) Visualize added in v0.3.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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