octosql: github.com/cube2222/octosql/execution Index | Files | Directories

package execution

import "github.com/cube2222/octosql/execution"

Index

Package Files

distinct.go execution.go filter.go function.go group_by.go hashmap.go in_memory_stream.go innerjoin.go joiner.go leftjoin.go limit.go logic.go map.go offset.go order_by.go record.go record.pb.go relation.go requalifier.go test_utils.go types.go union_all.go

Variables

var ErrEndOfStream = errors.New("end of stream")
var ErrNotFound = errors.New("not found")

func AreStreamsEqual Uses

func AreStreamsEqual(ctx context.Context, first, second RecordStream) (bool, error)

func AreStreamsEqualNoOrdering Uses

func AreStreamsEqualNoOrdering(ctx context.Context, first, second RecordStream) (bool, error)

func ParseType Uses

func ParseType(str string) octosql.Value

ParseType tries to parse the given string into any type it succeeds to. Returns back the string on failure.

type Aggregate Uses

type Aggregate interface {
    docs.Documented
    AddRecord(key octosql.Value, value octosql.Value) error
    GetAggregated(key octosql.Value) (octosql.Value, error)
    String() string
}

type AggregatePrototype Uses

type AggregatePrototype func() Aggregate

type AliasedExpression Uses

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

func NewAliasedExpression Uses

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

func (*AliasedExpression) ExpressionValue Uses

func (alExpr *AliasedExpression) ExpressionValue(ctx context.Context, variables octosql.Variables) (octosql.Value, error)

func (*AliasedExpression) Name Uses

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

type And Uses

type And struct {
    Left, Right Formula
}

func NewAnd Uses

func NewAnd(left Formula, right Formula) *And

func (*And) Evaluate Uses

func (f *And) Evaluate(ctx context.Context, variables octosql.Variables) (bool, error)

type Constant Uses

type Constant struct {
    Value bool
}

func NewConstant Uses

func NewConstant(value bool) *Constant

func (Constant) Evaluate Uses

func (f Constant) Evaluate(ctx context.Context, variables octosql.Variables) (bool, error)

type Datatype Uses

type Datatype string
const (
    DatatypeBoolean Datatype = "boolean"
    DatatypeInt     Datatype = "int"
    DatatypeFloat64 Datatype = "float64"
    DatatypeString  Datatype = "string"
    DatatypeTuple   Datatype = "octosql.Value"
)

type Distinct Uses

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

func NewDistinct Uses

func NewDistinct(child Node) *Distinct

func (*Distinct) Get Uses

func (node *Distinct) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type DistinctStream Uses

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

func NewDistinctStream Uses

func NewDistinctStream(stream RecordStream, variables octosql.Variables, records *recordSet) *DistinctStream

func (*DistinctStream) Close Uses

func (ds *DistinctStream) Close() error

func (*DistinctStream) Next Uses

func (ds *DistinctStream) Next(ctx context.Context) (*Record, error)

type DummyNode Uses

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

func NewDummyNode Uses

func NewDummyNode(data []*Record) *DummyNode

func (*DummyNode) Get Uses

func (dn *DummyNode) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type DummyValue Uses

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

func NewDummyValue Uses

func NewDummyValue(value octosql.Value) *DummyValue

func (*DummyValue) ExpressionValue Uses

func (dv *DummyValue) ExpressionValue(ctx context.Context, variables octosql.Variables) (octosql.Value, error)

type Equal Uses

type Equal struct {
}

func (*Equal) Apply Uses

func (rel *Equal) Apply(ctx context.Context, variables octosql.Variables, left, right Expression) (bool, error)

type Expression Uses

type Expression interface {
    ExpressionValue(ctx context.Context, variables octosql.Variables) (octosql.Value, error)
}

type Field Uses

type Field struct {
    Name octosql.VariableName
}

type Filter Uses

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

func NewFilter Uses

func NewFilter(formula Formula, child Node) *Filter

func (*Filter) Get Uses

func (node *Filter) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type FilteredStream Uses

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

func (*FilteredStream) Close Uses

func (stream *FilteredStream) Close() error

func (*FilteredStream) Next Uses

func (stream *FilteredStream) Next(ctx context.Context) (*Record, error)

