Documentation ¶
Index ¶
- Constants
- func EvaluateTypeExpression(nullHandling NullabilityHandling, expr parser.TypeExpression, ...) (types.Type, error)
- type AdvancedExtension
- type AggVariantOptions
- type AggregateFunction
- type AggregateFunctionImpl
- type AggregateFunctionVariant
- func (s *AggregateFunctionVariant) Args() ArgumentList
- func (s *AggregateFunctionVariant) CompoundName() string
- func (s *AggregateFunctionVariant) Decomposability() DecomposeType
- func (s *AggregateFunctionVariant) Description() string
- func (s *AggregateFunctionVariant) Deterministic() bool
- func (s *AggregateFunctionVariant) Intermediate() (types.Type, error)
- func (s *AggregateFunctionVariant) MaxSet() int
- func (s *AggregateFunctionVariant) Name() string
- func (s *AggregateFunctionVariant) Nullability() NullabilityHandling
- func (s *AggregateFunctionVariant) Options() map[string]Option
- func (s *AggregateFunctionVariant) Ordered() bool
- func (s *AggregateFunctionVariant) ResolveType(argumentTypes []types.Type) (types.Type, error)
- func (s *AggregateFunctionVariant) SessionDependent() bool
- func (s *AggregateFunctionVariant) URI() string
- func (s *AggregateFunctionVariant) Variadic() *VariadicBehavior
- type Argument
- type ArgumentList
- type Collection
- func (c *Collection) GetAggregateFunc(id ID) (*AggregateFunctionVariant, bool)
- func (c *Collection) GetScalarFunc(id ID) (*ScalarFunctionVariant, bool)
- func (c *Collection) GetType(id ID) (t Type, ok bool)
- func (c *Collection) GetTypeVariation(id ID) (tv TypeVariation, ok bool)
- func (c *Collection) GetWindowFunc(id ID) (*WindowFunctionVariant, bool)
- func (c *Collection) Load(uri string, r io.Reader) error
- func (c *Collection) URILoaded(uri string) bool
- type DecomposeType
- type EnumArg
- type Function
- type FunctionVariant
- type ID
- type NullabilityHandling
- type Option
- type ParamType
- type ParameterConsistency
- type ScalarFunction
- type ScalarFunctionImpl
- type ScalarFunctionVariant
- func (s *ScalarFunctionVariant) Args() ArgumentList
- func (s *ScalarFunctionVariant) CompoundName() string
- func (s *ScalarFunctionVariant) Description() string
- func (s *ScalarFunctionVariant) Deterministic() bool
- func (s *ScalarFunctionVariant) Name() string
- func (s *ScalarFunctionVariant) Nullability() NullabilityHandling
- func (s *ScalarFunctionVariant) Options() map[string]Option
- func (s *ScalarFunctionVariant) ResolveType(argumentTypes []types.Type) (types.Type, error)
- func (s *ScalarFunctionVariant) SessionDependent() bool
- func (s *ScalarFunctionVariant) URI() string
- func (s *ScalarFunctionVariant) Variadic() *VariadicBehavior
- type Set
- type SimpleExtensionFile
- type TopLevel
- type Type
- type TypeArg
- type TypeDef
- type TypeParamDef
- type TypeVariation
- type TypeVariationFunctions
- type ValueArg
- type VariadicBehavior
- type WindowFunction
- type WindowFunctionImpl
- type WindowFunctionVariant
- func (s *WindowFunctionVariant) Args() ArgumentList
- func (s *WindowFunctionVariant) CompoundName() string
- func (s *WindowFunctionVariant) Decomposability() DecomposeType
- func (s *WindowFunctionVariant) Description() string
- func (s *WindowFunctionVariant) Deterministic() bool
- func (s *WindowFunctionVariant) Intermediate() (types.Type, error)
- func (s *WindowFunctionVariant) MaxSet() int
- func (s *WindowFunctionVariant) Name() string
- func (s *WindowFunctionVariant) Nullability() NullabilityHandling
- func (s *WindowFunctionVariant) Options() map[string]Option
- func (s *WindowFunctionVariant) Ordered() bool
- func (s *WindowFunctionVariant) ResolveType(argumentTypes []types.Type) (types.Type, error)
- func (s *WindowFunctionVariant) SessionDependent() bool
- func (s *WindowFunctionVariant) URI() string
- func (s *WindowFunctionVariant) Variadic() *VariadicBehavior
- func (s *WindowFunctionVariant) WindowType() WindowType
- type WindowType
- type WindowVariantOpts
Constants ¶
const SubstraitDefaultURIPrefix = "https://github.com/substrait-io/substrait/blob/main/extensions/"
Variables ¶
This section is empty.
Functions ¶
func EvaluateTypeExpression ¶
func EvaluateTypeExpression(nullHandling NullabilityHandling, expr parser.TypeExpression, paramTypeList ArgumentList, actualTypes []types.Type) (types.Type, error)
Types ¶
type AdvancedExtension ¶
type AdvancedExtension = extensions.AdvancedExtension
type AggVariantOptions ¶
type AggVariantOptions struct { Variadic *VariadicBehavior SessionDependant bool Deterministic bool Ordered bool // value of 0 == unlimited MaxSet uint Decomposable DecomposeType // should be a type expression // must not be empty if decomposable is not DecomposeNone IntermediateOutputType string }
type AggregateFunction ¶
type AggregateFunction struct { Name string Description string Impls []AggregateFunctionImpl }
func (*AggregateFunction) GetVariants ¶
func (s *AggregateFunction) GetVariants(uri string) []*AggregateFunctionVariant
func (*AggregateFunction) ResolveURI ¶
func (s *AggregateFunction) ResolveURI(uri string) []FunctionVariant
type AggregateFunctionImpl ¶
type AggregateFunctionImpl struct { ScalarFunctionImpl `yaml:",inline"` Intermediate parser.TypeExpression Ordered bool MaxSet int Decomposable DecomposeType }
type AggregateFunctionVariant ¶
type AggregateFunctionVariant struct {
// contains filtered or unexported fields
}
func NewAggFuncVariant ¶
func NewAggFuncVariant(id ID) *AggregateFunctionVariant
NewAggFuncVariant constructs a variant with the provided name and uri and uses the defaults for everything else.
Return expressions aren't included here as using this variant to construct an expression requires an output type argument. This is for creating an on-the-fly function variant that will not be registered as an extension.
func NewAggFuncVariantOpts ¶
func NewAggFuncVariantOpts(id ID, opts AggVariantOptions) *AggregateFunctionVariant
func (*AggregateFunctionVariant) Args ¶
func (s *AggregateFunctionVariant) Args() ArgumentList
func (*AggregateFunctionVariant) CompoundName ¶
func (s *AggregateFunctionVariant) CompoundName() string
func (*AggregateFunctionVariant) Decomposability ¶
func (s *AggregateFunctionVariant) Decomposability() DecomposeType
func (*AggregateFunctionVariant) Description ¶
func (s *AggregateFunctionVariant) Description() string
func (*AggregateFunctionVariant) Deterministic ¶
func (s *AggregateFunctionVariant) Deterministic() bool
func (*AggregateFunctionVariant) Intermediate ¶
func (s *AggregateFunctionVariant) Intermediate() (types.Type, error)
func (*AggregateFunctionVariant) MaxSet ¶
func (s *AggregateFunctionVariant) MaxSet() int
func (*AggregateFunctionVariant) Name ¶
func (s *AggregateFunctionVariant) Name() string
func (*AggregateFunctionVariant) Nullability ¶
func (s *AggregateFunctionVariant) Nullability() NullabilityHandling
func (*AggregateFunctionVariant) Options ¶
func (s *AggregateFunctionVariant) Options() map[string]Option
func (*AggregateFunctionVariant) Ordered ¶
func (s *AggregateFunctionVariant) Ordered() bool
func (*AggregateFunctionVariant) ResolveType ¶
func (*AggregateFunctionVariant) SessionDependent ¶
func (s *AggregateFunctionVariant) SessionDependent() bool
func (*AggregateFunctionVariant) URI ¶
func (s *AggregateFunctionVariant) URI() string
func (*AggregateFunctionVariant) Variadic ¶
func (s *AggregateFunctionVariant) Variadic() *VariadicBehavior
type ArgumentList ¶
type ArgumentList []Argument
func (*ArgumentList) UnmarshalYAML ¶
func (a *ArgumentList) UnmarshalYAML(fn func(interface{}) error) error
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
var DefaultCollection Collection
DefaultCollection is loaded with the default Substrait extension definitions with the exception of decimal arithemtic. Decimal arithmetic functions are missing as the complex return type expressions are not yet implemented.
func (*Collection) GetAggregateFunc ¶
func (c *Collection) GetAggregateFunc(id ID) (*AggregateFunctionVariant, bool)
func (*Collection) GetScalarFunc ¶
func (c *Collection) GetScalarFunc(id ID) (*ScalarFunctionVariant, bool)
func (*Collection) GetTypeVariation ¶
func (c *Collection) GetTypeVariation(id ID) (tv TypeVariation, ok bool)
func (*Collection) GetWindowFunc ¶
func (c *Collection) GetWindowFunc(id ID) (*WindowFunctionVariant, bool)
func (*Collection) URILoaded ¶
func (c *Collection) URILoaded(uri string) bool
type DecomposeType ¶
type DecomposeType string
const ( DecomposeNone DecomposeType = "NONE" DecomposeOne DecomposeType = "ONE" DecomposeMany DecomposeType = "MANY" )
type Function ¶
type Function interface {
ResolveURI(uri string) []FunctionVariant
}
type FunctionVariant ¶
type NullabilityHandling ¶
type NullabilityHandling string
const ( MirrorNullability NullabilityHandling = "MIRROR" DeclaredOutputNullability NullabilityHandling = "DECLARED_OUTPUT" DiscreteNullability NullabilityHandling = "DISCRETE" )
type ParameterConsistency ¶
type ParameterConsistency string
const ( ConsistentParams ParameterConsistency = "CONSISTENT" InconsistentParams ParameterConsistency = "INCONSISTENT" )
type ScalarFunction ¶
type ScalarFunction struct { Name string `yaml:",omitempty"` Description string `yaml:",omitempty,flow"` Impls []ScalarFunctionImpl `yaml:",omitempty"` }
func (*ScalarFunction) GetVariants ¶
func (s *ScalarFunction) GetVariants(uri string) []*ScalarFunctionVariant
func (*ScalarFunction) ResolveURI ¶
func (s *ScalarFunction) ResolveURI(uri string) []FunctionVariant
type ScalarFunctionImpl ¶
type ScalarFunctionImpl struct { Args ArgumentList `yaml:",omitempty"` Options map[string]Option `yaml:",omitempty"` Variadic *VariadicBehavior `yaml:",omitempty"` SessionDependent bool `yaml:"sessionDependent,omitempty"` Deterministic bool `yaml:",omitempty"` Nullability NullabilityHandling `yaml:",omitempty"` Return parser.TypeExpression `yaml:",omitempty"` Implementation map[string]string `yaml:",omitempty"` }
type ScalarFunctionVariant ¶
type ScalarFunctionVariant struct {
// contains filtered or unexported fields
}
func NewScalarFuncVariant ¶
func NewScalarFuncVariant(id ID) *ScalarFunctionVariant
NewScalarFuncVariant constructs a variant with the provided name and uri and uses the defaults for everything else.
Return expressions aren't included here as using this variant to construct an expression requires an output type argument. This is for creating an on-the-fly function variant that will not be registered as an extension.
func NewScalarFuncVariantWithProps ¶
func NewScalarFuncVariantWithProps(id ID, variadic *VariadicBehavior, sessionDependant, deterministic bool) *ScalarFunctionVariant
NewScalarFuncVariantWithProps is the same as NewScalarFuncVariant but allows setting the values for the SessionDependant, Variadic Behavior and Deterministic properties.
func (*ScalarFunctionVariant) Args ¶
func (s *ScalarFunctionVariant) Args() ArgumentList
func (*ScalarFunctionVariant) CompoundName ¶
func (s *ScalarFunctionVariant) CompoundName() string
func (*ScalarFunctionVariant) Description ¶
func (s *ScalarFunctionVariant) Description() string
func (*ScalarFunctionVariant) Deterministic ¶
func (s *ScalarFunctionVariant) Deterministic() bool
func (*ScalarFunctionVariant) Name ¶
func (s *ScalarFunctionVariant) Name() string
func (*ScalarFunctionVariant) Nullability ¶
func (s *ScalarFunctionVariant) Nullability() NullabilityHandling
func (*ScalarFunctionVariant) Options ¶
func (s *ScalarFunctionVariant) Options() map[string]Option
func (*ScalarFunctionVariant) ResolveType ¶
func (*ScalarFunctionVariant) SessionDependent ¶
func (s *ScalarFunctionVariant) SessionDependent() bool
func (*ScalarFunctionVariant) URI ¶
func (s *ScalarFunctionVariant) URI() string
func (*ScalarFunctionVariant) Variadic ¶
func (s *ScalarFunctionVariant) Variadic() *VariadicBehavior
type Set ¶
type Set interface { DecodeTypeVariation(anchor uint32) (ID, bool) DecodeFunc(anchor uint32) (ID, bool) DecodeType(anchor uint32) (ID, bool) LookupTypeVariation(anchor uint32, c *Collection) (TypeVariation, bool) LookupType(anchor uint32, c *Collection) (Type, bool) LookupScalarFunction(anchor uint32, c *Collection) (*ScalarFunctionVariant, bool) LookupAggregateFunction(anchor uint32, c *Collection) (*AggregateFunctionVariant, bool) LookupWindowFunction(anchor uint32, c *Collection) (*WindowFunctionVariant, bool) FindURI(uri string) (uint32, bool) GetTypeAnchor(id ID) uint32 GetFuncAnchor(id ID) uint32 GetTypeVariationAnchor(id ID) uint32 ToProto() ([]*extensions.SimpleExtensionURI, []*extensions.SimpleExtensionDeclaration) }
func GetExtensionSet ¶
type SimpleExtensionFile ¶
type SimpleExtensionFile struct { Types []Type `yaml:"types,omitempty"` TypeVariations []TypeVariation `yaml:"type_variations,omitempty"` ScalarFunctions []ScalarFunction `yaml:"scalar_functions,omitempty"` AggregateFunctions []AggregateFunction `yaml:"aggregate_functions,omitempty"` WindowFunctions []WindowFunction `yaml:"window_functions,omitempty"` }
type TopLevel ¶
type TopLevel interface { GetExtensionUris() []*extensions.SimpleExtensionURI GetExtensions() []*extensions.SimpleExtensionDeclaration }
type Type ¶
type Type struct { Name string Variadic bool Structure TypeDef `yaml:",omitempty"` Parameters []TypeParamDef }
type TypeParamDef ¶
type TypeVariation ¶
type TypeVariation struct { Name string Parent parser.TypeExpression Description string Functions TypeVariationFunctions }
type TypeVariationFunctions ¶
type TypeVariationFunctions string
const ( TypeVariationInheritsFuncs TypeVariationFunctions = "INHERITS" TypeVariationSeparateFuncs TypeVariationFunctions = "SEPARATE" )
type ValueArg ¶
type ValueArg struct { Name string `yaml:",omitempty"` Description string `yaml:",omitempty"` Value *parser.TypeExpression Constant bool `yaml:",omitempty"` }
type VariadicBehavior ¶
type VariadicBehavior struct { Min int `yaml:",omitempty"` Max int `yaml:",omitempty"` ParameterConsistency ParameterConsistency `yaml:"parameterConsistency,omitempty"` }
type WindowFunction ¶
type WindowFunction struct { Name string Description string Impls []WindowFunctionImpl }
func (*WindowFunction) GetVariants ¶
func (s *WindowFunction) GetVariants(uri string) []*WindowFunctionVariant
func (*WindowFunction) ResolveURI ¶
func (s *WindowFunction) ResolveURI(uri string) []FunctionVariant
type WindowFunctionImpl ¶
type WindowFunctionImpl struct { AggregateFunctionImpl `yaml:",inline"` WindowType WindowType `yaml:"window_type"` }
type WindowFunctionVariant ¶
type WindowFunctionVariant struct {
// contains filtered or unexported fields
}
func NewWindowFuncVariant ¶
func NewWindowFuncVariant(id ID) *WindowFunctionVariant
func NewWindowFuncVariantOpts ¶
func NewWindowFuncVariantOpts(id ID, opts WindowVariantOpts) *WindowFunctionVariant
func (*WindowFunctionVariant) Args ¶
func (s *WindowFunctionVariant) Args() ArgumentList
func (*WindowFunctionVariant) CompoundName ¶
func (s *WindowFunctionVariant) CompoundName() string
func (*WindowFunctionVariant) Decomposability ¶
func (s *WindowFunctionVariant) Decomposability() DecomposeType
func (*WindowFunctionVariant) Description ¶
func (s *WindowFunctionVariant) Description() string
func (*WindowFunctionVariant) Deterministic ¶
func (s *WindowFunctionVariant) Deterministic() bool
func (*WindowFunctionVariant) Intermediate ¶
func (s *WindowFunctionVariant) Intermediate() (types.Type, error)
func (*WindowFunctionVariant) MaxSet ¶
func (s *WindowFunctionVariant) MaxSet() int
func (*WindowFunctionVariant) Name ¶
func (s *WindowFunctionVariant) Name() string
func (*WindowFunctionVariant) Nullability ¶
func (s *WindowFunctionVariant) Nullability() NullabilityHandling
func (*WindowFunctionVariant) Options ¶
func (s *WindowFunctionVariant) Options() map[string]Option
func (*WindowFunctionVariant) Ordered ¶
func (s *WindowFunctionVariant) Ordered() bool
func (*WindowFunctionVariant) ResolveType ¶
func (*WindowFunctionVariant) SessionDependent ¶
func (s *WindowFunctionVariant) SessionDependent() bool
func (*WindowFunctionVariant) URI ¶
func (s *WindowFunctionVariant) URI() string
func (*WindowFunctionVariant) Variadic ¶
func (s *WindowFunctionVariant) Variadic() *VariadicBehavior
func (*WindowFunctionVariant) WindowType ¶
func (s *WindowFunctionVariant) WindowType() WindowType
type WindowType ¶
type WindowType string
const ( StreamingWindow WindowType = "STREAMING" PartitionWindow WindowType = "PARTITION" )
type WindowVariantOpts ¶
type WindowVariantOpts struct { Variadic *VariadicBehavior SessionDependant bool Deterministic bool Ordered bool // value of 0 == unlimited MaxSet uint Decomposable DecomposeType // should be a type expression // must not be empty if decomposable is not DecomposeNone IntermediateOutputType string WindowType WindowType }