dag

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PassOp = &Pass{Kind: "Pass"}
View Source
var Root = &Path{Kind: "Path", Name: []string{}}

Functions

func FanIn

func FanIn(op Op) int

func IsRoot

func IsRoot(e Expr) bool

func IsRootField

func IsRootField(e Expr) bool

func RootField

func RootField(e Expr) (string, bool)

func UnpackJSON

func UnpackJSON(buf []byte) (interface{}, error)

Types

type Agg

type Agg struct {
	Kind  string `json:"kind" unpack:""`
	Name  string `json:"name"`
	Expr  Expr   `json:"expr"`
	Where Expr   `json:"where"`
}

func (*Agg) ExprDAG

func (*Agg) ExprDAG()

type ArrayExpr

type ArrayExpr struct {
	Kind  string `json:"kind" unpack:""`
	Exprs []Expr `json:"exprs"`
}

func (*ArrayExpr) ExprDAG

func (*ArrayExpr) ExprDAG()

type Assignment

type Assignment struct {
	Kind string `json:"kind" unpack:""`
	LHS  Expr   `json:"lhs"`
	RHS  Expr   `json:"rhs"`
}

func (*Assignment) ExprDAG

func (*Assignment) ExprDAG()

type BinaryExpr

type BinaryExpr struct {
	Kind string `json:"kind" unpack:""`
	Op   string `json:"op"`
	LHS  Expr   `json:"lhs"`
	RHS  Expr   `json:"rhs"`
}

func (*BinaryExpr) ExprDAG

func (*BinaryExpr) ExprDAG()

type Call

type Call struct {
	Kind string `json:"kind" unpack:""`
	Name string `json:"name"`
	Args []Expr `json:"args"`
}

func (*Call) ExprDAG

func (*Call) ExprDAG()

type Case

type Case struct {
	Expr Expr `json:"expr"`
	Op   Op   `json:"op"`
}

type Cast

type Cast struct {
	Kind string      `json:"kind" unpack:""`
	Expr Expr        `json:"expr"`
	Type astzed.Type `json:"type"`
}

func (*Cast) ExprDAG

func (*Cast) ExprDAG()

type CommitMeta

type CommitMeta struct {
	Kind      string      `json:"kind" unpack:""`
	Pool      ksuid.KSUID `json:"pool"`
	Commit    ksuid.KSUID `json:"branch"`
	Meta      string      `json:"meta"`
	ScanLower Expr        `json:"scan_lower"`
	ScanUpper Expr        `json:"scan_upper"`
	ScanOrder string      `json:"scan_order"`
}

func (*CommitMeta) Source

func (*CommitMeta) Source()

type Conditional

type Conditional struct {
	Kind string `json:"kind" unpack:""`
	Cond Expr   `json:"cond"`
	Then Expr   `json:"then"`
	Else Expr   `json:"else"`
}

func (*Conditional) ExprDAG

func (*Conditional) ExprDAG()

type Const

type Const struct {
	Kind string `json:"kind" unpack:""`
	Name string `json:"name"`
	Expr Expr   `json:"expr"`
}

func (*Const) OpNode

func (*Const) OpNode()

type Cut

type Cut struct {
	Kind  string       `json:"kind" unpack:""`
	Args  []Assignment `json:"args"`
	Quiet bool         `json:"quiet"`
}

func (*Cut) OpNode

func (*Cut) OpNode()

type Dot

type Dot struct {
	Kind string `json:"kind" unpack:""`
	LHS  Expr   `json:"lhs"`
	RHS  string `json:"rhs"`
}

func (*Dot) ExprDAG

func (*Dot) ExprDAG()

type Drop

type Drop struct {
	Kind string `json:"kind" unpack:""`
	Args []Expr `json:"args"`
}

func (*Drop) OpNode

func (*Drop) OpNode()

type Entry

type Entry struct {
	Key   Expr `json:"key"`
	Value Expr `json:"value"`
}

type Explode

type Explode struct {
	Kind string      `json:"kind" unpack:""`
	Args []Expr      `json:"args"`
	Type astzed.Type `json:"type"`
	As   Expr        `json:"as"`
}

func (*Explode) OpNode

func (*Explode) OpNode()

type Expr

type Expr interface {
	ExprDAG()
}

func UnpackMapAsExpr

func UnpackMapAsExpr(m interface{}) (Expr, error)

type Field

type Field struct {
	Name  string `json:"name"`
	Value Expr   `json:"value"`
}

type File

type File struct {
	Kind   string       `json:"kind" unpack:""`
	Path   string       `json:"path"`
	Format string       `json:"format"`
	Layout order.Layout `json:"layout"`
}

func (*File) Source

func (*File) Source()

type Filter

type Filter struct {
	Kind string `json:"kind" unpack:""`
	Expr Expr   `json:"expr"`
}

func FilterToOp

func FilterToOp(e Expr) *Filter

func (*Filter) OpNode

func (*Filter) OpNode()

type From

