Module mz_sql::func

source · []
Expand description

TBD: Currently, sql::func handles matching arguments to their respective built-in functions (for most built-in functions, at least).

Macros

builtins 🔒

Constructs builtin function map.

Functions using this macro should be transformed/planned away before reaching function selection code, but still need to be present in the catalog during planning.

impl_def 🔒
params 🔒

Provides shorthand for converting Vec<ScalarType> into Vec<ParamType>.

Structs

Tracks candidate implementations.

Describes a single function’s implementation.

Describes how each implementation should be represented in the catalog.

Operation 🔒

Builds an expression that evaluates a scalar function on the provided input expressions.

Represents a solution to a set of polymorphic constraints, expressed as the params of a function and the user-supplied args.

Enums

A specifier for a function or an operator.

Describes possible types of function parameters.

Describes parameter types.

Statics

OP_IMPLS 🔒

Correlates an operator with all of its implementations.

Correlates a built-in function name to its implementations.

Traits

Functions

digest 🔒
find_match 🔒

Finds an exact match based on the arguments, or, if no exact match, finds the best match available. Patterned after PostgreSQL’s type conversion matching algorithm.

Resolves the operator to a set of function implementations.

Selects the best implementation given the provided args using a process similar to PostgreSQL’s parser, and returns the ScalarExpr to invoke that function.

Backing implementation for sql_impl_func and sql_impl_cast. See those functions for details.