functions

package
v3.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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)
}

Dialect is the entry point to understanding the mapping between Substrait and a specific target system

func LoadDialect

func LoadDialect(name string, r io.Reader) (Dialect, error)

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 added in v3.2.0

func NewExtensionAndFunctionRegistries(c *extensions.Collection) (expr.ExtensionRegistry, FunctionRegistry)

func NewFunctionRegistry

func NewFunctionRegistry(collection *extensions.Collection) FunctionRegistry

type LocalAggregateFunctionVariant

type LocalAggregateFunctionVariant struct {
	extensions.AggregateFunctionVariant
	LocalFunctionVariant
}

type LocalFunctionName

type LocalFunctionName string

LocalFunctionName is a function name localized to a specific dialect

type LocalFunctionRegistry

type LocalFunctionRegistry interface {
	GetDialect() Dialect
	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

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)

	// 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
}

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

Jump to

Keyboard shortcuts

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