plan

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	JoinTypeUnspecified = proto.JoinRel_JOIN_TYPE_UNSPECIFIED
	JoinTypeInner       = proto.JoinRel_JOIN_TYPE_INNER
	JoinTypeOuter       = proto.JoinRel_JOIN_TYPE_OUTER
	JoinTypeLeft        = proto.JoinRel_JOIN_TYPE_LEFT
	JoinTypeRight       = proto.JoinRel_JOIN_TYPE_RIGHT
	JoinTypeSemi        = proto.JoinRel_JOIN_TYPE_SEMI
	JoinTypeAnti        = proto.JoinRel_JOIN_TYPE_ANTI
	JoinTypeSingle      = proto.JoinRel_JOIN_TYPE_SINGLE
)
View Source
const (
	SetOpUnspecified          = proto.SetRel_SET_OP_UNSPECIFIED
	SetOpMinusPrimary         = proto.SetRel_SET_OP_MINUS_PRIMARY
	SetOpMinusMultiset        = proto.SetRel_SET_OP_MINUS_MULTISET
	SetOpIntersectionPrimary  = proto.SetRel_SET_OP_INTERSECTION_PRIMARY
	SetOpIntersectionMultiset = proto.SetRel_SET_OP_INTERSECTION_MULTISET
	SetOpUnionDistinct        = proto.SetRel_SET_OP_UNION_DISTINCT
	SetOpUnionAll             = proto.SetRel_SET_OP_UNION_ALL
)

Variables

View Source
var CurrentVersion = types.Version{
	MajorNumber: 0,
	MinorNumber: 29,
	PatchNumber: 0,
	Producer:    "substrait-go",
}

Functions

This section is empty.

Types

type AdvancedExtension added in v0.4.0

type AdvancedExtension interface {
	GetEnhancement() *anypb.Any
	GetOptimization() *anypb.Any
}

type AggRelMeasure added in v0.4.0

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

func (*AggRelMeasure) Filter added in v0.4.0

func (am *AggRelMeasure) Filter() expr.Expression

func (*AggRelMeasure) Measure added in v0.4.0

func (am *AggRelMeasure) Measure() *expr.AggregateFunction

func (*AggRelMeasure) ToProto added in v0.4.0

func (am *AggRelMeasure) ToProto() *proto.AggregateRel_Measure

type AggregateRel added in v0.4.0

type AggregateRel struct {
	RelCommon
	// contains filtered or unexported fields
}

AggregateRel is a relational operator representing a GROUP BY aggregate.

func (*AggregateRel) GetAdvancedExtension added in v0.4.0

func (ar *AggregateRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*AggregateRel) Groupings added in v0.4.0

func (ar *AggregateRel) Groupings() [][]expr.Expression

Groupings is a list of expression groupings that the aggregation measures should be calculated for.

func (*AggregateRel) Input added in v0.4.0

func (ar *AggregateRel) Input() Rel

func (*AggregateRel) Measures added in v0.4.0

func (ar *AggregateRel) Measures() []AggRelMeasure

func (*AggregateRel) RecordType added in v0.4.0

func (ar *AggregateRel) RecordType() types.StructType

func (*AggregateRel) ToProto added in v0.4.0

func (ar *AggregateRel) ToProto() *proto.Rel

func (*AggregateRel) ToProtoPlanRel added in v0.4.0

func (ar *AggregateRel) ToProtoPlanRel() *proto.PlanRel

type ArrowReadOptions added in v0.4.0

type BiRel added in v0.4.0

type BiRel interface {
	Rel

	Left() Rel
	Right() Rel
}

BiRel is a convenience interface representing any relation that takes exactly two input relations such as joins.

type Builder added in v0.4.0

