Skip to content

ResolveFunctions Logical Resolution Rule

ResolveFunctions is a logical resolution rule that the logical query plan analyzer uses to resolve the following logical operators and expressions in a logical query plan:

Logical Operator Expression
UnresolvedFunctionName UnresolvedFunction
UnresolvedTableValuedFunction UnresolvedGenerator
UnresolvedTVFAliases  

ResolveReferences is a Catalyst rule for transforming logical plans (Rule[LogicalPlan]).

ResolveFunctions is part of Resolution fixed-point batch of rules.

Executing Rule

Rule
apply(
  plan: LogicalPlan): LogicalPlan

apply is part of the Rule abstraction.

apply resolves logical operators up (post-order, bottom-up) in trees with the following TreePatterns:

UnresolvedTableValuedFunction

For an UnresolvedTableValuedFunction, apply first attempts to resolveBuiltinOrTempTableFunction, if available.

Otherwise, apply attempts to resolve a CatalogPlugin and, for the spark_catalog only, requests the SessionCatalog to resolvePersistentTableFunction.

Others

apply...FIXME

resolveBuiltinOrTempTableFunction

resolveBuiltinOrTempTableFunction(
  name: Seq[String],
  arguments: Seq[Expression]): Option[LogicalPlan]

Only for a one-element name, resolveBuiltinOrTempTableFunction requests the SessionCatalog to resolveBuiltinOrTempTableFunction.

Otherwise, resolveBuiltinOrTempTableFunction returns None (an undefined value).