Spark Connect is a remote connection capability introduced in Apache Spark starting from version 3.4. The core concept is to separate the client from the Spark server. The client sends query requests to the remote Spark service via the gRPC protocol. After receiving the request, the server performs query optimization, task scheduling, and distributed computation, then returns the results to the client.
In this architecture, the client is only responsible for constructing the logical query plan (Unresolved Logical Plan) and receiving execution results. There is no need to start a full Spark Driver locally or interact directly with the Spark cluster. Users can use Spark's DataFrame and SQL capabilities in Notebooks, IDEs, or applications as they would with local libraries, while the actual computation is performed remotely. For more information about Spark Connect, refer to: Spark Connect community documentation.
EMR Serverless Spark Connect is a managed remote Spark connection service VolcanoEnginebuilt on Apache Spark Connect. Users can connect to the remote EMR Serverless Spark Connect App using the Python Client or Java Client provided by EMR, and leverage the elastic computing capabilities of Serverless Spark without the need to manage cluster creation, scaling, or maintenance.
The overall process can be summarized as: Users write Spark DataFrame / SQL code locally → The client sends the query plan to the EMR Serverless Spark Connect App → The server executes the actual computation and returns the results.
This approach bridges the local development environment and the remote production computing environment, allowing real data and the complete Spark runtime to be used for debugging and validation during the development phase.
Current client capabilities are divided into two parts:
Core capability comparison:
Capabilities | Java Client | Python Client | Note |
|---|---|---|---|
Create a new Spark Connect App | ✅ | ✅ | Supported on both clients |
Query an existing Spark Connect App | ✅ | ✅ | Supported on both clients |
Stop an existing Spark Connect App | ✅ | ✅ | Supported on both clients |
Query App status and Tracking URL | ✅ | ✅ | Supported on both clients |
Create SparkSession and connect to Spark Connect App | ✅ | ✅ | Supported on both clients |
Support configuring authentication information via environment variables | ✅ | ✅ | Supported on both clients |
Support automatically loading Spark configuration from | ✅ | ✅ | Supported on both clients |
Support manually specifying Spark configuration files and overriding the default directory loading logic | ✅ | ✅ | Supported on both clients |
Support common Spark parameter configuration | ✅ | ✅ | Supported on both clients |
Notebook progress display | ❌ | ✅ | Python enhancements, better suited for process feedback in Notebook scenarios. |
More user-friendly usage with Jupyter / IPython | ❌ | ✅ | Python enhancements, better suited for interactive analysis and Python ecosystem integration. |
Select the corresponding client environment based on the Spark version of the target Spark Connect App.
Target Spark Connect App version | Java Client | Python environment | Note |
|---|---|---|---|
Spark 3.5.1 | Use the Java Client JAR corresponding to Spark 3.5.1 | pyspark3.5.1,py4j0.10.9.7 | The Python Client wheel is universal, but the pyspark version must match |
Spark 4.1.2 | Use the Java Client JAR corresponding to Spark 4.1.2 | pyspark4.1.1,py4j0.10.9.9 | The Python Client wheel is universal, but the pyspark version must match |
tip
There is only one Python Client wheel, but the pyspark version in the runtime environment must match the major Spark version of the target Spark Connect App.
Spark Connect uses a client-server separation architecture, so some traditional Spark local mode or internal Driver capabilities cannot be used directly. The main current limitations are as follows:
pyspark / py4j versions of the Python Client must match the Spark version of the target Spark Connect App. The Java Client requires selecting the JAR corresponding to the target Spark version.serverId + getOrCreate() to connect to an existing Spark Connect App to avoid duplicate creation.spark.stop() to release the current SparkSession.addArtifact. For detailed operations, see Add Spark Connect App dependencies.The main steps for using EMR Serverless Spark Connect are as follows:
To view job progress and job runtime information, you can use plugins to enhance the job management experience. For detailed operations, refer to Job management: Notebook progress bars and UI plugins.