type Builder interface {
	// GetFunctionRef retrieves the function anchor reference for a given
	// function identified by its namespace and function name. This also
	// ensures that any plans built from this builder will contain this
	// function anchor in its extensions section.
	GetFunctionRef(nameSpace, key string) types.FunctionRef

	// Construct a user-defined type from the extension namespace and typename,
	// along with optional type parameters. It will add the type to the internal
	// extension set if it doesn't already exist and assign it a type reference.
	UserDefinedType(nameSpace, typeName string, params ...types.TypeParam) types.UserDefinedType
	// RootFieldRef constructs a Root Field Reference to the column of the input
	// relation indicated by the passed in index. This will ensure the output
	// type is properly propagated based on the reference.
	//
	// Will return an error if the index is < 0 or > the number of output fields.
	RootFieldRef(input Rel, index int32) (*expr.FieldReference, error)
	// JoinedRecordFieldRef constructs a root field reference for the full tuple of
	// the inputs to a join, to construct an expression that is viable to use as
	// the condition or post join filter for a join relation.
	JoinedRecordFieldRef(left, right Rel, index int32) (*expr.FieldReference, error)
	// ScalarFn constructs a ScalarFunction from the passed in namespace and
	// function name key. This is equivalent to calling expr.NewScalarFunc using
	// the builder's extension registry. An error will be returned if the indicated
	// function was not already in the extension collection the builder was created
	// with or if the arguments of the function don't match the provided argument
	// types.
	ScalarFn(nameSpace, key string, opts []*types.FunctionOption, args ...types.FuncArg) (*expr.ScalarFunction, error)
	// AggregateFn constructs an AggregateFunction from the passed in namespace and
	// function name key. This is equivalent to calling expr.NewAggregateFunc using
	// the builder's extension registry. An error will be returned if the indicated
	// function was not already in the extension collection the builder was created
	// with or if the arguments of the function don't match the provided argument
	// types.
	AggregateFn(nameSpace, key string, opts []*types.FunctionOption, args ...types.FuncArg) (*expr.AggregateFunction, error)
	// SortFields is a convenience method to construct a list of sort fields
	// from the column indices of an existing relation. This will return an error
	// if any of the indices are < 0 or > the number of columns in the output
	// of the relation. This will use types.SortAscNullsLast as the sort kind
	// for each field in the returned slice.
	SortFields(input Rel, indices ...int32) ([]expr.SortField, error)
	// Measure is a convenience method to construct the input for an Aggregate Rel
	// Consisting of the provided aggregate function and optional filter expression.
	Measure(measure *expr.AggregateFunction, filter expr.Expression) AggRelMeasure

	Project(input Rel, exprs ...expr.Expression) (*ProjectRel, error)
	ProjectRemap(input Rel, remap []int32, exprs ...expr.Expression) (*ProjectRel, error)
	AggregateColumnsRemap(input Rel, remap []int32, measures []AggRelMeasure, groupByCols ...int32) (*AggregateRel, error)
	AggregateColumns(input Rel, measures []AggRelMeasure, groupByCols ...int32) (*AggregateRel, error)
	AggregateExprsRemap(input Rel, remap []int32, measures []AggRelMeasure, groups ...[]expr.Expression) (*AggregateRel, error)
	AggregateExprs(input Rel, measures []AggRelMeasure, groups ...[]expr.Expression) (*AggregateRel, error)
	CrossRemap(left, right Rel, remap []int32) (*CrossRel, error)
	Cross(left, right Rel) (*CrossRel, error)
	FetchRemap(input Rel, offset, count uint64, remap []int32) (*FetchRel, error)
	Fetch(input Rel, offset, count uint64) (*FetchRel, error)
	FilterRemap(input Rel, condition expr.Expression, remap []int32) (*FilterRel, error)
	Filter(input Rel, condition expr.Expression) (*FilterRel, error)
	JoinAndFilterRemap(left, right Rel, condition, postJoinFilter expr.Expression, joinType JoinType, remap []int32) (*JoinRel, error)
	JoinAndFilter(left, right Rel, condition, postJoinFilter expr.Expression, joinType JoinType) (*JoinRel, error)
	JoinRemap(left, right Rel, condition expr.Expression, joinType JoinType, remap []int32) (*JoinRel, error)
	Join(left, right Rel, condition expr.Expression, joinType JoinType) (*JoinRel, error)
	NamedScanRemap(tableName []string, schema types.NamedStruct, remap []int32) (*NamedTableReadRel, error)
	NamedScan(tableName []string, schema types.NamedStruct) *NamedTableReadRel
	VirtualTableRemap(fields []string, remap []int32, values ...expr.StructLiteralValue) (*VirtualTableReadRel, error)
	VirtualTable(fields []string, values ...expr.StructLiteralValue) (*VirtualTableReadRel, error)
	SortRemap(input Rel, remap []int32, sorts ...expr.SortField) (*SortRel, error)
	Sort(input Rel, sorts ...expr.SortField) (*SortRel, error)
	SetRemap(op SetOp, remap []int32, inputs ...Rel) (*SetRel, error)
	Set(op SetOp, inputs ...Rel) (*SetRel, error)

	// Plan constructs a new plan with the provided root relation and optionally
	// other relations. It will use the current substrait version of this
	// library as the plan substrait version.
	Plan(root Rel, rootNames []string, others ...Rel) (*Plan, error)
	// PlanWithTypes is the same as Plan, only it provides the ability to set
	// the list of expectedTypeURLs that indicate the different protobuf types
	// that may be in use with this plan for advanced extensions, optimizations,
	// and so on.
	PlanWithTypes(root Rel, rootNames []string, expectedTypeURLs []string, others ...Rel) (*Plan, error)
}