type From struct {
	Kind   string  `json:"kind" unpack:""`
	Trunks []Trunk `json:"trunks"`
}

func (*From) OpNode

func (*From) OpNode()

type Fuse

type Fuse struct {
	Kind string `json:"kind" unpack:""`
}

func (*Fuse) OpNode

func (*Fuse) OpNode()

type HTTP

type HTTP struct {
	Kind   string       `json:"kind" unpack:""`
	URL    string       `json:"url"`
	Format string       `json:"format"`
	Layout order.Layout `json:"layout"`
}

func (*HTTP) Source

func (*HTTP) Source()
type Head struct {
	Kind  string `json:"kind" unpack:""`
	Count int    `json:"count"`
}

func (*Head) OpNode

func (*Head) OpNode()

type Join

type Join struct {
	Kind     string       `json:"kind" unpack:""`
	Style    string       `json:"style"`
	LeftKey  Expr         `json:"left_key"`
	RightKey Expr         `json:"right_key"`
	Args     []Assignment `json:"args"`
}

func (*Join) OpNode

func (*Join) OpNode()

type LakeMeta

type LakeMeta struct {
	Kind string `json:"kind" unpack:""`
	Meta string `json:"meta"`
}

func (*LakeMeta) Source

func (*LakeMeta) Source()

type MapExpr

type MapExpr struct {
	Kind    string  `json:"kind" unpack:""`
	Entries []Entry `json:"entries"`
}

func (*MapExpr) ExprDAG

func (*MapExpr) ExprDAG()

type Merge

type Merge struct {
	Kind  string      `json:"kind" unpack:""`
	Key   field.Path  `json:"key"`
	Order order.Which `json:"order"`
}

func (*Merge) OpNode

func (*Merge) OpNode()

type Method

type Method struct {
	Name string `json:"name"`
	Args []Expr `json:"args"`
}

type Op

type Op interface {
	OpNode()
}

func UnpackJSONAsOp

func UnpackJSONAsOp(buf []byte) (Op, error)

UnpackJSONAsOp transforms a JSON representation of an operator into an dag.Op.

func UnpackMapAsOp

func UnpackMapAsOp(m interface{}) (Op, error)

type Parallel

type Parallel struct {
	Kind string `json:"kind" unpack:""`
	Ops  []Op   `json:"ops"`
}

func (*Parallel) OpNode

func (*Parallel) OpNode()

type Pass

type Pass struct {
	Kind string `json:"kind" unpack:""`
}

func (*Pass) OpNode

func (*Pass) OpNode()

func (*Pass) Source

func (*Pass) Source()

type Path

type Path struct {
	Kind string   `json:"kind" unpack:""`
	Name []string `json:"name"`
}

func (*Path) ExprDAG

func (*Path) ExprDAG()

func (*Path) String

func (p *Path) String() string

type Pick

type Pick struct {
	Kind string       `json:"kind" unpack:""`
	Args []Assignment `json:"args"`
}

func (*Pick) OpNode

func (*Pick) OpNode()

type Pool

type Pool struct {
	Kind      string      `json:"kind" unpack:""`
	ID        ksuid.KSUID `json:"id"`
	Commit    ksuid.KSUID `json:"commit"`
	ScanLower Expr        `json:"scan_lower"`
	ScanUpper Expr        `json:"scan_upper"`
	ScanOrder string      `json:"scan_order"`
}

func (*Pool) Source

func (*Pool) Source()

type PoolMeta

type PoolMeta struct {
	Kind string      `json:"kind" unpack:""`
	ID   ksuid.KSUID `json:"id"`
	Meta string      `json:"meta"`
}

func (*PoolMeta) Source

func (*PoolMeta) Source()

type Pushdown added in v0.32.0

type Pushdown struct {
	Scan  Op      `json:"scan"`
	Index *Filter `json:"index"`
}

type Put

type Put struct {
	Kind string       `json:"kind" unpack:""`
	Args []Assignment `json:"args"`
}

func (*Put) OpNode

func (*Put) OpNode()

type RecordExpr

type RecordExpr struct {
	Kind   string  `json:"kind" unpack:""`
	Fields []Field `json:"fields"`
}

func (*RecordExpr) ExprDAG

func (*RecordExpr) ExprDAG()

type Ref

type Ref struct {
	Kind string `json:"kind" unpack:""`
	Name string `json:"name"`
}

func (*Ref) ExprDAG

func (*Ref) ExprDAG()

type RegexpMatch

type RegexpMatch struct {
	Kind    string `json:"kind" unpack:""`
	Pattern string `json:"pattern"`
	Expr    Expr   `json:"expr"`
}

func (*RegexpMatch) ExprDAG

func (*RegexpMatch) ExprDAG()

type RegexpSearch

type RegexpSearch struct {
	Kind    string `json:"kind" unpack:""`
	Pattern string `json:"pattern"`
}

func (*RegexpSearch) ExprDAG

func (*RegexpSearch) ExprDAG()

type Rename

