dag

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PassOp = &Pass{Kind: "Pass"}

Functions

func FanIn

func FanIn(op Op) int

func IsThis added in v1.0.0

func IsThis(e Expr) bool

func IsTopLevelField added in v1.0.0

func IsTopLevelField(e Expr) bool

func TopLevelField added in v1.0.0

func TopLevelField(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:""`
	Elems []VectorElem `json:"elems"`
}

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 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 Cut

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

func (*Cut) OpNode

func (*Cut) OpNode()

type Def added in v1.0.0

type Def struct {
	Name string `json:"name"`
	Expr Expr   `json:"expr"`
}

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 string `json:"type"`
	As   Expr   `json:"as"`
}

func (*Explode) OpNode

func (*Explode) OpNode()

type Expr

type Expr interface {
	ExprDAG()
}

type Field

type Field struct {
	Kind  string `json:"kind" unpack:""`
	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 Let added in v1.0.0

type Let struct {
	Kind string `json:"kind" unpack:""`
	Defs []Def  `json:"defs"`
	Over *Over  `json:"over"`
}

func (*Let) OpNode added in v1.0.0

func (*Let) OpNode()

type Literal added in v1.0.0

type Literal struct {
	Kind  string `json:"kind" unpack:""`
	Value string `json:"value"`
}

func (*Literal) ExprDAG added in v1.0.0

func (*Literal) ExprDAG()

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:""`
	Expr  Expr        `json:"expr"`
	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 Over added in v1.0.0

type Over struct {
	Kind  string      `json:"kind" unpack:""`
	Exprs []Expr      `json:"exprs"`
	Scope *Sequential `json:"scope"`
}

func (*Over) OpNode added in v1.0.0

func (*Over) OpNode()

type OverExpr added in v1.1.0

type OverExpr struct {
	Kind  string      `json:"kind" unpack:""`
	Defs  []Def       `json:"defs"`
	Exprs []Expr      `json:"exprs"`
	Scope *Sequential `json:"scope"`
}

func (*OverExpr) ExprDAG added in v1.1.0

func (*OverExpr) ExprDAG()

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 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 Put

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

func (*Put) OpNode

func (*Put) OpNode()

type RecordElem added in v1.0.0

type RecordElem interface {
	// contains filtered or unexported methods
}

type RecordExpr

type RecordExpr struct {
	Kind  string       `json:"kind" unpack:""`
	Elems []RecordElem `json:"elems"`
}

func (*RecordExpr) ExprDAG

func (*RecordExpr) 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"`
	Expr    Expr   `json:"expr"`
}

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 string `json:"value"`
	Expr  Expr   `json:"expr"`
}

func (*Search) ExprDAG

func (*Search) ExprDAG()

type Sequential

type Sequential struct {
	Kind   string `json:"kind" unpack:""`
	Consts []Def  `json:"consts"`
	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:""`
	Elems []VectorElem `json:"elems"`
}

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 Spread added in v1.0.0

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

type Summarize

type Summarize struct {
	Kind         string       `json:"kind" unpack:""`
	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 This added in v1.0.0

type This struct {
	Kind string   `json:"kind" unpack:""`
	Path []string `json:"path"`
}

func (*This) ExprDAG added in v1.0.0

func (*This) ExprDAG()

func (*This) String added in v1.0.0

func (t *This) String() string

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 Op          `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 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()

type Var added in v1.0.0

type Var struct {
	Kind string `json:"kind" unpack:""`
	Name string `json:"name"`
	Slot int    `json:"slot"`
}

func (*Var) ExprDAG added in v1.0.0

func (*Var) ExprDAG()

type VectorElem added in v1.2.0

type VectorElem interface {
	// contains filtered or unexported methods
}

type VectorValue added in v1.2.0

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

type Yield added in v1.0.0

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

func (*Yield) OpNode added in v1.0.0

func (*Yield) OpNode()

Jump to

Keyboard shortcuts

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