class_docstr: User-facing catalog API, accessible through `SparkSession.catalog`.
  
  This is a thin wrapper around its Scala implementation org.apache.spark.sql.catalog.Catalog.
  
  .. versionchanged:: 3.4.0
      Supports Spark Connect.
class_docstr_tok: ["User-facing","catalog","API",",","accessible","through","`","SparkSession.catalog","`",".","This","is","a","thin","wrapper","around","its","Scala","implementation","org.apache.spark.sql.catalog.Catalog",".","..","versionchanged",":",":","3.4.0","Supports","Spark","Connect","."]
docstr: Returns a list of functions registered in the specified database.
  
  .. versionadded:: 3.4.0
  
  Parameters
  ----------
  dbName : str, optional
      name of the database to list the functions.
      ``dbName`` can be qualified with catalog name.
  pattern : str, optional
      The pattern that the function name needs to match.
  
      .. versionadded: 3.5.0
  
  Returns
  -------
  list
      A list of :class:`Function`.
  
  Notes
  -----
  If no database is specified, the current database and catalog
  are used. This API includes all temporary functions.
  
  Examples
  --------
  >>> spark.catalog.listFunctions()
  [Function(name=...
  
  >>> spark.catalog.listFunctions(pattern="to_*")
  [Function(name=...
  
  >>> spark.catalog.listFunctions(pattern="*not_existing_func*")
  []
docstr_tok: ["Returns","a","list","of","functions","registered","in","the","specified","database",".","..","versionadded",":",":","3.4.0","Parameters","--","--","--","--","--","dbName",":","str",",","optional","name","of","the","database","to","list","the","functions",".","``","dbName","``","can","be","qualified","with","catalog","name",".","pattern",":","str",",","optional","The","pattern","that","the","function","name","needs","to","match",".","..","versionadded",":","3.5.0","Returns","--","--","--","-","list","A","list","of",":","class",":","`","Function","`",".","Notes","--","--","-","If","no","database","is","specified",",","the","current","database","and","catalog","are","used",".","This","API","includes","all","temporary","functions",".","Examples","--","--","--","--",">",">",">","spark.catalog.listFunctions","(",")","[","Function","(","name=","...",">",">",">","spark.catalog.listFunctions","(","pattern=","''","to_","*","''",")","[","Function","(","name=","...",">",">",">","spark.catalog.listFunctions","(","pattern=","''","*","not_existing_func","*","''",")","[","]"]
code: def listFunctions(
      self, dbName: Optional[str] = None, pattern: Optional[str] = None
  ) -> List[Function]:
      """
      Returns a list of functions registered in the specified database.
  
      .. versionadded:: 3.4.0
  
      Parameters
      ----------
      dbName : str, optional
          name of the database to list the functions.
          ``dbName`` can be qualified with catalog name.
      pattern : str, optional
          The pattern that the function name needs to match.
  
          .. versionadded: 3.5.0
  
      Returns
      -------
      list
          A list of :class:`Function`.
  
      Notes
      -----
      If no database is specified, the current database and catalog
      are used. This API includes all temporary functions.
  
      Examples
      --------
      >>> spark.catalog.listFunctions()
      [Function(name=...
  
      >>> spark.catalog.listFunctions(pattern="to_*")
      [Function(name=...
  
      >>> spark.catalog.listFunctions(pattern="*not_existing_func*")
      []
      """
      if dbName is None:
          dbName = self.currentDatabase()
      iter = self._jcatalog.listFunctions(dbName).toLocalIterator()
      if pattern is None:
          iter = self._jcatalog.listFunctions(dbName).toLocalIterator()
      else:
          iter = self._jcatalog.listFunctions(
              dbName, pattern
          ).toLocalIterator()
      functions = []
      while iter.hasNext():
          jfunction = iter.next()
          jnamespace = jfunction.namespace()
          if jnamespace is not None:
              namespace = [
                  jnamespace[i] for i in range(0, len(jnamespace))
              ]
          else:
              namespace = None
  
          functions.append(
              Function(
                  name=jfunction.name(),
                  catalog=jfunction.catalog(),
                  namespace=namespace,
                  description=jfunction.description(),
                  className=jfunction.className(),
                  isTemporary=jfunction.isTemporary(),
              )
          )
      return functions
  
imports: import sys
  import warnings
  from typing import Any, Callable, NamedTuple, List, Optional, TYPE_CHECKING
  from pyspark.errors import PySparkTypeError
  from pyspark.storagelevel import StorageLevel
  from pyspark.sql.dataframe import DataFrame
  from pyspark.sql.session import SparkSession
  from pyspark.sql.types import StructType
label_desc: Use image node_id 12 for calling the Catalog obj's underlying member method code with example usage: obj.listFunctions(dbName, pattern) and returns: functions