type Formula Uses

type Formula interface {
    Evaluate(ctx context.Context, variables octosql.Variables) (bool, error)
}

type Function Uses

type Function struct {
    Name          string
    ArgumentNames [][]string
    Description   docs.Documentation
    Validator     Validator
    Logic         func(...octosql.Value) (octosql.Value, error)
}

func (*Function) Document Uses

func (f *Function) Document() docs.Documentation

type FunctionExpression Uses

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

func NewFunctionExpression Uses

func NewFunctionExpression(fun *Function, args []Expression) *FunctionExpression

func (*FunctionExpression) ExpressionValue Uses

func (fe *FunctionExpression) ExpressionValue(ctx context.Context, variables octosql.Variables) (octosql.Value, error)

type GreaterEqual Uses

type GreaterEqual struct {
}

func (*GreaterEqual) Apply Uses

func (rel *GreaterEqual) Apply(ctx context.Context, variables octosql.Variables, left, right Expression) (bool, error)

type GroupBy Uses

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

func NewGroupBy Uses

func NewGroupBy(source Node, key []Expression, fields []octosql.VariableName, aggregatePrototypes []AggregatePrototype, as []octosql.VariableName) *GroupBy

func (*GroupBy) Get Uses

func (node *GroupBy) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type GroupByStream Uses

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

func (*GroupByStream) Close Uses

func (stream *GroupByStream) Close() error

func (*GroupByStream) Next Uses

func (stream *GroupByStream) Next(ctx context.Context) (*Record, error)

type HashMap Uses

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

func NewHashMap Uses

func NewHashMap() *HashMap

func (*HashMap) Get Uses

func (hm *HashMap) Get(key octosql.Value) (interface{}, bool, error)

func (*HashMap) GetIterator Uses

func (hm *HashMap) GetIterator() *Iterator

func (*HashMap) Set Uses

func (hm *HashMap) Set(key octosql.Value, value interface{}) error

type ID Uses

