What is Azure Databricks workshop?

Unlock Data Mastery with Azure Databricks

10/11/2018

Rating: 4.12 (9749 votes)

In the rapidly evolving landscape of big data and artificial intelligence, mastering scalable data platforms is paramount. Azure Databricks stands out as a formidable, unified analytics platform that accelerates innovation by bringing together data engineering, machine learning, and data science workflows. For professionals keen to harness its full potential, understanding its core capabilities, practical applications, and available resources is crucial. This article delves into a renowned workshop, explores a powerful integration, and guides you through accessing valuable datasets, all designed to empower your data journey.

Where can I find sample datasets in azure Databricks?
There are a variety of sample datasets provided by Azure Databricks and made available by third parties that you can use in your Azure Databricks workspace. Unity Catalog provides access to a number of sample datasets in the samples catalog.
Table

The Azure Databricks NYC Taxi Workshop: Your Blueprint for Data Excellence

The Azure Databricks NYC Taxi Workshop is a comprehensive, free, multi-part programme meticulously designed to provide a deep dive into working with Azure Data Services from Spark on Databricks. It offers a practical, end-to-end experience, moving from foundational concepts to advanced data engineering and machine learning applications. This community-driven initiative focuses on real-world datasets, ensuring participants gain invaluable, hands-on experience.

Workshop Objectives and Audience

The primary goal of this workshop is to deliver a clear understanding of how to provision and configure Azure data services, and critically, how these services seamlessly integrate with Spark on Azure Databricks. Participants will gain end-to-end experience with basic data engineering and data science on the platform, leaving with boilerplate code readily applicable to their own projects.

This workshop is ideally suited for a diverse range of data professionals, including:

  • Architects: Gaining insights into solution design and integration patterns.
  • Data Engineers: Learning to build robust and scalable data pipelines.
  • Data Scientists: Understanding how to leverage Databricks for advanced analytics and machine learning.

Essential Prerequisites for Participation

To maximise your learning experience, certain prerequisites are beneficial:

  • Prior knowledge of Spark is highly advantageous.
  • Familiarity and practical experience with Scala or Python programming languages.
  • An Azure subscription with at least £200 credit is recommended, as the workshop involves continuous usage for 10-14 hours.

Module Breakdown: A Journey Through Data

The workshop is structured into three distinct modules, each building upon the last to provide a holistic learning experience:

Module 1 - Primer: Integrating Azure Data Services

This foundational module focuses on the basics of integrating various Azure Data Services with Spark on Azure Databricks, both in batch mode and with structured streaming. By the end of this module, participants will be proficient in provisioning, configuring, and integrating Spark with:

  • Azure Storage: Including Blob Storage, ADLS Gen1, and ADLS Gen2, with a focus on Databricks Delta Lake.
  • Azure Event Hub: Learning to publish and subscribe to data streams, incorporating Databricks Delta.
  • HDInsight Kafka: Exploring batch and structured streaming integration, also with Databricks Delta.
  • Azure SQL Database & Data Warehouse: A primer on read/write operations in batch and structured streaming.
  • Azure Cosmos DB (Core API - SQL API/Document Oriented): Covering read/write operations, including structured streaming aggregation computation.
  • Azure Data Factory: Automating Spark notebooks in Azure Databricks using Azure Data Factory version 2.
  • Azure Key Vault: For secure secrets management within your applications.

The labs in this module leverage the public Chicago crimes dataset, providing a practical context for learning these integrations.

Module 2 - Data Engineering Workshop: Building Robust Pipelines

This module is specifically batch-focused and delves into the building blocks required to stand up a comprehensive data engineering pipeline. It provides hands-on experience in transforming and preparing large datasets for analysis. The labs in this module make extensive use of the NYC taxi dataset, specifically the yellow and green taxi trips, allowing participants to work with realistic, large-scale data challenges.

Module 3 - Data Science Workshop: Machine Learning in Action

The final module focuses on data science and machine learning. It offers two versions to cater to different programming preferences:

  • The Scala version demonstrates the application of Spark MLLib models.
  • The PySpark version showcases the combined power of Spark ML and Azure Machine Learning services.

Key content covered in this module includes:

  • Performing feature engineering and feature selection activities.
  • Creating and connecting to an Azure Machine Learning (AML) service workspace.
  • Developing PySpark models and leveraging AML Experiment tracking.
  • Utilising Automated ML capabilities within AML.
  • Deploying the best-performing model as a REST API in a Docker container.

This module provides a complete lifecycle view of machine learning projects within the Databricks ecosystem, from data preparation to model deployment.

Seamless Integration: Posit and Databricks Unleashed

For data enthusiasts who thrive on uncovering stories within datasets, the strategic partnership between Posit (formerly RStudio) and Databricks offers a game-changing simplified experience. By combining Posit's RStudio Desktop with Databricks, you can effortlessly analyse data using familiar tools like dplyr, create stunning visualisations with ggplot2, and weave compelling data narratives with Quarto, all while leveraging data stored directly in Databricks.

