package functions
import "github.com/substrait-io/substrait-go/v3/functions"
Index ¶
- type Dialect
- type FunctionName
- type FunctionNotation
- type FunctionRegistry
- func NewExtensionAndFunctionRegistries(c *extensions.Collection) (expr.ExtensionRegistry, FunctionRegistry)
- func NewFunctionRegistry(collection *extensions.Collection) FunctionRegistry
- type LocalAggregateFunctionVariant
- type LocalFunctionName
- type LocalFunctionRegistry
- type LocalFunctionVariant
- func (l *LocalFunctionVariant) IsOptionSupported(name string, value string) bool
- func (l *LocalFunctionVariant) LocalName() string
- func (l *LocalFunctionVariant) Notation() FunctionNotation
- type LocalScalarFunctionVariant
- type LocalTypeRegistry
- type LocalWindowFunctionVariant
- type SubstraitFunctionName
- type TypeRegistry
Types ¶
type Dialect ¶
type Dialect interface { Name() string // LocalizeFunctionRegistry creates a function registry restricts the provided registry down to // the subset of functions supported by this dialect. This will return an error if there are // functions declared in the dialect that are not available within the provided registry. LocalizeFunctionRegistry(registry FunctionRegistry) (LocalFunctionRegistry, error) // LocalizeTypeRegistry creates a type registry restricts the provided registry down to // the subset of types supported by this dialect. This will return an error if there are // types declared in the dialect that are not available within the provided registry. LocalizeTypeRegistry(registry TypeRegistry) (LocalTypeRegistry, error) // GetLocalTypeRegistry returns the last created type registry using this dialect or constructs // one using LocalizeTypeRegistry and a default type registry if one hasn't yet been made. GetLocalTypeRegistry() (LocalTypeRegistry, error) }
Dialect is the entry point to understanding the mapping between Substrait and a specific target system
func LoadDialect ¶
type FunctionName ¶
type FunctionName interface {
// contains filtered or unexported methods
}
type FunctionNotation ¶
type FunctionNotation int
const ( INFIX FunctionNotation = iota PREFIX POSTFIX )
type FunctionRegistry ¶
type FunctionRegistry interface { GetScalarFunctionsByName(name string) []*extensions.ScalarFunctionVariant GetAggregateFunctionsByName(name string) []*extensions.AggregateFunctionVariant GetWindowFunctionsByName(name string) []*extensions.WindowFunctionVariant // contains filtered or unexported methods }
func NewExtensionAndFunctionRegistries ¶
func NewExtensionAndFunctionRegistries(c *extensions.Collection) (expr.ExtensionRegistry, FunctionRegistry)
func NewFunctionRegistry ¶
func NewFunctionRegistry(collection *extensions.Collection) FunctionRegistry
type LocalAggregateFunctionVariant ¶
type LocalAggregateFunctionVariant struct { extensions.AggregateFunctionVariant LocalFunctionVariant }
func (*LocalAggregateFunctionVariant) InvocationTypeName ¶
func (l *LocalAggregateFunctionVariant) InvocationTypeName() string
type LocalFunctionName ¶
type LocalFunctionName string
LocalFunctionName is a function name localized to a specific dialect
type LocalFunctionRegistry ¶
type LocalFunctionRegistry interface { GetDialect() Dialect GetFunctionRegistry() FunctionRegistry GetScalarFunctionByInvocation(scalarFuncInvocation *expr.ScalarFunction) (*LocalScalarFunctionVariant, error) GetAggregateFunctionByInvocation(aggregateFuncInvocation *expr.AggregateFunction) (*LocalAggregateFunctionVariant, error) GetWindowFunctionByInvocation(windowFuncInvocation *expr.WindowFunction) (*LocalWindowFunctionVariant, error) // contains filtered or unexported methods }
LocalFunctionRegistry is a collection of functions localized to a particular Dialect
type LocalFunctionVariant ¶
type LocalFunctionVariant struct {
// contains filtered or unexported fields
}
func (*LocalFunctionVariant) IsOptionSupported ¶
func (l *LocalFunctionVariant) IsOptionSupported(name string, value string) bool
func (*LocalFunctionVariant) LocalName ¶
func (l *LocalFunctionVariant) LocalName() string
func (*LocalFunctionVariant) Notation ¶
func (l *LocalFunctionVariant) Notation() FunctionNotation
type LocalScalarFunctionVariant ¶
type LocalScalarFunctionVariant struct { extensions.ScalarFunctionVariant LocalFunctionVariant }
LocalScalarFunctionVariant is a ScalarFunctionVariant that also understands its context in a particular dialect
func (*LocalScalarFunctionVariant) InvocationTypeName ¶
func (l *LocalScalarFunctionVariant) InvocationTypeName() string
type LocalTypeRegistry ¶
type LocalTypeRegistry interface { // GetTypeFromTypeString gets the Substrait type for a given Substrait standard typeString. GetTypeFromTypeString(typeString string) (types.Type, error) // GetSubstraitTypeFromLocalType gets the Substrait type for a given local type string. GetSubstraitTypeFromLocalType(localType string) (types.Type, error) // GetLocalTypeFromSubstraitType gets the local type string for a given Substrait type. GetLocalTypeFromSubstraitType(typ types.Type) (string, error) // GetSupportedTypes returns the types supported by this dialect. GetSupportedTypes() map[string]types.Type // IsTypeSupportedInTables checks whether a particular type is supported in tables. // Some types (such as INTERVAL) may only be supported in literal contexts. IsTypeSupportedInTables(typ types.Type) bool }
LocalTypeRegistry is a registry that contains all types associated with a particular dialect.
func NewLocalTypeRegistry ¶
func NewLocalTypeRegistry(typeInfos []typeInfo) LocalTypeRegistry
type LocalWindowFunctionVariant ¶
type LocalWindowFunctionVariant struct { extensions.WindowFunctionVariant LocalFunctionVariant }
func (*LocalWindowFunctionVariant) InvocationTypeName ¶
func (l *LocalWindowFunctionVariant) InvocationTypeName() string
type SubstraitFunctionName ¶
type SubstraitFunctionName string
SubstraitFunctionName is the short name of the function (excluded URI and argument types) in Substrait
type TypeRegistry ¶
type TypeRegistry interface { // GetTypeFromTypeString gets the Substrait type for a given Substrait standard typeString. // Returns an error if type doesn't parse. This type registry should support both standard types // and any available extension types. GetTypeFromTypeString(typeString string) (types.Type, error) }
func NewTypeRegistry ¶
func NewTypeRegistry() TypeRegistry
Source Files ¶
dialect.go functions.go local_functions.go registries.go types.go
- Version
- v3.9.1 (latest)
- Published
- Apr 7, 2025
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 8 hours ago –
Tools for package owners.