Documentation
¶
Index ¶
- func ExplainExpr(expr Expression, withTypeInfo bool) *graph.Node
- func ExplainNode(node Node, withTypeInfo bool) *graph.Node
- func VariableNameMatchesField(varName, fieldName string) bool
- func WithNoRetractions(noRetractions bool) func(schema *Schema)
- type Aggregate
- type AggregateDescriptor
- type AggregateDetails
- type And
- type Cast
- type Coalesce
- type Constant
- type CountingTrigger
- type Database
- type Datasource
- type DatasourceImplementation
- type DatasourceRepository
- type Distinct
- type EndOfStreamTrigger
- type Environment
- type Expression
- type ExpressionType
- type Filter
- type FunctionCall
- type FunctionDescriptor
- type FunctionDetails
- type GroupBy
- type Limit
- type LookupJoin
- type Map
- type MultiTrigger
- type Node
- type NodeType
- type ObjectFieldAccess
- type Or
- type OrderBy
- type QueryExpression
- type Requalifier
- type Schema
- type SchemaField
- type SchemaOption
- type StreamJoin
- type TableValuedFunction
- type TableValuedFunctionArgument
- type TableValuedFunctionArgumentDescriptor
- type TableValuedFunctionArgumentExpression
- type TableValuedFunctionArgumentTable
- type TableValuedFunctionArgumentType
- type TableValuedFunctionDescriptor
- type Transformers
- type Trigger
- type TriggerType
- type Tuple
- type TypeAssertion
- type Unnest
- type Variable
- type VariableContext
- type WatermarkTrigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExplainExpr ¶ added in v0.4.0
func ExplainExpr(expr Expression, withTypeInfo bool) *graph.Node
func VariableNameMatchesField ¶ added in v0.4.0
func WithNoRetractions ¶ added in v0.6.0
Types ¶
type Aggregate ¶
type Aggregate struct {
Name string
OutputType octosql.Type
AggregateDescriptor AggregateDescriptor
}
type AggregateDescriptor ¶ added in v0.4.0
type AggregateDetails ¶ added in v0.4.0
type AggregateDetails struct {
Description string
Descriptors []AggregateDescriptor
}
type And ¶
type And struct {
Arguments []Expression
}
type Cast ¶ added in v0.4.0
type Cast struct {
Expression Expression
TargetTypeID octosql.TypeID
}
type Coalesce ¶ added in v0.4.0
type Coalesce struct {
Arguments []Expression
}
type CountingTrigger ¶ added in v0.3.0
type CountingTrigger struct {
TriggerAfter uint
}
type Datasource ¶ added in v0.4.0
type Datasource struct {
Name, Alias string
DatasourceImplementation DatasourceImplementation
VariableMapping map[string]string
Predicates []Expression
}
func (*Datasource) PushDownPredicates ¶ added in v0.4.0
func (node *Datasource) PushDownPredicates(newPredicates, pushedDownPredicates []Expression) (rejected []Expression, pushedDown []Expression, changed bool)
type DatasourceImplementation ¶ added in v0.4.0
type DatasourceImplementation interface {
Materialize(ctx context.Context, env Environment, schema Schema, pushedDownPredicates []Expression) (execution.Node, error)
PushDownPredicates(newPredicates, pushedDownPredicates []Expression) (rejected, pushedDown []Expression, changed bool)
}
type DatasourceRepository ¶ added in v0.4.0
type DatasourceRepository struct {
// TODO: A może jednak ten bardziej dynamiczny interfejs? Że database.<table> i wtedy sie resolvuje
// Bo inaczej będzie na start strasznie dużo rzeczy ładować niepotrzebnych dla wszystkich
// skonfigurowanych baz danych.
Databases map[string]func() (Database, error)
FileHandlers map[string]func(name string, options map[string]string) (DatasourceImplementation, Schema, error)
}
func (*DatasourceRepository) GetDatasource ¶ added in v0.4.0
func (dr *DatasourceRepository) GetDatasource(ctx context.Context, name string, options map[string]string) (DatasourceImplementation, Schema, error)
type EndOfStreamTrigger ¶ added in v0.4.0
type EndOfStreamTrigger struct {
}
type Environment ¶ added in v0.4.0
type Environment struct {
Aggregates map[string]AggregateDetails
Datasources *DatasourceRepository
Functions map[string]FunctionDetails
PhysicalConfig map[string]interface{}
VariableContext *VariableContext
}
TODO: There should be a seperate MaterializationContext.
func (Environment) WithRecordSchema ¶ added in v0.4.0
func (env Environment) WithRecordSchema(schema Schema) Environment
type Expression ¶
type Expression struct {
Type octosql.Type
ExpressionType ExpressionType
// Only one of the below may be non-null.
Variable *Variable
Constant *Constant
FunctionCall *FunctionCall
And *And
Or *Or
QueryExpression *QueryExpression
Coalesce *Coalesce
Tuple *Tuple
TypeAssertion *TypeAssertion
Cast *Cast
ObjectFieldAccess *ObjectFieldAccess
}
func RenameVariablesExpr ¶ added in v0.4.0
func RenameVariablesExpr(oldToNew map[string]string, expr Expression) Expression
func (*Expression) Materialize ¶
func (expr *Expression) Materialize(ctx context.Context, env Environment) (execution.Expression, error)
func (Expression) SplitByAnd ¶ added in v0.4.0
func (expr Expression) SplitByAnd() []Expression
func (Expression) VariablesUsed ¶ added in v0.4.0
func (expr Expression) VariablesUsed() []string
type ExpressionType ¶ added in v0.4.0
type ExpressionType int
const ( ExpressionTypeVariable ExpressionType = iota ExpressionTypeConstant ExpressionTypeFunctionCall ExpressionTypeAnd ExpressionTypeOr ExpressionTypeQueryExpression ExpressionTypeCoalesce ExpressionTypeTuple ExpressionTypeTypeAssertion ExpressionTypeCast ExpressionTypeObjectFieldAccess )
func (ExpressionType) String ¶ added in v0.4.0
func (t ExpressionType) String() string
type Filter ¶
type Filter struct {
Source Node
Predicate Expression
}
type FunctionCall ¶ added in v0.4.0
type FunctionCall struct {
Name string
Arguments []Expression
FunctionDescriptor FunctionDescriptor
}
type FunctionDescriptor ¶ added in v0.4.0
type FunctionDetails ¶ added in v0.4.0
type FunctionDetails struct {
Description string
Descriptors []FunctionDescriptor
}
type GroupBy ¶
type GroupBy struct {
Source Node
Aggregates []Aggregate
AggregateExpressions []Expression
Key []Expression
// Either index to Key, or -1, if none.
KeyEventTimeIndex int
Trigger Trigger
}
type Limit ¶
type Limit struct {
Source Node
Limit Expression
}
type LookupJoin ¶ added in v0.3.0
type LookupJoin struct {
Source, Joined Node
}
type Map ¶
type Map struct {
Source Node
Expressions []Expression
}
type MultiTrigger ¶ added in v0.4.0
type MultiTrigger struct {
Triggers []Trigger
}
type Node ¶
type Node struct {
Schema Schema
NodeType NodeType
// Only one of the below may be non-null.
Datasource *Datasource
Distinct *Distinct
Filter *Filter
GroupBy *GroupBy
LookupJoin *LookupJoin
StreamJoin *StreamJoin
Map *Map
OrderBy *OrderBy
Requalifier *Requalifier
TableValuedFunction *TableValuedFunction
Unnest *Unnest
Limit *Limit
}
func RenameVariables ¶ added in v0.4.0
func (*Node) Materialize ¶
type ObjectFieldAccess ¶ added in v0.5.0
type ObjectFieldAccess struct {
Object Expression
Field string
}
type Or ¶
type Or struct {
Arguments []Expression
}
type OrderBy ¶
type OrderBy struct {
Source Node
Key []Expression
DirectionMultipliers []int
}
type QueryExpression ¶ added in v0.4.0
type QueryExpression struct {
Source Node
}
type Requalifier ¶
type Schema ¶ added in v0.4.0
type Schema struct {
Fields []SchemaField
// TimeField is -1 if not present.
TimeField int
NoRetractions bool
}
func NewSchema ¶ added in v0.4.0
func NewSchema(fields []SchemaField, timeField int, options ...SchemaOption) Schema
type SchemaField ¶ added in v0.4.0
type SchemaOption ¶ added in v0.6.0
type SchemaOption func(schema *Schema)
type StreamJoin ¶ added in v0.3.0
type StreamJoin struct {
Left, Right Node
LeftKey, RightKey []Expression
}
type TableValuedFunction ¶ added in v0.2.0
type TableValuedFunction struct {
Name string
Arguments map[string]TableValuedFunctionArgument
FunctionDescriptor TableValuedFunctionDescriptor
}
type TableValuedFunctionArgument ¶ added in v0.4.0
type TableValuedFunctionArgument struct {
TableValuedFunctionArgumentType TableValuedFunctionArgumentType
// Only one of the below may be non-null.
Expression *TableValuedFunctionArgumentExpression
Table *TableValuedFunctionArgumentTable
Descriptor *TableValuedFunctionArgumentDescriptor
}
func (*TableValuedFunctionArgument) String ¶ added in v0.4.0
func (arg *TableValuedFunctionArgument) String() string
type TableValuedFunctionArgumentDescriptor ¶ added in v0.4.0
type TableValuedFunctionArgumentDescriptor struct {
Descriptor string
}
type TableValuedFunctionArgumentExpression ¶ added in v0.4.0
type TableValuedFunctionArgumentExpression struct {
Expression Expression
}
type TableValuedFunctionArgumentTable ¶ added in v0.4.0
type TableValuedFunctionArgumentTable struct {
Table Node
}
type TableValuedFunctionArgumentType ¶ added in v0.4.0
type TableValuedFunctionArgumentType int
const ( TableValuedFunctionArgumentTypeExpression TableValuedFunctionArgumentType = iota TableValuedFunctionArgumentTypeTable TableValuedFunctionArgumentTypeDescriptor )
type TableValuedFunctionDescriptor ¶ added in v0.4.0
type TableValuedFunctionDescriptor struct {
Materialize func(context.Context, Environment, map[string]TableValuedFunctionArgument) (execution.Node, error)
}
type Transformers ¶
type Transformers struct {
NodeTransformer func(node Node) Node
ExpressionTransformer func(expr Expression) Expression
}
func (*Transformers) TransformExpr ¶ added in v0.4.0
func (t *Transformers) TransformExpr(expr Expression) Expression
func (*Transformers) TransformNode ¶ added in v0.4.0
func (t *Transformers) TransformNode(node Node) Node
TODO: This should probably push down and make available the environment.
type Trigger ¶ added in v0.3.0
type Trigger struct {
TriggerType TriggerType
// Only one of the below may be non-null.
CountingTrigger *CountingTrigger
EndOfStreamTrigger *EndOfStreamTrigger
WatermarkTrigger *WatermarkTrigger
MultiTrigger *MultiTrigger
}
func (*Trigger) Materialize ¶ added in v0.3.0
func (*Trigger) NoRetractions ¶ added in v0.6.0
NoRetractions indicates whether the trigger can result in retractions of keys, or not. In other words, if a single key can be triggered multiple times.
type TriggerType ¶ added in v0.4.0
type TriggerType int
const ( TriggerTypeCounting TriggerType = iota TriggerTypeEndOfStream TriggerTypeWatermark TriggerTypeMulti )
func (TriggerType) String ¶ added in v0.4.0
func (t TriggerType) String() string
type Tuple ¶
type Tuple struct {
Arguments []Expression
}
type TypeAssertion ¶ added in v0.4.0
type TypeAssertion struct {
Expression Expression
TargetType octosql.Type
}
type VariableContext ¶ added in v0.4.0
type VariableContext struct {
Parent *VariableContext
Fields []SchemaField
}
func (*VariableContext) WithRecordSchema ¶ added in v0.4.0
func (varCtx *VariableContext) WithRecordSchema(schema Schema) *VariableContext
type WatermarkTrigger ¶ added in v0.3.0
type WatermarkTrigger struct {
TimeFieldIndex int
}
Click to show internal directories.
Click to hide internal directories.