pyspark.sql.Catalog.listFunctions#

Catalog.listFunctions(dbName=None, pattern=None)[source]#

Returns a list of functions registered in the current database (namespace), or in the database given by dbName when provided (the name may be qualified with catalog).

With pattern, returns only functions whose name matches the pattern. This includes all built-in and temporary functions.

New in version 3.4.0.

Parameters
dbNamestr, optional

Database (namespace) to list functions from. If omitted, the current database is used. May be qualified with catalog name.

patternstr, optional

Pattern that function names must match.

New in version 3.5.0.

Returns
list

A list of Function.

Examples

>>> spark.catalog.listFunctions()
[Function(name=...
>>> spark.catalog.listFunctions(pattern="to_*")
[Function(name=...
>>> spark.catalog.listFunctions(pattern="*not_existing_func*")
[]