type ID struct {
    ID                   string   `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func NewID Uses

func NewID(id string) ID

func (*ID) Descriptor Uses

func (*ID) Descriptor() ([]byte, []int)

func (*ID) GetID Uses

func (m *ID) GetID() string

func (*ID) ProtoMessage Uses

func (*ID) ProtoMessage()

func (*ID) Reset Uses

func (m *ID) Reset()

func (ID) Show Uses

func (id ID) Show() string

func (*ID) String Uses

func (m *ID) String() string

func (*ID) XXX_DiscardUnknown Uses

func (m *ID) XXX_DiscardUnknown()

func (*ID) XXX_Marshal Uses

func (m *ID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ID) XXX_Merge Uses

func (m *ID) XXX_Merge(src proto.Message)

func (*ID) XXX_Size Uses

func (m *ID) XXX_Size() int

func (*ID) XXX_Unmarshal Uses

func (m *ID) XXX_Unmarshal(b []byte) error

type In Uses

type In struct {
}

func (*In) Apply Uses

func (rel *In) Apply(ctx context.Context, variables octosql.Variables, left, right Expression) (bool, error)

type InMemoryStream Uses

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

func NewInMemoryStream Uses

func NewInMemoryStream(data []*Record) *InMemoryStream

func (*InMemoryStream) Close Uses

func (ims *InMemoryStream) Close() error

func (*InMemoryStream) Next Uses

func (ims *InMemoryStream) Next(ctx context.Context) (*Record, error)

type InnerJoin Uses

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

InnerJoin currently only supports lookup joins.

func NewInnerJoin Uses

func NewInnerJoin(prefetchCount int, source Node, joined Node) *InnerJoin

func (*InnerJoin) Get Uses

func (node *InnerJoin) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type InnerJoinedStream Uses

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

func (*InnerJoinedStream) Close Uses

func (stream *InnerJoinedStream) Close() error

func (*InnerJoinedStream) Next Uses

func (stream *InnerJoinedStream) Next(ctx context.Context) (*Record, error)

type Iterator Uses

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

func (*Iterator) Next Uses

func (iter *Iterator) Next() (octosql.Value, interface{}, bool)

Next returns next key, value, exists

type Joiner Uses

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

Joiner is used to join one source stream with another datasource.

func NewJoiner Uses

func NewJoiner(prefetchCount int, variables octosql.Variables, sourceStream RecordStream, joined Node) *Joiner

func (*Joiner) Close Uses

func (joiner *Joiner) Close() error

func (*Joiner) GetNextRecord Uses

func (joiner *Joiner) GetNextRecord(ctx context.Context) (*Record, RecordStream, error)

type LeftJoin Uses

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

LeftJoin currently only supports lookup joins.

func NewLeftJoin Uses

func NewLeftJoin(prefetchCount int, source Node, joined Node) *LeftJoin

func (*LeftJoin) Get Uses

func (node *LeftJoin) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type LeftJoinedStream Uses

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

func (*LeftJoinedStream) Close Uses

func (stream *LeftJoinedStream) Close() error

func (*LeftJoinedStream) Next Uses

func (stream *LeftJoinedStream) Next(ctx context.Context) (*Record, error)

type LessEqual Uses

type LessEqual struct {
}

func (*LessEqual) Apply Uses

func (rel *LessEqual) Apply(ctx context.Context, variables octosql.Variables, left, right Expression) (bool, error)

type LessThan Uses

type LessThan struct {
}

func (*LessThan) Apply Uses

func (rel *LessThan) Apply(ctx context.Context, variables octosql.Variables, left, right Expression) (bool, error)

type Like Uses

type Like struct {
}

func (*Like) Apply Uses

func (rel *Like) Apply(ctx context.Context, variables octosql.Variables, left, right Expression) (bool, error)

type Limit Uses

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

func NewLimit Uses

func NewLimit(data Node, limit Expression) *Limit

func (*Limit) Get Uses

func (node *Limit) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type LimitedStream Uses

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

func (*LimitedStream) Close Uses

func (node *LimitedStream) Close() error

func (*LimitedStream) Next Uses

func (node *LimitedStream) Next(ctx context.Context) (*Record, error)

type LogicExpression Uses

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

func NewLogicExpression Uses

func NewLogicExpression(formula Formula) *LogicExpression

func (*LogicExpression) ExpressionValue Uses

func (le *LogicExpression) ExpressionValue(ctx context.Context, variables octosql.Variables) (octosql.Value, error)

type Map Uses

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

func NewMap Uses

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

func (*Map) Get Uses

func (node *Map) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type MappedStream Uses

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

func (*MappedStream) Close Uses

func (stream *MappedStream) Close() error

func (*MappedStream) Next Uses

func (stream *MappedStream) Next(ctx context.Context) (*Record, error)

type Metadata Uses

type Metadata struct {
    Id                   *ID      `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
    Undo                 bool     `protobuf:"varint,2,opt,name=undo,proto3" json:"undo,omitempty"`
    EventTimeField       string   `protobuf:"bytes,3,opt,name=eventTimeField,proto3" json:"eventTimeField,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*Metadata) Descriptor Uses

func (*Metadata) Descriptor() ([]byte, []int)

func (*Metadata) GetEventTimeField Uses

func (m *Metadata) GetEventTimeField() string

func (*Metadata) GetId Uses

func (m *Metadata) GetId() *ID

func (*Metadata) GetUndo Uses

func (m *Metadata) GetUndo() bool

func (*Metadata) ProtoMessage Uses

func (*Metadata) ProtoMessage()

func (*Metadata) Reset Uses

func (m *Metadata) Reset()

func (*Metadata) String Uses

func (m *Metadata) String() string

func (*Metadata) XXX_DiscardUnknown Uses

func (m *Metadata) XXX_DiscardUnknown()

func (*Metadata) XXX_Marshal Uses

func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Metadata) XXX_Merge Uses

func (m *Metadata) XXX_Merge(src proto.Message)

func (*Metadata) XXX_Size Uses

func (m *Metadata) XXX_Size() int

func (*Metadata) XXX_Unmarshal Uses

func (m *Metadata) XXX_Unmarshal(b []byte) error

type MoreThan Uses

type MoreThan struct {
}

func (*MoreThan) Apply Uses

func (rel *MoreThan) Apply(ctx context.Context, variables octosql.Variables, left, right Expression) (bool, error)

type NamedExpression Uses

type NamedExpression interface {
    Expression
    Name() octosql.VariableName
}

type Node Uses

type Node interface {
    Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)
}

type NodeExpression Uses

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

func NewNodeExpression Uses

func NewNodeExpression(node Node) *NodeExpression

func (*NodeExpression) ExpressionValue Uses

func (ne *NodeExpression) ExpressionValue(ctx context.Context, variables octosql.Variables) (octosql.Value, error)

type Not Uses

type Not struct {
    Child Formula
}

func NewNot Uses

func NewNot(child Formula) *Not

func (*Not) Evaluate Uses

func (f *Not) Evaluate(ctx context.Context, variables octosql.Variables) (bool, error)

type NotEqual Uses

type NotEqual struct {
}

func (*NotEqual) Apply Uses

func (rel *NotEqual) Apply(ctx context.Context, variables octosql.Variables, left, right Expression) (bool, error)

type NotIn Uses

type NotIn struct {
}

func (*NotIn) Apply Uses

func (rel *NotIn) Apply(ctx context.Context, variables octosql.Variables, left, right Expression) (bool, error)

type Offset Uses

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

func NewOffset Uses

func NewOffset(data Node, offsetExpr Expression) *Offset

func (*Offset) Get Uses

func (node *Offset) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type Or Uses

type Or struct {
    Left, Right Formula
}

func NewOr Uses

func NewOr(left Formula, right Formula) *Or

func (*Or) Evaluate Uses

func (f *Or) Evaluate(ctx context.Context, variables octosql.Variables) (bool, error)

type OrderBy Uses

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

func NewOrderBy Uses

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

func (*OrderBy) Get Uses

func (ob *OrderBy) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type OrderDirection Uses

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

type Predicate Uses

type Predicate struct {
    Left     Expression
    Relation Relation
    Right    Expression
}

func NewPredicate Uses

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

func (*Predicate) Evaluate Uses

func (f *Predicate) Evaluate(ctx context.Context, variables octosql.Variables) (bool, error)

type Record Uses

type Record struct {
    Metadata             *Metadata        `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
    FieldNames           []string         `protobuf:"bytes,2,rep,name=fieldNames,proto3" json:"fieldNames,omitempty"`
    Data                 []*octosql.Value `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
    XXX_NoUnkeyedLiteral struct{}         `json:"-"`
    XXX_unrecognized     []byte           `json:"-"`
    XXX_sizecache        int32            `json:"-"`
}

func NewRecord Uses

func NewRecord(fields []octosql.VariableName, data map[octosql.VariableName]octosql.Value, opts ...RecordOption) *Record

func NewRecordFromSlice Uses

func NewRecordFromSlice(fields []octosql.VariableName, data []octosql.Value, opts ...RecordOption) *Record

func NewRecordFromSliceWithNormalize Uses

func NewRecordFromSliceWithNormalize(fields []octosql.VariableName, data []interface{}, opts ...RecordOption) *Record

func Normalize Uses

func Normalize(rec *Record) *Record

func (*Record) AsTuple Uses

func (r *Record) AsTuple() octosql.Value

func (*Record) AsVariables Uses

func (r *Record) AsVariables() octosql.Variables

func (*Record) Descriptor Uses

func (*Record) Descriptor() ([]byte, []int)

func (*Record) Equal Uses

func (r *Record) Equal(other *Record) bool

func (*Record) EventTime Uses

func (r *Record) EventTime() octosql.Value

func (*Record) EventTimeField Uses

func (r *Record) EventTimeField() octosql.VariableName

func (*Record) Fields Uses

func (r *Record) Fields() []Field

func (*Record) GetData Uses

func (m *Record) GetData() []*octosql.Value

func (*Record) GetFieldNames Uses

func (m *Record) GetFieldNames() []string

func (*Record) GetMetadata Uses

func (m *Record) GetMetadata() *Metadata

func (*Record) GetVariableNames Uses

func (r *Record) GetVariableNames() []octosql.VariableName

func (*Record) Hash Uses

func (r *Record) Hash() (uint64, error)

func (*Record) ID Uses

func (r *Record) ID() ID

func (*Record) IsUndo Uses

func (r *Record) IsUndo() bool

func (*Record) ProtoMessage Uses

func (*Record) ProtoMessage()

func (*Record) Reset Uses

func (m *Record) Reset()

func (*Record) Show Uses

func (r *Record) Show() string

func (*Record) String Uses

func (m *Record) String() string

func (*Record) Value Uses

func (r *Record) Value(field octosql.VariableName) octosql.Value

func (*Record) XXX_DiscardUnknown Uses

func (m *Record) XXX_DiscardUnknown()

func (*Record) XXX_Marshal Uses

func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Record) XXX_Merge Uses

func (m *Record) XXX_Merge(src proto.Message)

func (*Record) XXX_Size Uses

func (m *Record) XXX_Size() int

func (*Record) XXX_Unmarshal Uses

func (m *Record) XXX_Unmarshal(b []byte) error

type RecordOption Uses

type RecordOption func(stream *Record)

func WithEventTimeField Uses

func WithEventTimeField(field octosql.VariableName) RecordOption

func WithID Uses

func WithID(id ID) RecordOption

func WithMetadataFrom Uses

func WithMetadataFrom(base *Record) RecordOption

func WithUndo Uses

func WithUndo() RecordOption

type RecordStream Uses

type RecordStream interface {
    Next(ctx context.Context) (*Record, error)
    io.Closer
}

type Regexp Uses

type Regexp struct {
}

func (*Regexp) Apply Uses

func (rel *Regexp) Apply(ctx context.Context, variables octosql.Variables, left, right Expression) (bool, error)

type Relation Uses

type Relation interface {
    Apply(ctx context.Context, variables octosql.Variables, left, right Expression) (bool, error)
}

func NewEqual Uses

func NewEqual() Relation

func NewGreaterEqual Uses

func NewGreaterEqual() Relation

func NewIn Uses

func NewIn() Relation

func NewLessEqual Uses

func NewLessEqual() Relation

func NewLessThan Uses

func NewLessThan() Relation

func NewLike Uses

func NewLike() Relation

func NewMoreThan Uses

func NewMoreThan() Relation

func NewNotEqual Uses

func NewNotEqual() Relation

func NewNotIn Uses

func NewNotIn() Relation

func NewRegexp Uses

func NewRegexp() Relation

type RequalifiedStream Uses

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

func (*RequalifiedStream) Close Uses

func (stream *RequalifiedStream) Close() error

func (*RequalifiedStream) Next Uses

func (stream *RequalifiedStream) Next(ctx context.Context) (*Record, error)

type Requalifier Uses

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

func NewRequalifier Uses

func NewRequalifier(qualifier string, child Node) *Requalifier

func (*Requalifier) Get Uses

func (node *Requalifier) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type TupleExpression Uses

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

func NewTuple Uses

func NewTuple(expressions []Expression) *TupleExpression

func (*TupleExpression) ExpressionValue Uses

func (tup *TupleExpression) ExpressionValue(ctx context.Context, variables octosql.Variables) (octosql.Value, error)

type UnifiedStream Uses

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

func (*UnifiedStream) Close Uses

func (node *UnifiedStream) Close() error

func (*UnifiedStream) Next Uses

func (node *UnifiedStream) Next(ctx context.Context) (*Record, error)

type UnionAll Uses

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

func NewUnionAll Uses

func NewUnionAll(first, second Node) *UnionAll

func (*UnionAll) Get Uses

func (node *UnionAll) Get(ctx context.Context, variables octosql.Variables) (RecordStream, error)

type Validator Uses

type Validator interface {
    docs.Documented
    Validate(args ...octosql.Value) error
}

type Variable Uses

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

func NewVariable Uses

func NewVariable(name octosql.VariableName) *Variable

func (*Variable) ExpressionValue Uses

func (v *Variable) ExpressionValue(ctx context.Context, variables octosql.Variables) (octosql.Value, error)

func (*Variable) Name Uses

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

Directories

PathSynopsis
aggregates
aggregates/docgen
functions
functions/docgen
tvf
tvf/docgen

Package execution imports 16 packages (graph) and is imported by 16 packages. Updated 2020-01-19. Refresh now. Tools for package owners.