rows

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmitOperator

type EmitOperator struct {
	stream.BaseOperator
	Exprs []expr.Expr
}

func Emit

func Emit(exprs ...expr.Expr) *EmitOperator

Emit creates an operator that iterates over the given expressions. Each expression must evaluate to an object.

func (*EmitOperator) Iterate

func (op *EmitOperator) Iterate(in *environment.Environment, fn func(out *environment.Environment) error) error

func (*EmitOperator) String

func (op *EmitOperator) String() string

type FilterOperator

type FilterOperator struct {
	stream.BaseOperator
	Expr expr.Expr
}

A FilterOperator filters values based on a given expression.

func Filter

func Filter(e expr.Expr) *FilterOperator

Filter evaluates e for each incoming value and filters any value whose result is not truthy.

func (*FilterOperator) Iterate

func (op *FilterOperator) Iterate(in *environment.Environment, f func(out *environment.Environment) error) error

Iterate implements the Operator interface.

func (*FilterOperator) String

func (op *FilterOperator) String() string

type GroupAggregateOperator

type GroupAggregateOperator struct {
	stream.BaseOperator
	Builders []expr.AggregatorBuilder
	E        expr.Expr
}

func GroupAggregate

func GroupAggregate(groupBy expr.Expr, builders ...expr.AggregatorBuilder) *GroupAggregateOperator

GroupAggregate consumes the incoming stream and outputs one value per group. It assumes the stream is sorted by groupBy.

func (*GroupAggregateOperator) Iterate

func (*GroupAggregateOperator) String

func (op *GroupAggregateOperator) String() string

type ProjectOperator

type ProjectOperator struct {
	stream.BaseOperator
	Exprs []expr.Expr
}

A ProjectOperator applies an expression on each value of the stream and returns a new value.

func Project

func Project(exprs ...expr.Expr) *ProjectOperator

Project creates a ProjectOperator.

func (*ProjectOperator) Iterate

func (op *ProjectOperator) Iterate(in *environment.Environment, f func(out *environment.Environment) error) error

Iterate implements the Operator interface.

func (*ProjectOperator) String

func (op *ProjectOperator) String() string

type RowMask

type RowMask struct {
	Env   *environment.Environment
	Exprs []expr.Expr
	// contains filtered or unexported fields
}

func (*RowMask) Get

func (m *RowMask) Get(column string) (v types.Value, err error)

func (*RowMask) GetByField

func (m *RowMask) GetByField(field string) (v types.Value, err error)

func (*RowMask) Iterate

func (m *RowMask) Iterate(fn func(field string, value types.Value) error) error

func (*RowMask) Key

func (m *RowMask) Key() *tree.Key

func (*RowMask) MarshalJSON

func (d *RowMask) MarshalJSON() ([]byte, error)

func (*RowMask) Object

func (m *RowMask) Object() types.Object

func (*RowMask) String

func (m *RowMask) String() string

func (*RowMask) TableName

func (m *RowMask) TableName() string

type SkipOperator

type SkipOperator struct {
	stream.BaseOperator
	E expr.Expr
}

A SkipOperator skips the n first values of the stream.

func Skip

func Skip(e expr.Expr) *SkipOperator

Skip ignores the first n values of the stream.

func (*SkipOperator) Iterate

func (op *SkipOperator) Iterate(in *environment.Environment, f func(out *environment.Environment) error) error

Iterate implements the Operator interface.

func (*SkipOperator) String

func (op *SkipOperator) String() string

type TakeOperator

type TakeOperator struct {
	stream.BaseOperator
	E expr.Expr
}

A TakeOperator closes the stream after a certain number of values.

func Take

func Take(e expr.Expr) *TakeOperator

Take closes the stream after n values have passed through the operator.

func (*TakeOperator) Iterate

func (op *TakeOperator) Iterate(in *environment.Environment, f func(out *environment.Environment) error) error

Iterate implements the Operator interface.

func (*TakeOperator) String

func (op *TakeOperator) String() string

type TempTreeSortOperator

type TempTreeSortOperator struct {
	stream.BaseOperator
	Expr expr.Expr
	Desc bool
}

A TempTreeSortOperator consumes every value of the stream and outputs them in order.

func TempTreeSort

func TempTreeSort(e expr.Expr) *TempTreeSortOperator

TempTreeSort consumes every value of the stream, sorts them by the given expr and outputs them in order. It creates a temporary index and uses it to sort the stream.

func TempTreeSortReverse

func TempTreeSortReverse(e expr.Expr) *TempTreeSortOperator

TempTreeSortReverse does the same as TempTreeSort but in descending order.

func (*TempTreeSortOperator) Iterate

func (*TempTreeSortOperator) String

func (op *TempTreeSortOperator) String() string

Jump to

Keyboard shortcuts

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