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
- Select Apps in the left navigation pane on the Anywhere Cloud Console.
-
Search for the required Cloudera AI Workbench instance.
Ensure that the status of the instance is Running.
-
Click on the name of the required instance.
A pane opens displaying the available information for the selected instance.
-
Click the URL of the selected Cloudera AI Workbench instance.
The Cloudera AI Workbench home page is displayed.
- Select Projects in the left navigation pane.
- Click Create Project to create a new project.
- Provide the project related details.
- Under Initial Setup, in the Template tab, choose PySparkConnect from the drop-down list..
- Click Create to create the project.
- Start a Session in the newly created project.
- Provide the session name and select your preferred Editor.
-
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
-
Configure the Connection Details:
-
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.
- Run the simple-config.py script to complete the configuration setup.
- Validate the connection.
- Run the spark_connect_example.py file to confirm successful connection via Spark Connect.
