Setting up a Spark data connection

Cloudera AI on Anywhere Cloud supports only Spark Connect for user access to Spark.

Supported Spark versions:

  • Spark 4.1.3 - with Cloudera AI standalone
  • Spark 3.5.8 - with base cluster 7.3.2
  • Spark 3.5.4 - with base cluster 7.1.9
  1. Select Apps in the left navigation pane on the Anywhere Cloud Console.
  2. Search for the required Cloudera AI Workbench instance.
    Ensure that the status of the instance is Running.
  3. Click on the name of the required instance.
    A pane opens displaying the available information for the selected instance.
  4. Click the URL of the selected Cloudera AI Workbench instance.
    The Cloudera AI Workbench home page is displayed.
  5. Select Projects in the left navigation pane.
  6. Click Create Project to create a new project.
  7. Provide the project related details.
  8. Under Initial Setup, in the Template tab, choose PySparkConnect from the drop-down list..
  9. Click Create to create the project.
  10. Start a Session in the newly created project.
  11. Provide the session name and select your preferred Editor.
  12. Toggle on Enable Spark, and select the matching Spark Connect version from the drop-down list:
    • Spark Connect 3.5.4 (Data Connectors 7.1.9) - for base cluster 7.1.9
    • Spark Connect 3.5.8 (Data Connectors 7.3.2) - for base cluster 7.3.2
    • Spark Connect 4.1.3 - for Cloudera AI standalone
  13. Configure the Connection Details:
  14. Open the simple_config.py file and fill in the necessary variables:
    • de-endpoint - Provide the endpoint URL for the Jobs API.
    • awc-endpoint - Provide the Anywhere Cloud endpoint URL.
    • awc_client_id - Provide the Anywhere Cloud client ID.
    • awc_client_secret - Provide the Anywhere Cloud client secret.
  15. Run the simple-config.py script to complete the configuration setup.
  16. Validate the connection.
  17. Run the spark_connect_example.py file to confirm successful connection via Spark Connect.