type Rename struct {
	Kind string       `json:"kind" unpack:""`
	Args []Assignment `json:"args"`
}

func (*Rename) OpNode

func (*Rename) OpNode()
type Search struct {
	Kind  string           `json:"kind" unpack:""`
	Text  string           `json:"text"`
	Value astzed.Primitive `json:"value"` //XXX search should be extended to complex types
}

func (*Search) ExprDAG

func (*Search) ExprDAG()

type SelectExpr

type SelectExpr struct {
	Kind      string `json:"kind" unpack:""`
	Selectors []Expr `json:"selectors"`
	Methods   []Call `json:"methods"`
}

func (*SelectExpr) ExprDAG

func (*SelectExpr) ExprDAG()

type SeqExpr

type SeqExpr struct {
	Kind      string   `json:"kind" unpack:""`
	Name      string   `json:"name"`
	Selectors []Expr   `json:"selectors"`
	Methods   []Method `json:"methods"`
}

func (*SeqExpr) ExprDAG

func (*SeqExpr) ExprDAG()

type Sequential

type Sequential struct {
	Kind string `json:"kind" unpack:""`
	Ops  []Op   `json:"ops"`
}

func (*Sequential) Append

func (seq *Sequential) Append(op Op)

func (*Sequential) Delete

func (seq *Sequential) Delete(at, length int)

func (*Sequential) IsEntry

func (seq *Sequential) IsEntry() bool

func (*Sequential) OpNode

func (*Sequential) OpNode()

func (*Sequential) Prepend

func (seq *Sequential) Prepend(front Op)

type SetExpr

type SetExpr struct {
	Kind  string `json:"kind" unpack:""`
	Exprs []Expr `json:"exprs"`
}

func (*SetExpr) ExprDAG

func (*SetExpr) ExprDAG()

type Shape

type Shape struct {
	Kind string `json:"kind" unpack:""`
}

func (*Shape) OpNode

func (*Shape) OpNode()

type Sort

type Sort struct {
	Kind       string      `json:"kind" unpack:""`
	Args       []Expr      `json:"args"`
	Order      order.Which `json:"order"`
	NullsFirst bool        `json:"nullsfirst"`
}

func (*Sort) OpNode

func (*Sort) OpNode()

type Source

type Source interface {
	Source()
}

type Summarize

type Summarize struct {
	Kind         string            `json:"kind" unpack:""`
	Duration     *astzed.Primitive `json:"duration"`
	Limit        int               `json:"limit"`
	Keys         []Assignment      `json:"keys"`
	Aggs         []Assignment      `json:"aggs"`
	InputSortDir int               `json:"input_sort_dir,omitempty"`
	PartialsIn   bool              `json:"partials_in,omitempty"`
	PartialsOut  bool              `json:"partials_out,omitempty"`
}

func (*Summarize) OpNode

func (*Summarize) OpNode()

type Switch

type Switch struct {
	Kind  string `json:"kind" unpack:""`
	Expr  Expr   `json:"expr"`
	Cases []Case `json:"cases"`
}

func (*Switch) OpNode

func (*Switch) OpNode()

type Tail

type Tail struct {
	Kind  string `json:"kind" unpack:""`
	Count int    `json:"count"`
}

func (*Tail) OpNode

func (*Tail) OpNode()

type Top

type Top struct {
	Kind  string `json:"kind" unpack:""`
	Limit int    `json:"limit"`
	Args  []Expr `json:"args"`
	Flush bool   `json:"flush"`
}

func (*Top) OpNode

func (*Top) OpNode()

type Trunk

type Trunk struct {
	Kind     string      `json:"kind" unpack:""`
	Source   Source      `json:"source"`
	Seq      *Sequential `json:"seq"`
	Pushdown Pushdown    `json:"pushdown"`
}

A Trunk is the path into a DAG for any input source. It contains the source to scan as well as the sequential operators to apply to the scan before being joined, merged, or output. A DAG can be just one Trunk or an assembly of different Trunks mixed in using the From Op. The Trunk is the one place where the optimizer places pushed down predicates so the runtime can move the pushed down operators into each scan scheduler for each source when the runtime is built. When computation is distribtued over the network, the optimized pushdown is naturally carried in the serialized DAG via each Trunk.

type TypeProc

type TypeProc struct {
	Kind string      `json:"kind" unpack:""`
	Name string      `json:"name"`
	Type astzed.Type `json:"type"`
}

func (*TypeProc) OpNode

func (*TypeProc) OpNode()

type UnaryExpr

type UnaryExpr struct {
	Kind    string `json:"kind" unpack:""`
	Op      string `json:"op"`
	Operand Expr   `json:"operand"`
}

func (*UnaryExpr) ExprDAG

func (*UnaryExpr) ExprDAG()

type Uniq

type Uniq struct {
	Kind  string `json:"kind" unpack:""`
	Cflag bool   `json:"cflag"`
}

func (*Uniq) OpNode

func (*Uniq) OpNode()

Jump to

Keyboard shortcuts

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