The Power of Collaboration

Posit provides data scientists with user-friendly and code-first environments and tools tailored for data manipulation and code writing. Databricks, on the other hand, delivers a scalable, end-to-end architecture encompassing data storage, compute, AI, and governance. This synergy allows users to dive into any data stored on the Databricks Lakehouse Platform, from small datasets to large streaming data, with unparalleled ease and performance.

A key objective of this partnership is to significantly improve support for Spark Connect in R through sparklyr, simplifying the process of connecting to Databricks clusters via Databricks Connect. Future developments promise even more streamlined integration, automating many of the current setup steps.

Setting Up Your Environment for Integration

To embark on this integrated journey, a few setup steps are required. We'll use the New York City taxi trip record data, which boasts over 10,000,000 rows and a total file size of 37 gigabytes, as our example.

Saving Your Environment Variables

To use Databricks Connect, you'll need three crucial configuration items, obtainable from your Databricks account:

  1. Workspace Instance URL: This typically looks like https://databricks-instance.cloud.databricks.com/?o=12345678910111213.
  2. Access Token: Generate a new token from your User Settings under 'Developer' and 'Access Tokens'. Copy it immediately as it won't be shown again.
  3. Cluster ID: Obtain this from a currently running cluster within your workspace, found via the 'Compute' sidebar.

To keep sensitive information out of your code, it's best practice to set these as environment variables. The usethis package in R provides a handy function to open the .Renviron file. Set DATABRICKS_HOST for the URL, DATABRICKS_TOKEN for the access token, and DATABRICKS_CLUSTER_ID for the cluster ID. After saving the file, remember to restart your R session.

What is Azure Databricks workshop?
This is a multi-part (free) workshop featuring Azure Databricks. It covers basics of working with Azure Data Services from Spark on Databricks with Chicago crimes public dataset, followed by an end-to-end data engineering workshop with the NYC Taxi public dataset, and finally an end-to-end machine learning workshop.

Installing Required Packages

The sparklyr package is a powerful R package that facilitates working with Apache Spark directly from R. Connections made with sparklyr also leverage RStudio's Connections Pane for easy data navigation.

To access the latest capabilities, install the development versions of sparklyr and pysparklyr. sparklyr requires specific Python components for Databricks Connect, which can be set up using a helper function. Once installed, load sparklyr, which will automatically pick up your preset environment variables. Then, use spark_connect() with method = "databricks_connect" to establish the connection.

Retrieving and Analysing Your Data

Once connected, RStudio's Connections Pane allows you to browse data managed in Unity Catalog, mirroring the structure found in the Databricks Data Explorer. You can navigate from the top-level catalog down to specific tables, viewing columns and data types, and even previewing the first 1,000 rows.

The dbplyr package bridges R and databases, allowing you to treat remote database tables as in-memory data frames. It translates dplyr verbs into SQL queries, enabling you to work with database data using familiar R syntax. For instance, to access the NYC taxi trips data, you can use dbplyr's tbl() and in_catalog() functions, specifying the catalog, database, and table (e.g., samples.nyctaxi.trips).

With the data accessed, you can perform powerful data manipulations using dplyr. For example, you can filter out taxi fares below a certain threshold (e.g., £3.00, the initial cab fare), or summarise fare amounts to understand minimum, average, and maximum values. Visualisations using ggplot2 can then reveal insights, such as the distribution of fare amounts or how fares vary by time of day. This seamless workflow empowers data professionals to perform complex analyses and generate compelling visualisations directly from their RStudio environment, leveraging the scalable compute of Databricks.

Discovering Data: Where to Find Sample Datasets in Azure Databricks

Accessing relevant and realistic datasets is fundamental for any data project, whether for learning, testing, or building solutions. Azure Databricks provides several avenues to find and utilise sample datasets, catering to various needs and preferences.

Unity Catalog Datasets

Unity Catalog, Azure Databricks' unified governance solution, offers direct access to a variety of sample datasets within its samples catalog. These datasets can be easily reviewed in the Catalog Explorer UI and referenced directly in notebooks or the SQL editor using the <catalog-name>.<schema-name>.<table-name> pattern.

For instance, the nyctaxi schema (also known as a database) contains the trips table, which holds detailed information about New York City taxi rides. You can query the first 10 records using: SELECT * FROM samples.nyctaxi.trips LIMIT 10. Another valuable resource is the tpch schema, which contains data from the TPC-H Benchmark, useful for performance testing and complex query scenarios. You can list its tables with: SHOW TABLES IN samples.tpch.

Third-Party Sample Datasets in CSV Format

Azure Databricks simplifies the process of uploading third-party sample datasets in CSV format directly into your workspace. Many popular public datasets are available for download from various sources:

