Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

Table of Contents
minLevel1
maxLevel2absoluteUrl6
outlinefalse
styledefault
typelist
printabletrue

Overview

You can use this Snap to execute a job, check its status in Databricks, and, based on the job's status, complete or fail the pipeline. The Snap triggers the task to execute and then periodically checks its statusautomate the execution of a set of tasks or processes within a Databricks workspace. It triggers the task and periodically checks its progress. The Snap stops after the job is executed. Howevercomplete, but if you cancel the pipeline is canceled before the task is finishedfinishes, the Snap sends a request requests to stop terminate the task.

...

Example

Run Job on a Cluster

The following example pipeline demonstrates how to run a job specified in the notebook on a cluster.Snap Type

The Databricks - Run Job Snap is a Write-type Snap.

Prerequisites

  • Valid client ID.

  • A valid account with the required permissions.

Support for Ultra Pipelines

Limitations and Known Issues

None.

Snap Views

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document

Binary

Binary or Document

 

  • Min: 0

  • Max: 1

  • Mapper

  • Copy

Requires a valid task name, notebook path, and cluster-info.

Output

Document

Binary

 

Binary or Document

  • Min: 1

  • Max: 1

  • Mapper

  • Filter

Executes the selected notebook.

Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab:

  • Stop Pipeline Execution: Stops the current pipeline execution if the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the remaining records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap Settings

Info
  • Asterisk ( * ): Indicates a mandatory field.

  • Suggestion icon ((blue star)): Indicates a list that is dynamically populated based on the configuration.

  • Expression icon ((blue star) ): Indicates the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.

  • Add icon ( (blue star) ): Indicates that you can add fields in the field set.

  • Remove icon ( (blue star)): Indicates that you can remove fields from the field set.

  • Upload icon ((blue star) ): Indicates that you can upload files.

Field Name

Field Type

Description

Label*

 

Default ValueDatabricks - Run Job
ExampleRun Job

String

The

Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.

 

Task name*

 

Default Value: N/A
Example: Test username and password

String/Expression

Specify the name of the task to perform the job.

Notebook path*

 

Default Value: N/A
Example: /Users/johndoe@snaplogic.com/notebook

String/Expression/Suggestion

Specify the path of the saved notebook that will run in this job. Notebook is a web-based interface that allows you to create, edit, and execute data science and data engineering workflows. Learn more about Databricks notebooks.

Cluster*

 

Default Value: N/A
Example: Code Ammonite - Shared Compute Cluster - V2

String/Expression/Suggest

Specify the cluster to run the job within its environment.

Parameter(s)

Use this field set to specify the parameters to run the job.

Key*

Default Value: N/A
ExampleAge

String/Expression

Specify the parameter key.

Value*

Default Value: N/A
Example35

String/Expression

Specify the parameter value.

Interval check (seconds)*

 

Default Value10
Example15

Integer/Expression

Specify the number of seconds to wait before checking the status of the task.

Snap Execution

Default ValueExecute only
Example: Validate & Execute

Dropdown list

Select one of the following three modes in which the Snap executes:

  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Troubleshooting

...

Error

...

Reason

...

Resolution

...

Account validation failed.

...

The Pipeline ended before the batch could complete execution due to a connection error.

...

Verify that the Refresh token field is configured to handle the inputs properly. If you are not sure when the input data is available, configure this field as zero to keep the connection always open.

Examples

Excluding Fields from the Input Data Stream

We can exclude the unrequired fields from the input data stream by omitting them in the Input schema fieldset. This example demonstrates how we can use the <Snap Name> to achieve this result:

<screenshot of Pipeline/Snap and description>

Download this Pipeline. 

Downloads

...

Download and import the Pipeline into SnapLogic.

...

Configure Snap accounts, as applicable.

...

Example

Run Job on a Cluster

The following example pipeline demonstrates how to run a job specified in the notebook on a cluster.

...

Download this pipeline.

Step 1: Configure the Databricks - Run Job Snap with the following settings:

a. Task name: Specify the task the Databricks - Run Job Snap must perform in this field.

b. Notebook path: Specify the path to the Databricks notebook that contains the code to be executed. This path indicates the location within the Databricks environment where the notebook is stored.

c. Cluster: Specify the cluster on which the job must be executed. The cluster configuration (including computational resources) is predefined and identified by this name and ID.

d. Interval check (seconds): Specify the frequency (in seconds) at which the Snap will check the status of the running job. In this case, it will check every 10 seconds.

Databricks - Run Job Configuration

Databricks - Run Job Output

databricks-run-job-config.pngImage Added

databricks-run-job-output.pngImage Added

Step 2: Configure the Mapper Snap to store the result status of the Databricks - Run Job Snap. On validation, the Mapper Snap displays the job success message.

...

Downloads

Attachments
patterns*.slp

...

Snap Pack History

...

Expand

...

Insert excerpt

...

Databricks Snap Pack

...

Databricks Snap Pack

...

Related Content

...

Endpoint Doc Link 1

...

Endpoint Doc Link 2

...

nameDatabricks Snap Pack History
nopaneltrue

Related Content