Builder is the base object for constructing the various elements of a plan. The intent is to create a single builder and then utilize it for all necessary constructions while building a full plan.

Any extensions that are referenced for functions or user defined types, etc. will be added to the internal extension set so that the final Plan when constructed will have the appropriate extension anchors and definitions. This will maintain consistency across the plan for the user without them having to manually do so.

func NewBuilder added in v0.4.0

func NewBuilder(c *extensions.Collection) Builder

func NewBuilderDefault added in v0.4.0

func NewBuilderDefault() Builder

type CrossRel added in v0.4.0

type CrossRel struct {
	RelCommon
	// contains filtered or unexported fields
}

CrossRel is a cartesian product relational operator of two tables.

func (*CrossRel) GetAdvancedExtension added in v0.4.0

func (c *CrossRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*CrossRel) Left added in v0.4.0

func (c *CrossRel) Left() Rel

func (*CrossRel) RecordType added in v0.4.0

func (c *CrossRel) RecordType() types.StructType

func (*CrossRel) Right added in v0.4.0

func (c *CrossRel) Right() Rel

func (*CrossRel) ToProto added in v0.4.0

func (c *CrossRel) ToProto() *proto.Rel

func (*CrossRel) ToProtoPlanRel added in v0.4.0

func (c *CrossRel) ToProtoPlanRel() *proto.PlanRel

type DwrfReadOptions added in v0.4.0

type ExtensionLeafRel added in v0.4.0

type ExtensionLeafRel struct {
	RelCommon
	// contains filtered or unexported fields
}

ExtensionLeafRel is a stub to support extensions with zero inputs.

func (*ExtensionLeafRel) Detail added in v0.4.0

func (el *ExtensionLeafRel) Detail() *anypb.Any

func (*ExtensionLeafRel) RecordType added in v0.4.0

func (el *ExtensionLeafRel) RecordType() types.StructType

func (*ExtensionLeafRel) ToProto added in v0.4.0

func (el *ExtensionLeafRel) ToProto() *proto.Rel

func (*ExtensionLeafRel) ToProtoPlanRel added in v0.4.0

func (el *ExtensionLeafRel) ToProtoPlanRel() *proto.PlanRel

type ExtensionMultiRel added in v0.4.0

type ExtensionMultiRel struct {
	RelCommon
	// contains filtered or unexported fields
}

ExtensionMultiRel is a stub to support extensions with multiple inputs.

func (*ExtensionMultiRel) Detail added in v0.4.0

func (em *ExtensionMultiRel) Detail() *anypb.Any

func (*ExtensionMultiRel) Inputs added in v0.4.0

func (em *ExtensionMultiRel) Inputs() []Rel

func (*ExtensionMultiRel) RecordType added in v0.4.0

func (em *ExtensionMultiRel) RecordType() types.StructType

func (*ExtensionMultiRel) ToProto added in v0.4.0

func (em *ExtensionMultiRel) ToProto() *proto.Rel

func (*ExtensionMultiRel) ToProtoPlanRel added in v0.4.0

func (em *ExtensionMultiRel) ToProtoPlanRel() *proto.PlanRel

type ExtensionReadOptions added in v0.4.0

type ExtensionReadOptions anypb.Any

type ExtensionSingleRel added in v0.4.0

type ExtensionSingleRel struct {
	RelCommon
	// contains filtered or unexported fields
}

ExtensionSingleRel is a stub to support extensions with a single input.

func (*ExtensionSingleRel) Detail added in v0.4.0

func (es *ExtensionSingleRel) Detail() *anypb.Any

func (*ExtensionSingleRel) Input added in v0.4.0

func (es *ExtensionSingleRel) Input() Rel

func (*ExtensionSingleRel) RecordType added in v0.4.0

func (es *ExtensionSingleRel) RecordType() types.StructType

func (*ExtensionSingleRel) ToProto added in v0.4.0

func (es *ExtensionSingleRel) ToProto() *proto.Rel

func (*ExtensionSingleRel) ToProtoPlanRel added in v0.4.0

func (es *ExtensionSingleRel) ToProtoPlanRel() *proto.PlanRel

type ExtensionTableReadRel added in v0.4.0

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

ExtensionTableReadRel is a stub type that can be used to extend and introduce new table types outside the specification by utilizing protobuf Any type.

