Back to Spark

REFRESH FUNCTION

docs/sql-ref-syntax-aux-cache-refresh-function.md

4.1.11.3 KB
Original Source

Description

REFRESH FUNCTION statement invalidates the cached function entry, which includes a class name and resource location of the given function. The invalidated cache is populated right away. Note that REFRESH FUNCTION only works for permanent functions. Refreshing native functions or temporary functions will cause an exception.

Syntax

sql
REFRESH FUNCTION function_identifier

Parameters

  • function_identifier

    Specifies a function name, which is either a qualified or unqualified name. If no database identifier is provided, uses the current database.

    Syntax: [ database_name. ] function_name

Examples

sql
-- The cached entry of the function will be refreshed
-- The function is resolved from the current database as the function name is unqualified.
REFRESH FUNCTION func1;

-- The cached entry of the function will be refreshed
-- The function is resolved from tempDB database as the function name is qualified.
REFRESH FUNCTION db1.func1;