---
title: functionExists
description: "Catalog.functionExists method in PySpark: Check if the function with the specified name exists. This can either be a temporary function or a function."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/catalog/functionExists
---

# functionExists

Check if the function with the specified name exists. This can either be a temporary function or a function.

## Syntax

```
functionExists(functionName: str, dbName: str = None)
```

## Parameters

| Parameter      | Type          | Description                                                                  |
| -------------- | ------------- | ---------------------------------------------------------------------------- |
| `functionName` | str           | Name of the function to check existence. Can be qualified with catalog name. |
| `dbName`       | str, optional | Name of the database to check function existence in.                         |

## Returns

`bool`

Indicating whether the function exists.

## Notes

If no database is specified, the current database and catalog are used. This API includes all temporary functions.

## Examples

```python
spark.catalog.functionExists("count")
# True

# Using the fully qualified name for function name.
spark.catalog.functionExists("default.unexisting_function")
# False
spark.catalog.functionExists("spark_catalog.default.unexisting_function")
# False
```