func (*ExtensionTableReadRel) BaseSchema added in v0.4.0

func (b *ExtensionTableReadRel) BaseSchema() types.NamedStruct

func (*ExtensionTableReadRel) BestEffortFilter added in v0.4.0

func (b *ExtensionTableReadRel) BestEffortFilter() expr.Expression

func (*ExtensionTableReadRel) Detail added in v0.4.0

func (e *ExtensionTableReadRel) Detail() *anypb.Any

func (*ExtensionTableReadRel) Filter added in v0.4.0

func (b *ExtensionTableReadRel) Filter() expr.Expression

func (*ExtensionTableReadRel) GetAdvancedExtension added in v0.4.0

func (b *ExtensionTableReadRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*ExtensionTableReadRel) Projection added in v0.4.0

func (b *ExtensionTableReadRel) Projection() *expr.MaskExpression

func (*ExtensionTableReadRel) RecordType added in v0.4.0

func (b *ExtensionTableReadRel) RecordType() types.StructType

func (*ExtensionTableReadRel) ToProto added in v0.4.0

func (e *ExtensionTableReadRel) ToProto() *proto.Rel

func (*ExtensionTableReadRel) ToProtoPlanRel added in v0.4.0

func (e *ExtensionTableReadRel) ToProtoPlanRel() *proto.PlanRel

type FetchRel added in v0.4.0

type FetchRel struct {
	RelCommon
	// contains filtered or unexported fields
}

FetchRel is a relational operator representing LIMIT/OFFSET or TOP type semantics.

func (*FetchRel) Count added in v0.4.0

func (f *FetchRel) Count() int64

func (*FetchRel) GetAdvancedExtension added in v0.4.0

func (f *FetchRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*FetchRel) Input added in v0.4.0

func (f *FetchRel) Input() Rel

func (*FetchRel) Offset added in v0.4.0

func (f *FetchRel) Offset() int64

func (*FetchRel) RecordType added in v0.4.0

func (f *FetchRel) RecordType() types.StructType

func (*FetchRel) ToProto added in v0.4.0

func (f *FetchRel) ToProto() *proto.Rel

func (*FetchRel) ToProtoPlanRel added in v0.4.0

func (f *FetchRel) ToProtoPlanRel() *proto.PlanRel

type FileFormat added in v0.4.0

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

type FileOrFiles added in v0.4.0

type FileOrFiles struct {
	PathType PathType
	Path     string
	// PartIndex is the index of the partition that this item belongs to
	PartIndex uint64
	// Start and Len are the start position and length of bytes to
	// read from this item.
	Start, Len uint64

	Format FileFormat
}

FileOrFiles represents the contents of a LocalFiles table. Many files consist of indivisible chunks (e.g. parquet row groups or CSV rows). If a slice partially selects an indivisible chunk then the consumer should employ some rule to decide which slice to include the chunk in. (e.g. include it in the slice that contains the midpoint of the chunk).

func (*FileOrFiles) ToProto added in v0.4.0

type FilterRel added in v0.4.0

type FilterRel struct {
	RelCommon
	// contains filtered or unexported fields
}

FilterRel is a relational operator capturing simple filters ( as in the WHERE clause of a SQL query).

func (*FilterRel) Condition added in v0.4.0

func (fr *FilterRel) Condition() expr.Expression

func (*FilterRel) GetAdvancedExtension added in v0.4.0

func (fr *FilterRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*FilterRel) Input added in v0.4.0

func (fr *FilterRel) Input() Rel

func (*FilterRel) RecordType added in v0.4.0

func (fr *FilterRel) RecordType() types.StructType

func (*FilterRel) ToProto added in v0.4.0

func (fr *FilterRel) ToProto() *proto.Rel

func (*FilterRel) ToProtoPlanRel added in v0.4.0

func (fr *FilterRel) ToProtoPlanRel() *proto.PlanRel

type HashJoinRel added in v0.4.0

type HashJoinRel struct {
	RelCommon
	// contains filtered or unexported fields
}

HashJoinRel represents a relational operator to build a hash table out of the right input based on a set of join keys. It will then probe the hash table for incoming inputs, finding matches.

func (*HashJoinRel) GetAdvancedExtension added in v0.4.0

func (hr *HashJoinRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*HashJoinRel) Left added in v0.4.0

func (hr *HashJoinRel) Left() Rel

func (*HashJoinRel) LeftKeys added in v0.4.0

func (hr *HashJoinRel) LeftKeys() []*expr.FieldReference

func (*HashJoinRel) PostJoinFilter added in v0.4.0

