This action enables you to upload a file from a local, Control Room, or variable-defined path to the Databricks Unity Catalog (UC), allowing you to specify the destination location, optionally overwrite existing files, and capture the operation result in a variable.
Prerequisites
- Files must be uploaded to UC volumes, not directly to cloud storage paths. UC volumes are the required staging location for non-tabular or unstructured data.
- Ensure that the files are created using the UC naming conventions such as, /Volumes/catalog/schema/volume/filename.txt.
- The authenticating identity must hold write permissions on the target UC
volume. The following permissions are required to update a new file to the
volume:
Object Minimum privilege Databricks navigation Catalog USE CATALOGRefer Delete file action prerequisites (Databricks navigation) Schema USE SCHEMAVolume READ VOLUME,WRITE VOLUMEImportant:- Databricks recommends granting
READ VOLUMEandWRITE VOLUMEat the catalog or schema level to cascade privileges to all contained volumes rather than granting per-volume. - If the destination volume does not yet exist and must be created
as part of setup: creating a managed volume requires
USE CATALOGon the catalog, andUSE SCHEMAwithCREATE VOLUMEon the schema.
For more details about privileges, see Databricks privileges.
- Databricks recommends granting
Settings
- Use the Session name field to select one of the following
options:
- Session name: Enter the name of the session used
during Connect
action.
(Optional) 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.
- Session name: Enter the name of the session used
during Connect
action.
- Source file path: Specify the full path of the file that
you want to upload to Databricks.
- Variable: Enables you to specify the file variable that contains the location of the file.
- Control Room file: Enables you to select the file that is available in a folder in the Control Room.
- Desktop file: Enables you to select the file that
is available on your device.
- Specific: Specify the name and location of the file.
- Regex: Specify the source folder
path.
You can use a regular expression (regex) in your source file or folder path to support a pattern-based search. Select the regular expression either as a String or Pattern for each regular expression condition and enter the value.
Click Add regex to add more file paths using Regex.
- Destination path: Specify the UC aware destination file
path in Databricks where you want to upload the file. The
input must be a folder path.
For example, /Volumes/workspace/default/myfolder/file.txt
- Overwrite file: Select this option to overwrite an
existing local file with the same name.
If the Overwrite file option is unchecked and a file with the same name already exists, the upload will fail with an error message.
- Assign output to a variable: Create or choose a
Boolean variable to store the result of the upload
operation.
Stores the result of the upload operation (such as success status or response details) into a variable for further use, logging, or error handling.