engine

package
v0.0.0-...-ca2a57d Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFunctionRepository = substrait.NewFunctionRepository()
View Source
var (
	ErrUnboundTable = errors.New("engine: attempted to determine schema of table that has not been bound to a catalog yet")
)

Functions

func FormatPlan

func FormatPlan(plan *Plan) (string, error)

func FormatPlanProto

func FormatPlanProto(plan *proto.Plan) (string, error)

func NewAnonymousCatalog

func NewAnonymousCatalog(schema *bonobo.Schema) *anonymousCatalog

func NewNamedTable

func NewNamedTable(identifier Identifier, catalog Catalog) *namedTable

func NewVirtualTable

func NewVirtualTable(rec arrow.Record) *virtualTable

func SetCatalogForPlan

func SetCatalogForPlan(plan *Plan, catalog Catalog)

func SetCatalogForRelation

func SetCatalogForRelation(plan Relation, catalog Catalog)

func SetCatalogForTable

func SetCatalogForTable(table Table, catalog Catalog)

Types

type Alias

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

func NewAliasExpr

func NewAliasExpr(expr Expr, name string) *Alias

func (*Alias) Field

func (expr *Alias) Field(input Relation) (bonobo.Field, error)

Field implements Expr.

func (*Alias) String

func (expr *Alias) String() string

String implements Expr.

func (*Alias) ToProto

func (expr *Alias) ToProto(input Relation, extensions *substrait.ExtensionRegistry) (*proto.Expression, error)

ToProto implements Expr.

type Catalog

type Catalog interface {
	Schema(identifier Identifier) (*bonobo.Schema, error)
}

type Column

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

func NewColumnExpr

func NewColumnExpr(name string) *Column

func (*Column) Field

func (expr *Column) Field(input Relation) (bonobo.Field, error)

func (*Column) String

func (expr *Column) String() string

func (*Column) ToProto

func (expr *Column) ToProto(input Relation, extensions *substrait.ExtensionRegistry) (*proto.Expression, error)

type ColumnIndex

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

func NewColumnIndexExpr

func NewColumnIndexExpr(index int) *ColumnIndex

func (*ColumnIndex) Field

func (expr *ColumnIndex) Field(input Relation) (bonobo.Field, error)

func (*ColumnIndex) String

func (expr *ColumnIndex) String() string

func (*ColumnIndex) ToProto

func (expr *ColumnIndex) ToProto(input Relation, extensions *substrait.ExtensionRegistry) (*proto.Expression, error)

type Expr

type Expr interface {
	fmt.Stringer
	ToProto(input Relation, extensions *substrait.ExtensionRegistry) (*proto.Expression, error)

	Field(input Relation) (bonobo.Field, error)
}

type ExprList

type ExprList []Expr

func (ExprList) String

func (exprs ExprList) String() string

type Function

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

TODO: SetFunctionRepository

func NewAddFunctionExpr

func NewAddFunctionExpr(left, right Expr) *Function

func NewAnonymousFunction

func NewAnonymousFunction(uri, signature string, output bonobo.Type, args ...Expr) (*Function, error)

func NewFunctionExpr

func NewFunctionExpr(uri, name string, args ...Expr) *Function

func (*Function) Field

func (f *Function) Field(input Relation) (bonobo.Field, error)

Field implements Expr.

func (*Function) String

func (f *Function) String() string

String implements Expr.

func (*Function) ToProto

func (f *Function) ToProto(input Relation, extensions *substrait.ExtensionRegistry) (*proto.Expression, error)

TODO: Consolidate with Field()? ToProto implements Expr.

type Identifier

type Identifier = []string

type Literal

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

func NewLiteralExpr

func NewLiteralExpr(val any) *Literal

func (*Literal) Field

func (expr *Literal) Field(input Relation) (bonobo.Field, error)

func (*Literal) Name

func (expr *Literal) Name() string

func (*Literal) String

func (expr *Literal) String() string

func (*Literal) ToProto

func (expr *Literal) ToProto(input Relation, extensions *substrait.ExtensionRegistry) (*proto.Expression, error)

type NamedTable

type NamedTable interface {
	Table

	Identifier() Identifier
	SetCatalog(catalog Catalog)
}

type Plan

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

func FromProto

func FromProto(plan *proto.Plan) (*Plan, error)

func NewPlan

func NewPlan(root Relation, rels ...Relation) *Plan

func (*Plan) Relations

func (p *Plan) Relations() []Relation

func (*Plan) ToProto

func (p *Plan) ToProto() (*proto.Plan, error)

type Projection

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

func NewProjectionOperation

func NewProjectionOperation(input Relation, exprs []Expr) *Projection

func (*Projection) Children

func (p *Projection) Children() []Relation

func (*Projection) Schema

func (p *Projection) Schema() (*bonobo.Schema, error)

func (*Projection) String

func (p *Projection) String() string

String implements Plan.

func (*Projection) ToProto

func (p *Projection) ToProto(extensions *substrait.ExtensionRegistry) (*proto.Rel, error)

ToProto implements Plan.

type Read

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

func NewReadOperation

func NewReadOperation(table Table) *Read

func (*Read) Children

func (*Read) Children() []Relation

func (*Read) Schema

func (r *Read) Schema() (*bonobo.Schema, error)

func (*Read) String

func (r *Read) String() string

func (*Read) ToProto

func (r *Read) ToProto(extensions *substrait.ExtensionRegistry) (*proto.Rel, error)

type Relation

type Relation interface {
	fmt.Stringer
	ToProto(extensions *substrait.ExtensionRegistry) (*proto.Rel, error)

	Schema() (*bonobo.Schema, error)
	Children() []Relation
}

type Selection

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

func NewSelectionOperation

func NewSelectionOperation(input Relation, expr Expr) *Selection

func (*Selection) Child

func (s *Selection) Child() Relation

func (*Selection) Children

func (s *Selection) Children() []Relation

func (*Selection) Schema

func (s *Selection) Schema() (*bonobo.Schema, error)

func (*Selection) String

func (s *Selection) String() string

func (*Selection) ToProto

func (s *Selection) ToProto(extensions *substrait.ExtensionRegistry) (*proto.Rel, error)

type Table

type Table interface {
	Schema() (*bonobo.Schema, error)
	ToProto(extensions *substrait.ExtensionRegistry) (*proto.Rel, error)
}

Jump to

Keyboard shortcuts

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