2. What is notebook
Creating notebook
Magic commands
Databricks Utilities
Import project solution notebook
3. Commands
➢ You can use multiple languages in
one notebook
➢ You need to specify language magic
command at the beginning of a
cell.
➢ By default, the entire notebook will
work on the language that you
4. Use of utilities
● Make easy to combine different types of task in
a single notebook
● Allow to combine file operations with ETL task
● File system Utilities
● Secrete Utilities
● Widgets Utilities
● Notebook workflow Utilities
5. DBUtils
➢ Azure Databricks provides set of utilities to efficiently interact with your
notebooks
➢ Most commonly used DBUtils are:
○ File System Utilities
○ Widget Utilities
○ Notebook Utilities
6. File System Utilities
➢ dbutils.fs provides utilities for working with File Systems. Below are the available
utilities
○ cp : Copies a file or directory, possibly across FileSystems
○ head : Returns up to the first 20 records
○ ls : Lists the contents of a directory
○ mkdirs : Creates the given directory if it does not exist, also creating any
necessary parent directories
○ mv :Moves a file or directory, possibly across FileSystems
○ put : Writes the given String out to a file
○ rm : Removes a file or directory
7. Widgets Utilities
Dbutils.Widgets Utilities helps to gets the input value using parameters. Widget types
are:
➢ combobox : Creates a combobox input widget with a given name, default value
and choices
➢ dropdown : Creates a dropdown input widget a with given name, default value
and choices
➢ get : Retrieves current value of an input widget
8. Widgets Utilities
➢ multiselect : Creates a multi select input widget with a given name, default value
and choices
➢ remove : Removes an input widget from the notebook
➢ removeAll : Removes all widgets in the notebook •
➢ text : Creates a text input widget with a given name and default value
9. Notebook Utilities
➢ Invove one notebook through others.
➢ Exit : This method lets you exit a notebook with a value
➢ Run : This method runs a notebook and returns its exit value
10. DBFS (Databricks file system)
• To upload files in
databricks file system go to
user settings,
• Go to advance -> other ->
and enable DBFS file
browser
• Refresh the page after DBFS
file Browser Enabled