func (hr *HashJoinRel) PostJoinFilter() expr.Expression

func (*HashJoinRel) RecordType added in v0.4.0

func (hr *HashJoinRel) RecordType() types.StructType

func (*HashJoinRel) Right added in v0.4.0

func (hr *HashJoinRel) Right() Rel

func (*HashJoinRel) RightKeys added in v0.4.0

func (hr *HashJoinRel) RightKeys() []*expr.FieldReference

func (*HashJoinRel) ToProto added in v0.4.0

func (hr *HashJoinRel) ToProto() *proto.Rel

func (*HashJoinRel) ToProtoPlanRel added in v0.4.0

func (hr *HashJoinRel) ToProtoPlanRel() *proto.PlanRel

func (*HashJoinRel) Type added in v0.4.0

func (hr *HashJoinRel) Type() HashMergeJoinType

type HashMergeJoinType added in v0.4.0

type HashMergeJoinType int8
const (
	HashMergeUnspecified HashMergeJoinType = iota
	HashMergeInner
	HashMergeOuter
	HashMergeLeft
	HashMergeRight
	HashMergeLeftSemi
	HashMergeRightSemi
	HashMergeLeftAnti
	HashMergeRightAnti
)

type Hint added in v0.4.0

type Hint = proto.RelCommon_Hint

type JoinRel added in v0.4.0

type JoinRel struct {
	RelCommon
	// contains filtered or unexported fields
}

JoinRel is a binary Join relational operator representing left-join-right, including various join types, a join condition and a post join filter expr.

func (*JoinRel) Expr added in v0.4.0

func (j *JoinRel) Expr() expr.Expression

func (*JoinRel) GetAdvancedExtension added in v0.4.0

func (j *JoinRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*JoinRel) JoinedRecordType added in v0.4.0

func (j *JoinRel) JoinedRecordType() types.StructType

func (*JoinRel) Left added in v0.4.0

func (j *JoinRel) Left() Rel

func (*JoinRel) PostJoinFilter added in v0.4.0

func (j *JoinRel) PostJoinFilter() expr.Expression

func (*JoinRel) RecordType added in v0.4.0

func (j *JoinRel) RecordType() types.StructType

func (*JoinRel) Right added in v0.4.0

func (j *JoinRel) Right() Rel

func (*JoinRel) ToProto added in v0.4.0

func (j *JoinRel) ToProto() *proto.Rel

func (*JoinRel) ToProtoPlanRel added in v0.4.0

func (j *JoinRel) ToProtoPlanRel() *proto.PlanRel

func (*JoinRel) Type added in v0.4.0

func (j *JoinRel) Type() JoinType

type JoinType added in v0.4.0

type JoinType = proto.JoinRel_JoinType

type LocalFileReadRel added in v0.4.0

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

LocalFileReadRel represents a list of files in input of a scan operation.

func (*LocalFileReadRel) BaseSchema added in v0.4.0

func (b *LocalFileReadRel) BaseSchema() types.NamedStruct

func (*LocalFileReadRel) BestEffortFilter added in v0.4.0

func (b *LocalFileReadRel) BestEffortFilter() expr.Expression

func (*LocalFileReadRel) Filter added in v0.4.0

func (b *LocalFileReadRel) Filter() expr.Expression

func (*LocalFileReadRel) GetAdvancedExtension added in v0.4.0

func (lf *LocalFileReadRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*LocalFileReadRel) Item added in v0.4.0

func (lf *LocalFileReadRel) Item(i int) FileOrFiles

func (*LocalFileReadRel) Projection added in v0.4.0

func (b *LocalFileReadRel) Projection() *expr.MaskExpression

func (*LocalFileReadRel) RecordType added in v0.4.0

func (b *LocalFileReadRel) RecordType() types.StructType

func (*LocalFileReadRel) ToProto added in v0.4.0

func (lf *LocalFileReadRel) ToProto() *proto.Rel

func (*LocalFileReadRel) ToProtoPlanRel added in v0.4.0

func (lf *LocalFileReadRel) ToProtoPlanRel() *proto.PlanRel

type MergeJoinRel added in v0.4.0

type MergeJoinRel struct {
	RelCommon
	// contains filtered or unexported fields
}

MergeJoinRel represents a join done by taking advantage of two sets that are sorted on the join keys. This allows the join operation to be done in a streaming fashion.

func (*MergeJoinRel) GetAdvancedExtension added in v0.4.0

func (mr *MergeJoinRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*MergeJoinRel) Left added in v0.4.0

func (mr *MergeJoinRel) Left() Rel

func (*MergeJoinRel) LeftKeys added in v0.4.0

