Delete file action - The delete file action deletes a file from the Databricks Unity Catalog (UC)using a specified session.

Automation 360

The delete file action deletes a file from the Databricks Unity Catalog (UC)using a specified session.

Prerequisites

  • The file to be deleted must be in a UC-managed volume.
  • The authenticating identity must hold the appropriate UC permissions to delete from the target volume or path. The required permissions are:
    Object Minimum privilege Databricks navigation
    Catalog USE CATALOG
    1. In your Databricks workspace, click Catalog and select the catalog.
    2. Go to the Permissions tab and click Grant.
    3. Enter the email address for a user or the name of a group.
    4. Select the permissions to grant, select USE CATALOG and click Grant.
    Schema USE SCHEMA
    1. In Catalog Explorer, expand the catalog and select the target schema.
    2. Go to the Permissions tab, click Grant.
    3. Select the principal, select USE SCHEMA, and click Grant.
    Volume READ VOLUME, WRITE VOLUME
    1. In your Databricks workspace, click Catalog and search or browse for the volume and select it.
    2. Click the Permissions tab and click Grant.
    3. Type to search for a principal and select the principal.
    4. Select the privileges that you want to grant and click Grant.
    Important: Databricks recommends granting READ VOLUME and WRITE VOLUME at the catalog or schema level to cascade privileges to all contained volumes rather than granting per-volume.

    For more details about privileges, see Databricks privileges.

Settings

  • Use the Session field to select one of the following options:
    • Session name: Enter the name of the session used during Connect action.

      Click the Insert a value icon to select an existing variable that you have used to store the default session name.

    • Variable: Enter the name of the variable that you have used to store the session name.
  • Specify the UC aware file path of the file that you want to delete from the Databricks.

    For example, /Volumes/workspace/default/myfolder/file.txt

    Click the Insert a value icon to select an existing variable.

  • Select a variable that you want to use to store the output (Boolean value) from the Assign the output to variable list.

    Click the Create variable icon on the right to create a variable. See Create a variable.

    Result: If the file is deleted, the output is True. Otherwise, the output is False.