Available for Enterprise Edition only.
| Project Type | Create UDFs | Import UDFs |
|---|---|---|
| Python | Python/Scala | SQL |
| Scala | Python/Scala | Not supported |
Learn about UDF support in Databricks on our documentation on cluster access modes.
Create UDFs
Prophecy supports creating UDFs written in Python or Scala.Parameters
| Parameter | Description | Required |
|---|---|---|
| Function name | The name of the function as it appears in your project. | True |
| UDF Name | The name of the UDF that will register it. All calls to the UDF will use this name. | True |
| Definition | Definition of the UDF function. For example, udf((value:Int)=>value*value) | True |
| UDF initialization code | Code block that contains initialization of entities used by UDFs. This could, for example, contain any static mapping that a UDF might use. | False |
How to Create UDFs
- Create a new function. You can find the Functions section in the left sidebar of a project page.

- Define the function.

- Call the function.

- Python
- Scala
Import UDFs
UDFs from the Unity Catalog are automatically available in Python projects when you attach to the relevant Databricks fabric. You can call these UDFs from any gem in the project.