func (mr *MergeJoinRel) LeftKeys() []*expr.FieldReference

func (*MergeJoinRel) PostJoinFilter added in v0.4.0

func (mr *MergeJoinRel) PostJoinFilter() expr.Expression

func (*MergeJoinRel) RecordType added in v0.4.0

func (mr *MergeJoinRel) RecordType() types.StructType

func (*MergeJoinRel) Right added in v0.4.0

func (mr *MergeJoinRel) Right() Rel

func (*MergeJoinRel) RightKeys added in v0.4.0

func (mr *MergeJoinRel) RightKeys() []*expr.FieldReference

func (*MergeJoinRel) ToProto added in v0.4.0

func (mr *MergeJoinRel) ToProto() *proto.Rel

func (*MergeJoinRel) ToProtoPlanRel added in v0.4.0

func (mr *MergeJoinRel) ToProtoPlanRel() *proto.PlanRel

func (*MergeJoinRel) Type added in v0.4.0

func (mr *MergeJoinRel) Type() HashMergeJoinType

type MultiRel added in v0.4.0

type MultiRel interface {
	Rel

	Inputs() []Rel
}

MultiRel is a convenience interface representing any relation that takes an arbitrary number of inputs.

type NamedTableReadRel added in v0.4.0

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

NamedTableReadRel is a named scan of a base table. The list of strings that make up the names are to represent namespacing (e.g. mydb.mytable). This assumes a shared catalog between systems exchanging a message.

func (*NamedTableReadRel) BaseSchema added in v0.4.0

func (b *NamedTableReadRel) BaseSchema() types.NamedStruct

func (*NamedTableReadRel) BestEffortFilter added in v0.4.0

func (b *NamedTableReadRel) BestEffortFilter() expr.Expression

func (*NamedTableReadRel) Filter added in v0.4.0

func (b *NamedTableReadRel) Filter() expr.Expression

func (*NamedTableReadRel) GetAdvancedExtension added in v0.4.0

func (b *NamedTableReadRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*NamedTableReadRel) NamedTableAdvancedExtension added in v0.4.0

func (n *NamedTableReadRel) NamedTableAdvancedExtension() *extensions.AdvancedExtension

func (*NamedTableReadRel) Names added in v0.4.0

func (n *NamedTableReadRel) Names() []string

func (*NamedTableReadRel) Projection added in v0.4.0

func (b *NamedTableReadRel) Projection() *expr.MaskExpression

func (*NamedTableReadRel) RecordType added in v0.4.0

func (b *NamedTableReadRel) RecordType() types.StructType

func (*NamedTableReadRel) ToProto added in v0.4.0

func (n *NamedTableReadRel) ToProto() *proto.Rel

func (*NamedTableReadRel) ToProtoPlanRel added in v0.4.0

func (n *NamedTableReadRel) ToProtoPlanRel() *proto.PlanRel

type OrcReadOptions added in v0.4.0

type ParquetReadOptions added in v0.4.0

type PathType added in v0.4.0

type PathType int8

PathType is the type of a LocalFileReadRel's uris.

const (
	// A uri that can refer to either a single folder or a single file
	URIPath PathType = iota
	// A URI where the path portion is a glob expression that can
	// identify zero or more paths. Consumers should support
	// POSIX syntax. The recursive globstar (**) may not be supported.
	URIPathGlob
	// A URI that refers to a single file.
	URIFile
	// A URI that refers to a single folder.
	URIFolder
)

type Plan

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

Plan describes a set of operations to complete. For compactness, identifiers are normalized at the plan level.

func FromProto

func FromProto(plan *proto.Plan, c *extensions.Collection) (*Plan, error)

func (*Plan) AdvancedExtension added in v0.4.0

func (p *Plan) AdvancedExtension() AdvancedExtension

AdvancedExtension returns optional additional extensions associated with this plan such as optimizations or enhancements.

func (*Plan) ExpectedTypeURLs

func (p *Plan) ExpectedTypeURLs() []string

ExpectedTypeURLs is a list of anypb.Any protobuf entities that this plan may use. This can be used to warn if some embedded message types are unknown. Note that this list may include message types which are ignorable (optimizations) or are unused. In many cases, a consumer may be able to work with a plan even if one or more message types defined here are unknown.

This returns a clone of the slice, so that the Plan itself remains immutable.

func (*Plan) ExtensionRegistry added in v0.4.0

func (p *Plan) ExtensionRegistry() expr.ExtensionRegistry

ExtensionRegistry returns the set of registered extensions for this plan that it may depend on.

