Skip to main content

adbc-driver-spark (Python)

Apache Arrow ADBC driver for Apache Spark Connect.

It lets you run SQL against a Spark Connect server and get results back as Apache Arrow, with a standard ADBC and DBAPI 2.0 (PEP 249) interface. The package bundles a native shared library built from Go, so there is no JVM and no PySpark dependency.

Install

pip install adbc-driver-spark

Optional extras: adbc-driver-spark[pandas] for fetch_df(), adbc-driver-spark[polars] for Polars output.

Quickstart (DBAPI 2.0)

import adbc_driver_spark.dbapi as dbapi

with dbapi.connect("sc://localhost:15002") as conn:
    with conn.cursor() as cur:
        cur.execute("SELECT id, id * 2 AS doubled FROM range(5)")
        print(cur.fetchall())
        # Arrow / pandas in one shot:
        cur.execute("SELECT * FROM range(1000)")
        table = cur.fetch_arrow_table()   # pyarrow.Table
        df = cur.fetch_df()               # pandas.DataFrame (needs [pandas])

Connect to a secured server with a bearer token (TLS is implied):

conn = dbapi.connect("sc://my-host:443", token="my-jwt-token")

Low level ADBC

import adbc_driver_spark

db = adbc_driver_spark.connect(
    "sc://localhost:15002",
    db_kwargs={adbc_driver_spark.DatabaseOptions.USER_AGENT.value: "my-app/1.0"},
)
db.close()

Options

See adbc_driver_spark.DatabaseOptions. Everything that can go in the connection string (sc://host:port/;token=...;use_ssl=true) can also be passed via db_kwargs.

Development

The native library libadbc_driver_spark.{so,dylib,dll} must sit inside the adbc_driver_spark/ package directory (or on the loader path) at runtime. From a source checkout:

make python-dev      # builds the Go shared lib, copies it into the package,
                     # and `pip install -e python`
pytest python/tests  # unit tests run without a server; integration tests
                     # are skipped unless SPARK_CONNECT_URI is set

See the project documentation for the full guide.

Release files for adbc-driver-spark 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adbc-driver-spark 0.3.0
File Size Uploaded
adbc_driver_spark-0.3.0.tar.gz 15.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for adbc-driver-spark 0.3.0
File
adbc_driver_spark-0.3.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
adbc_driver_spark-0.3.0-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details
adbc_driver_spark-0.3.0-py3-none-manylinux_2_34_aarch64.whl Python 3 none Linux glibc 2.34+ ARM64 Details
adbc_driver_spark-0.3.0-py3-none-macosx_15_0_x86_64.whl Python 3 none macOS 15.0+ x86-64 Details
adbc_driver_spark-0.3.0-py3-none-macosx_14_0_arm64.whl Python 3 none macOS 14.0+ ARM64 Details

Total release size: 32.1 MB

Release files / adbc_driver_spark-0.3.0.tar.gz

Download URL adbc_driver_spark-0.3.0.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a36d5ea1772c0f5b69b34112dee600eb8fed9cfbb016605c1fda6fe0d5e6ca58
BLAKE2b-256 checksum
How to use checksums
75edff6144e559f5011dc8ec0a24fcd7685ce806f53aaa2ee7168aa0dc0905d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release files / adbc_driver_spark-0.3.0-py3-none-win_amd64.whl

Download URL adbc_driver_spark-0.3.0-py3-none-win_amd64.whl
Size 6.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
139c5fa9d2f56d0a9f9621271b34a7bed600ea29837ca90db3a5737486d56608
BLAKE2b-256 checksum
How to use checksums
efbbbf310398f682083906410afb3656828a0c24137d104a2166db22ac67c33b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release files / adbc_driver_spark-0.3.0-py3-none-manylinux_2_34_x86_64.whl

Download URL adbc_driver_spark-0.3.0-py3-none-manylinux_2_34_x86_64.whl
Size 6.8 MB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
d0aea98bfa425d802b8bcb2dfae0dba5f9d1d1f730e3241e6b043cd318d1212d
BLAKE2b-256 checksum
How to use checksums
a3d718224264169b46ad8c21c88b6290b2f7326ec254a4cea3247f6b784d10c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release files / adbc_driver_spark-0.3.0-py3-none-manylinux_2_34_aarch64.whl

Download URL adbc_driver_spark-0.3.0-py3-none-manylinux_2_34_aarch64.whl
Size 6.2 MB
Tags Linux glibc 2.34+ ARM64 Python 3
SHA-256 checksum
How to use checksums
170de4f5df157aabc59d843a19a23289dac79548d17be2c8cbd05a91d6879970
BLAKE2b-256 checksum
How to use checksums
5cd8013d04aff4292a2471cba8171d2e6f978717e97f5f393c3a4fd859529bdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release files / adbc_driver_spark-0.3.0-py3-none-macosx_15_0_x86_64.whl

Download URL adbc_driver_spark-0.3.0-py3-none-macosx_15_0_x86_64.whl
Size 6.5 MB
Tags Python 3 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
9d6fdedc5b8bdc5affb9cd2a8e89812b50cbaee97c1c7c16e3e1769d4a6b1d99
BLAKE2b-256 checksum
How to use checksums
3fecfb39511acb0663991360943d776ec0a809e191d1ee8e58da3bdb1b7d84d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release files / adbc_driver_spark-0.3.0-py3-none-macosx_14_0_arm64.whl

Download URL adbc_driver_spark-0.3.0-py3-none-macosx_14_0_arm64.whl
Size 6.0 MB
Tags Python 3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
70b75a6cdfd7c322b3a1605bfaa037bcd3b64be02d44cb14128e83888c1a2cd5
BLAKE2b-256 checksum
How to use checksums
123153c1ff2c3f18f6eda66dc78d1dee730e5b1cd360b6a7b25730c2c7a51de9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.3.0 This release

6 release files

0.2.0

6 release files

0.1.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page