Sample DatasetDownload Location (Example)
The Squirrel CensusOn their Data webpage (Park Data, Squirrel Data, or Stories sections).
OWID Dataset CollectionTheir GitHub repository, within the datasets folder.
Data.gov CSV datasetsSearch results webpage, look for the 'Download' link next to the CSV icon.
Diamonds (Kaggle)On the dataset's webpage, 'Data' tab, next to diamonds.csv.
NYC Taxi Trip Duration (Kaggle)On the dataset's webpage, 'Data' tab, often within a ZIP file.

To use these datasets, first download the CSV file to your local machine, then upload it into your Azure Databricks workspace. Once uploaded, you can query the data using Databricks SQL or load it as a DataFrame in a notebook for further processing.

Third-Party Sample Datasets Within Libraries

Many third-party libraries, such as those found on Python Package Index (PyPI) or Comprehensive R Archive Network (CRAN), include sample datasets as part of their package. These are typically used for demonstrating library functionality or for quick testing.

Will posit & Databricks integrate?
In the future, Posit and Databricks will offer streamlined integration to automate many of these steps. Today, we'll take a tour of the enhanced sparklyr experience with the New York City taxi trip record data that has over 10,000,000 rows and a total file size of 37 gigabytes.

To use these, you would install the library on your Azure Databricks cluster. This can be done via the cluster user interface for compute-scoped libraries, or directly within a notebook for notebook-scoped Python or R libraries. Refer to the specific library provider's documentation for details on how to access these embedded datasets.

Databricks Datasets (databricks-datasets) Mounted to DBFS

Historically, Azure Databricks provided access to certain sample datasets mounted to DBFS (Databricks File System) under the /databricks-datasets path. While still accessible, it's important to note that Azure Databricks generally recommends against using DBFS and mounted cloud object storage for most use cases in Unity Catalog-enabled workspaces, favouring Unity Catalog for its enhanced governance and management capabilities.

Nevertheless, you can browse these legacy datasets from a Python, Scala, or R notebook using Databricks Utilities (dbutils). For example, to list all available Databricks datasets, you can execute:

display(dbutils.fs.ls('/databricks-datasets'))

Remember that the availability and exact location of these older Databricks datasets are subject to change.

Frequently Asked Questions About Azure Databricks & Data

What is the Azure Databricks NYC Taxi Workshop?

It's a free, multi-part online workshop designed to teach participants how to provision and integrate Azure data services with Spark on Azure Databricks. It provides end-to-end experience in data engineering and machine learning using real-world datasets like the NYC Taxi and Chicago Crimes data.

Who is the target audience for this workshop?

The workshop is aimed at Architects, Data Engineers, and Data Scientists who wish to deepen their practical knowledge and skills in using Azure Databricks for various data-related tasks.

What are the prerequisites for attending the workshop?

Beneficial prerequisites include prior knowledge of Spark, familiarity with Scala or Python, and an Azure subscription with sufficient credit (around £200 for 10-14 hours of continuous usage) to cover resource consumption.

Can I use R with Databricks for data analysis?

Absolutely! Thanks to a strategic partnership with Posit (RStudio), Databricks offers a simplified experience for R users. You can connect RStudio Desktop to Databricks and leverage powerful R packages like dplyr, ggplot2, and Quarto to analyse data stored in the Databricks Lakehouse Platform.

How do I connect Posit's RStudio to Databricks?

You need to configure environment variables in RStudio (.Renviron file) with your Databricks Workspace URL, Access Token, and Cluster ID. Then, install the development versions of sparklyr and pysparklyr packages, and use the spark_connect() function with method = "databricks_connect" to establish the connection.

Where can I find sample datasets in Azure Databricks?

You can find sample datasets in several locations:

  • Unity Catalog: Within the samples catalog (e.g., samples.nyctaxi.trips).
  • Third-Party CSVs: Download from external sources like Data.gov or Kaggle, then upload to your workspace.
  • Third-Party Libraries: Some Python (PyPI) or R (CRAN) packages include datasets.
  • DBFS Mounted Datasets: Legacy datasets under /databricks-datasets (accessed via dbutils.fs.ls), though Unity Catalog is now preferred for new use cases.

Conclusion: Empowering Your Data Journey

Azure Databricks continues to solidify its position as a leading platform for unified data analytics and AI. The NYC Taxi Workshop provides an unparalleled opportunity to gain practical, end-to-end experience in data engineering and machine learning, utilising real-world datasets. The seamless integration with Posit's RStudio empowers R users to leverage the scalable compute of Databricks with their familiar tools, opening new avenues for powerful data analysis and visualisation. Furthermore, the diverse range of sample datasets available ensures that you always have resources at your fingertips to learn, experiment, and build robust data solutions. By embracing these resources and capabilities, data professionals can significantly enhance their skills and drive impactful insights within their organisations.

If you want to read more articles similar to Unlock Data Mastery with Azure Databricks, you can visit the Taxis category.

Go up