Jump to content

pyspark-client

From Open Lakehouse Wiki
pyspark-client
Developer Apache Software Foundation (Apache Spark project)
Initial release 4.0.0 (2025-05-23)
Latest release 4.3.0
(2026-10-30)
Written in Python
Type Pure-Python Spark Connect client library
License Apache License 2.0
Website pypi.org/project/pyspark-client
Repository github.com/apache/spark (python/packaging/client)
Related Spark Connect, Apache Spark, Pandas API on Spark
Last verified 23 November 2026 against the pyspark-client, pyspark and pyspark-connect release histories and metadata on PyPI (latest 4.3.0, uploaded 2026-10-30), python/packaging/client/setup.py and python/packaging/classic/setup.py at tags v4.0.0 and v4.3.0, python/docs/source/getting_started/install.rst at v4.0.0 and v4.3.0, docs/spark-connect-overview.md at v4.3.0, the Spark 4.0.0 release notes and SPARK-47540.

pyspark-client is the pure-Python Spark Connect client for Apache Spark, published on PyPI, which lets a Python program use the PySpark DataFrame, SQL and streaming APIs against a remote Spark Connect server without a Java runtime or Spark JAR files on the client machine.[1] The package was first released with Spark 4.0.0, and its version numbers follow Spark releases.[2] It is installed with pip install pyspark-client and supports only remote connections through spark.remote with an sc:// connection URI.[1]

What is pyspark-client?

pyspark-client is a separate distribution of the PySpark source tree that contains only Python code. The Spark installation guide describes it as a pure Python library that does not depend on non-Python components such as JARs or a Java Runtime Environment (JRE).[1] The PyPI package name is pyspark-client; the import name stays pyspark, so code written for Spark Connect runs unchanged.[3]

The Spark 4.0.0 release notes list "a new lightweight Python client (pyspark-client) at just 1.5 MB" among the Spark Connect changes of that release.[4] On PyPI, the 4.3.0 source distribution of pyspark-client is 1,745,601 bytes, while the 4.3.0 source distribution of the full pyspark package, which bundles the Spark JARs, is 455,910,862 bytes.[2][5]

How is pyspark-client installed and used?

pyspark-client 4.3.0 requires Python 3.11 or later and installs pandas (2.2.0 or later), PyArrow (18.0.0 or later), grpcio and grpcio-status (1.76.0 or later), googleapis-common-protos, zstandard, NumPy and PyYAML as dependencies.[3] The 4.0.0 release required Python 3.9 or later.[6]

The Spark Connect documentation recommends pinning the client to the Spark release in use, for example pip install pyspark-client==4.3, and then creating a session with SparkSession.builder.remote().[7] The server side is a Spark Connect server, which by default listens on port 15002; see Spark Connect.[7]

# pip install pyspark-client==4.3.0
from pyspark.sql import SparkSession
from pyspark.sql import functions as F

spark = SparkSession.builder.remote("sc://localhost:15002").getOrCreate()

df = spark.range(10).withColumn("even", F.col("id") % 2 == 0)
df.groupBy("even").count().show()

What is missing compared with PySpark?

pyspark-client leaves out the parts of PySpark that need a local JVM. Compared with the classic pyspark package at v4.3.0, its package list omits pyspark.core (the module that holds SparkContext, RDD and broadcast variables), pyspark.sql.classic (the Py4J-based DataFrame implementation), and the bundled jars, bin and sbin directories.[3][8] It also does not depend on Py4J, which the full package requires.[3][5]

Because pyspark-client speaks only the Spark Connect protocol, the general Spark Connect limits apply to it. The Spark documentation lists them: the client cannot reach the driver JVM, so private fields such as df._jdf do not exist; RDDs are not supported; and the client has no access to SparkContext or to the static Spark configuration.[7] The RDD API is therefore unavailable, and code that calls spark.sparkContext must be rewritten with DataFrame APIs.

pyspark-client cannot start Spark by itself. The installation guide says it supports only spark.remote with connection URIs; it has no local mode, and the user must run a Spark Connect server separately.[1] The SPIP that proposed the pure-Python package also excluded full compatibility with classic PySpark (such as the RDD API), launching the server and local mode from its scope.[9]

Most of the PySpark API is still present. The package includes pyspark.sql with its Spark Connect implementation, Structured Streaming, pyspark.ml, the Pandas API on Spark (pyspark.pandas) and the pyspark.pipelines module of Spark Declarative Pipelines.[3] The Spark API reference labels each API that "Supports Spark Connect".[7]

How does pyspark-client differ from pyspark and pyspark-connect?

Spark publishes three Python packages from the same source tree:[1][3][8]

PyPI package Contents Bundles Spark JARs Connection modes
pyspark-client Python code only; no JARs, no Py4J No spark.remote with an sc:// URI only
pyspark Full PySpark with the Spark JARs and Py4J; Spark Connect available through the connect extra Yes Classic (Py4J) and Spark Connect
pyspark-connect A small package that depends on the same version of pyspark and makes Spark Connect the default Yes, through its pyspark dependency spark.master with a local Connect server, or spark.remote

The pyspark-connect 4.3.0 package on PyPI depends on pyspark==4.3.0, so it brings in the full JVM-backed distribution; pyspark-client does not.[10]

History

The pure-Python package was proposed in SPARK-47540, "SPIP: Pure Python Package (Spark Connect)", filed on 25 March 2024 with fix version 4.0.0.[9] The SPIP text used the name pyspark-connect; in the released code the pure-Python package is named pyspark-client, and pyspark-connect became the package that makes Connect the default for full PySpark.[9][6] The Spark 4.0.0 release notes list SPARK-47540 and the 1.5 MB client.[4]

pyspark-client 4.0.0 was uploaded to PyPI on 23 May 2025, the release date of Spark 4.0.0. Later releases track Spark: 4.1.0 (16 December 2025), 4.2.0 (14 July 2026) and 4.3.0 (30 October 2026), with maintenance releases for older lines, such as 4.2.1, 4.1.4 and 4.0.5 on 27 October 2026.[2]

See also

References

  1. ↑ 1.0 1.1 1.2 1.3 1.4 Installation (python/docs/source/getting_started/install.rst at v4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
  2. ↑ 2.0 2.1 2.2 pyspark-client release history. Python Package Index.Retrieved 2026-11-23.
  3. ↑ 3.0 3.1 3.2 3.3 3.4 3.5 python/packaging/client/setup.py (v4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
  4. ↑ 4.0 4.1 Spark Release 4.0.0. Apache Software Foundation.Retrieved 2026-11-23.
  5. ↑ 5.0 5.1 pyspark 4.3.0 (files). Python Package Index.Retrieved 2026-11-23.
  6. ↑ 6.0 6.1 python/packaging/client/setup.py (v4.0.0). Apache Software Foundation.Retrieved 2026-11-23.
  7. ↑ 7.0 7.1 7.2 7.3 Spark Connect Overview (docs/spark-connect-overview.md at v4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
  8. ↑ 8.0 8.1 python/packaging/classic/setup.py (v4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
  9. ↑ 9.0 9.1 9.2 SPARK-47540: SPIP: Pure Python Package (Spark Connect). Apache Software Foundation JIRA.Retrieved 2026-11-23.
  10. ↑ pyspark-connect 4.3.0. Python Package Index.Retrieved 2026-11-23.