Spark Connect usage
Cloudera AI integrates with Apache Spark through a decoupled Spark Connect architecture that allows Spark code authored in Cloudera AI to run on Cloudera Data Engineering.
The following technical requirements and operational details apply to using Spark Connect
requires the following considerations:
-
Point your Cloudera AI sessions to a remote Spark URL using the folllowing syntax:
spark = SparkSession.builder.remote("sc://connection-url").getOrCreate() -
Spark Connect is optimized for the modern DataFrame API, use
spark.createDataFrame()or standard SQL queries. - Upload data to an S3 or Azure Data Lake Storage (ADLS) bucket, or use the Spark Connect
copyFromLocalutility if available. - Navigate to Cloudera Data Engineering Spark History Server to view logs. Spark job logs are available in Cloudera Data Engineering at all times.
- Match your local Python environment to the major version of the remote Spark engine to avoid serialization errors.
-
Use Fine-Grained Access Control (FGAC), which is also supported by Cloudera Data Engineering for Spark Connect sessions.
- Run operations by triggering actions, such as
.show(),.collect(), or .save().
