Mapping for dbutils and sfutils

This document provides a reference mapping between Databricks dbutils utilities and their Snowflake sfutils equivalents. When migrating notebooks from Databricks to Snowflake using the Snowpark Migration Accelerator (SMA), these utility functions are automatically translated to their corresponding Snowflake implementations.

The dbutils library in Databricks provides a set of utility functions for working with files, notebooks, and widgets. In Snowflake, the equivalent functionality is provided through the sfutils library, which offers compatible methods designed to work seamlessly within the Snowflake environment.

File System Utilities

The file system utilities allow you to interact with cloud storage and manage files. These functions enable common file operations such as copying, moving, listing, and deleting files.

DatabricksSnowflake
dbutils.fssfutils.fs
dbutils.fs.cpsfutils.fs.cp
dbutils.fs.headsfutils.fs.head
dbutils.fs.lssfutils.fs.ls
dbutils.fs.mkdirssfutils.fs.mkdirs
dbutils.fs.mvsfutils.fs.mv
dbutils.fs.putsfutils.fs.put
dbutils.fs.rmsfutils.fs.rm

Notebook Utilities

The notebook utilities provide functionality to run notebooks programmatically and control notebook execution flow. These are essential for orchestrating multi-notebook workflows and building modular data pipelines.

DatabricksSnowflake
dbutils.notebooksfutils.notebook
dbutils.notebook.runsfutils.notebook.run
dbutils.notebook.exitsfutils.notebook.exit

Widget Utilities

Widget utilities enable you to create interactive input controls in notebooks. These are useful for parameterizing notebooks and allowing users to provide input values at runtime without modifying the code.

DatabricksSnowflake
dbutils.widgetssfutils.widgets
dbutils.widgets.comboboxsfutils.widgets.combobox
dbutils.widgets.dropdownsfutils.widgets.dropdown
dbutils.widgets.getsfutils.widgets.get
dbutils.widgets.getAllsfutils.widgets.getAll
dbutils.widgets.getArgumentsfutils.widgets.getArgument
dbutils.widgets.multiselectsfutils.widgets.multiselect
dbutils.widgets.removesfutils.widgets.remove
dbutils.widgets.removeAllsfutils.widgets.removeAll
dbutils.widgets.textsfutils.widgets.text

Usage Notes

  • All dbutils calls in your Databricks notebooks are automatically translated to their sfutils equivalents during the migration process.
  • The function signatures and parameters remain consistent between the two implementations to ensure a smooth transition.
  • If you encounter any unsupported functionality, refer to the Snowflake documentation for alternative approaches.