func (*Plan) GetNonRootRelations added in v0.4.0

func (p *Plan) GetNonRootRelations() (rels []Rel)

GetNonRootRelations returns a slice containing only the relations from this plan which are not considered Roots.

func (*Plan) GetRoots added in v0.4.0

func (p *Plan) GetRoots() (roots []*Root)

GetRoots returns a slice containing *only* the relations which are considered Root relations from the list (as opposed to CTEs or references).

func (*Plan) Relations

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

Relations returns the full slice of relation trees that are in this plan.

This returns a clone of the internal slice so that the plan itself remains immutable.

func (*Plan) ToProto

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

func (*Plan) Version

func (p *Plan) Version() Version

Version returns the substrait version of the plan.

type ProjectRel added in v0.4.0

type ProjectRel struct {
	RelCommon
	// contains filtered or unexported fields
}

ProjectRel represents calculated expressions of fields (e.g. a+b), the OutputMapping will be used to represent classical relational projections.

func (*ProjectRel) Expressions added in v0.4.0

func (p *ProjectRel) Expressions() []expr.Expression

func (*ProjectRel) GetAdvancedExtension added in v0.4.0

func (p *ProjectRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*ProjectRel) Input added in v0.4.0

func (p *ProjectRel) Input() Rel

func (*ProjectRel) RecordType added in v0.4.0

func (p *ProjectRel) RecordType() types.StructType

func (*ProjectRel) ToProto added in v0.4.0

func (p *ProjectRel) ToProto() *proto.Rel

func (*ProjectRel) ToProtoPlanRel added in v0.4.0

func (p *ProjectRel) ToProtoPlanRel() *proto.PlanRel

type ReadRel added in v0.4.0

type ReadRel interface {
	Rel

	BaseSchema() types.NamedStruct
	Filter() expr.Expression
	BestEffortFilter() expr.Expression
	Projection() *expr.MaskExpression
	// contains filtered or unexported methods
}

ReadRel is a scan operator of base data (physical or virtual) and allows filtering and projection of that underlying data.

type Rel added in v0.4.0

type Rel interface {
	// Hint returns a set of changes to the operation which can influence
	// efficiency and performance but should not impact correctness.
	//
	// This includes things such as Stats and Runtime constraints.
	Hint() *Hint
	// OutputMapping is optional and may be nil. If this is nil, then
	// the result of this relation is the direct output as is (with no
	// reordering or projection of columns). Otherwise this is a slice
	// of indices into the underlying relation's output to map columns
	// to the intended result column order.
	//
	// For example, an output map of [5, 2, 1] means that the expected
	// result should be 3 columns consisting of the 5th, 2nd and 1st
	// output columns from the underlying relation.
	OutputMapping() []int32
	// Remap utilizes the OutputMapping to construct the expected result
	// record type from the output RecordType of the underlying Relation.
	// If the output mapping is nil, then this just returns the input
	// type.
	Remap(types.StructType) types.StructType
	// RecordType returns the output record type of the underlying relation
	// as a struct type.
	RecordType() types.StructType

	GetAdvancedExtension() *extensions.AdvancedExtension
	ToProto() *proto.Rel
	ToProtoPlanRel() *proto.PlanRel
}

Rel is a relation tree, representing one of the expected Relation types such as Fetch, Sort, Filter, Join, etc.

It contains the common functionality between the different relations and should be type switched to determine which relation type it actually is for evaluation.

func RelFromProto added in v0.4.0

func RelFromProto(rel *proto.Rel, reg expr.ExtensionRegistry) (Rel, error)

type RelCommon added in v0.4.0

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

RelCommon is the common fields of all relational operators and is embedded in all of them.

func (*RelCommon) GetAdvancedExtension added in v0.4.0

func (rc *RelCommon) GetAdvancedExtension() *extensions.AdvancedExtension

func (*RelCommon) Hint added in v0.4.0

func (rc *RelCommon) Hint() *Hint

func (*RelCommon) OutputMapping added in v0.4.0

func (rc *RelCommon) OutputMapping() []int32

func (*RelCommon) Remap added in v0.4.0

func (rc *RelCommon) Remap(initial types.StructType) types.StructType

type Relation

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

Relation is either a Root relation (a relation + list of column names) or another relation (such as a CTE or other reference).

func (*Relation) FromProto added in v0.4.0

func (r *Relation) FromProto(p *proto.PlanRel, reg expr.ExtensionRegistry) error

func (*Relation) IsRoot added in v0.4.0

func (r *Relation) IsRoot() bool

IsRoot returns true if this is the root of the plan Relation tree.

