Running RSparkling on Databricks Azure Cluster

Sparkling Water, PySparkling and RSparkling can be used on top of Databricks Azure Cluster. This tutorial is the RSparkling.

For Scala Sparkling Water, please visit Running Sparkling Water on Databricks Azure Cluster and for PySparkling, please visit Running PySparkling on Databricks Azure Cluster.

To start Sparkling Water H2OContext on Databricks Azure, the steps are:

  1. Login into Microsoft Azure Portal

  2. Create Databricks Azure Environment

    In order to connect to Databricks from Azure, please make sure you have created the user inside Azure Active Directory and using that user for the Databricks Login.

  3. Create the cluster

    • For Sparkling Water select Spark 3.2.4

    It is advised to always use the latest Sparkling Water and Spark version for the given Spark major version.

    Configured cluster ready to be started
  4. Create a R notebook and attach it to the created cluster. To start H2OContext, the init part of the notebook should be:

    # Install Sparklyr
    # Install H2O (3.44.0)
    install.packages("h2o", type = "source", repos = "")
    # Install RSparkling
    install.packages("rsparkling", type = "source", repos = "")
    # Connect to Spark on Databricks
    sc <- spark_connect(method = "databricks")
    # Start H2O context
  1. And voila, we should have H2OContext running

    Running H2O Context
  2. Flow is accessible via the URL printed out after H2OContext is started. Internally we use open port 9009. If you have an environment where a different port is open on your Azure Databricks cluster, you can configure it via spark.ext.h2o.client.web.port.