Skip to main content

Create a Databricks Function

Create a Function within Databricks.

Category: Other

How it works

Run Databricks Notebook '<<NotebookPath>>' to generate the script for CREATE FUNCTION.

To use this activity within the API, use an ActivityCode of CREATE-FUNCTION.

Example JSON

An example of what the Task Config would look like for a task using this activity. Some of these variables would be set at the group level to avoid duplication between tasks.

{
"NotebookPath": "/Users/fred.nurks@example.com/MyRepo/My Notebook",
"FunctionSchema": "",
"FunctionName": "",
"NotebookParameters": { "Param1": "Value1", "Param2": "Value2" }
}

Variable Reference

The following variables are supported:

  • AdditionalNotebooks (Optional) - The path to other notebooks, Python files etc., referenced by the main notebook.

  • DatabricksClusterId (Optional) - The Databricks Cluster to use for this task.

  • FunctionName (Required) - The name of the Function.

  • FunctionSchema (Required) - The schema that this Function resides in.

  • MaximumNumberOfAttemptsAllowed (Optional) - The total number of times the running of this Task can be attempted.

  • MinutesToWaitBeforeNextAttempt (Optional) - If a Task run fails, the number of minutes to wait before re-attempting the Task.

  • NotebookParameters (Optional) - Parameters for use in the Databricks Notebook. This is JSON format e.g. { "Param1": "Value1", "Param2": "Value2" }.

  • NotebookPath (Required) - The relative path to the Databricks Notebook.