func (*Relation) Rel added in v0.4.0

func (r *Relation) Rel() Rel

func (*Relation) Root added in v0.4.0

func (r *Relation) Root() *Root

func (*Relation) ToProto added in v0.4.0

func (r *Relation) ToProto() *proto.PlanRel

type Root added in v0.4.0

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

Root is a relation with output field names. This is used as the root of a Rel tree.

func (*Root) Input added in v0.4.0

func (r *Root) Input() Rel

func (*Root) Names added in v0.4.0

func (r *Root) Names() []string

Names are the field names in depth-first order.

func (*Root) RecordType added in v0.4.0

func (r *Root) RecordType() types.NamedStruct

func (*Root) ToProtoPlanRel added in v0.4.0

func (r *Root) ToProtoPlanRel() *proto.PlanRel

type RuntimeConstraint added in v0.4.0

type RuntimeConstraint = proto.RelCommon_Hint_RuntimeConstraint

type SetOp added in v0.4.0

type SetOp = proto.SetRel_SetOp

type SetRel added in v0.4.0

type SetRel struct {
	RelCommon
	// contains filtered or unexported fields
}

SetRel represents the relational set operators (intersection, union, etc.)

func (*SetRel) GetAdvancedExtension added in v0.4.0

func (s *SetRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*SetRel) Inputs added in v0.4.0

func (s *SetRel) Inputs() []Rel

func (*SetRel) Op added in v0.4.0

func (s *SetRel) Op() SetOp

func (*SetRel) RecordType added in v0.4.0

func (s *SetRel) RecordType() types.StructType

func (*SetRel) ToProto added in v0.4.0

func (s *SetRel) ToProto() *proto.Rel

func (*SetRel) ToProtoPlanRel added in v0.4.0

func (s *SetRel) ToProtoPlanRel() *proto.PlanRel

type SingleInputRel added in v0.4.0

type SingleInputRel interface {
	Rel

	Input() Rel
}

SingleInputRel is a convenience interface representing any relation that consists of exactly one input relation, such as a filter.

type SortRel added in v0.4.0

type SortRel struct {
	RelCommon
	// contains filtered or unexported fields
}

SortRel is an ORDER BY relational operator, describing a base relation, it includes a list of fields to sort on.

func (*SortRel) GetAdvancedExtension added in v0.4.0

func (sr *SortRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*SortRel) Input added in v0.4.0

func (sr *SortRel) Input() Rel

func (*SortRel) RecordType added in v0.4.0

func (sr *SortRel) RecordType() types.StructType

func (*SortRel) Sorts added in v0.4.0

func (sr *SortRel) Sorts() []expr.SortField

func (*SortRel) ToProto added in v0.4.0

func (sr *SortRel) ToProto() *proto.Rel

func (*SortRel) ToProtoPlanRel added in v0.4.0

func (sr *SortRel) ToProtoPlanRel() *proto.PlanRel

type Stats added in v0.4.0

type Version added in v0.4.0

type Version interface {
	GetGitHash() string
	GetMajorNumber() uint32
	GetMinorNumber() uint32
	GetPatchNumber() uint32
	GetProducer() string
	fmt.Stringer
}

type VirtualTableReadRel added in v0.4.0

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

VirtualTableReadRel represents a table composed of literals.

func (*VirtualTableReadRel) BaseSchema added in v0.4.0

func (b *VirtualTableReadRel) BaseSchema() types.NamedStruct

func (*VirtualTableReadRel) BestEffortFilter added in v0.4.0

func (b *VirtualTableReadRel) BestEffortFilter() expr.Expression

func (*VirtualTableReadRel) Filter added in v0.4.0

func (b *VirtualTableReadRel) Filter() expr.Expression

func (*VirtualTableReadRel) GetAdvancedExtension added in v0.4.0

func (b *VirtualTableReadRel) GetAdvancedExtension() *extensions.AdvancedExtension

func (*VirtualTableReadRel) Projection added in v0.4.0

func (b *VirtualTableReadRel) Projection() *expr.MaskExpression

func (*VirtualTableReadRel) RecordType added in v0.4.0

func (b *VirtualTableReadRel) RecordType() types.StructType

func (*VirtualTableReadRel) ToProto added in v0.4.0

func (v *VirtualTableReadRel) ToProto() *proto.Rel

func (*VirtualTableReadRel) ToProtoPlanRel added in v0.4.0

func (v *VirtualTableReadRel) ToProtoPlanRel() *proto.PlanRel

func (*VirtualTableReadRel) Values added in v0.4.0

Jump to

Keyboard shortcuts

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