Skip to content

[FEATURE REQUEST] Add ADBC (Arrow Database Connectivity) Data Source #54603

Open

Description

@tokoko

Add a native ADBC (Arrow Database Connectivity) data source to Spark, similar in spirit to the existing JDBC data source but built on the Arrow-native ADBC API.

ADBC is a database connectivity API standard under the Apache Arrow project. It provides a vendor-neutral, columnar alternative to JDBC/ODBC specifically designed for analytical workloads. ADBC drivers return result sets as streams of Arrow data rather than row-by-row, which eliminates expensive row-to-columnar conversions. Since spark itself is row-based, the effect is not as dramatic, but still noticeable.

Why (now):

  • There are mature native drivers for PostgreSQL, SQLite, DuckDB, Flight SQL, Snowflake, BigQuery, MySQL, SQL Server, Databricks and so on. It's also very easy to install (and locate) them on a system with dbc cli tool.
  • There is now good support for invoking ADBC from Java via JNI bindings to the C++ ADBC driver manager (see blog). This makes it practical to integrate ADBC into Spark's JVM-based architecture. Technically drivers can be implemented in java as well, but the quality of java implementations is pretty low, realistically one will almost almost use a native driver.
  • ADBC fits well with spark's columnar read support in data source v2. Generating ArrowColumnVectors from adbc is pretty straightforward. It can be a benefit for external spark accelerators like comet and (presumably photon).

I have a proof-of-concept implementation at spark-adbc that demonstrates the basic read path and not so scientific benchmarks vs jdbc. I'm willing to incrementally implement ADBC data source support upstream if there's interest from the community.

Activity

  1. Vishwaspatel2401 commented on Mar 5, 2026

    @Vishwaspatel2401

    HI @tokoko I would like to take a look at this

  2. HyukjinKwon commented on Mar 6, 2026

    @HyukjinKwon
    Member

    Spark can take Arrow batches directly. I think this is a good idea to have one but I think this would need an SPIP (https://spark.apache.org/improvement-proposals.html).

  3. tokoko commented on Mar 6, 2026

    @tokoko
    Author

    @HyukjinKwon sure, I can start working on drafting a document and share it here first before sending out on a mailing list. thanks!!

  4. holdenk commented on Mar 6, 2026

    @holdenk
    Contributor

    I think @devin-petersohn already did some of this too, would be good to sync.

  5. HyukjinKwon commented on Mar 7, 2026

    @HyukjinKwon
    Member
  6. devin-petersohn commented on Mar 9, 2026

    @devin-petersohn
    Contributor

    Happy to help/review!

  7. HyukjinKwon commented on Jun 15, 2026

    @HyukjinKwon
    Member

    FYI, I created https://github.com/HyukjinKwon/adbc-driver-spark that is ADBC with Spark Connect (not the datasource).

  8. tokoko commented on Jun 15, 2026

    @tokoko
    Author

    @HyukjinKwon I think Columnar's also working on something similar.

    Another FYI, I have two arrow PRs up that are "soft" prerequisites for the data source. please, do chime in.

  9. lidavidm commented on Jun 15, 2026

    @lidavidm
    Member

    (That would be https://github.com/adbc-drivers/spark. We would be interested in collaborating on an ADBC driver for Apache Spark, or talking about upstreaming it if there's interest!)

  10. holdenk commented on Sep 24, 2026

    @holdenk
    Contributor

    I'm also sort of interested in this, I've got an idea on how we could do something fun here to allow for parallel direct reads from execs too.

  11. holdenk commented on Sep 24, 2026

    @holdenk
    Contributor

    I agree though we probably need an SPIP (currently those are structured more around JIRA though)

  12. tokoko commented on Sep 24, 2026

    @tokoko
    Author

    @holdenk hey, I have a draft of the SPIP document in the repo. Should I turn it into a Google doc and we can collaborate there? I suppose a JIRA/formal proposal stuff can wait, but I can start on that as well if you think that's necessary.

    I've got an idea on how we could do something fun here to allow for parallel direct reads from execs too.

    I had two "types" of read parallelism in mind:

    • Driver-driven partitioning via AdbcStatement.executePartitions (Driver here refers to adbc driver, not the spark driver) - Spark calls executePartitions during planInputPartitions, adbc driver hands back opaque partition descriptors, one per Spark task.
    • Client-driven partitioning - this would basically mirror jdbc data source with partitionColumn / lowerBound / upperBound / numPartitions options.

    There's no reason why they can't be used together as well. Is that along the lines of what you were thinking?

  13. holdenk commented on Sep 24, 2026

    @holdenk
    Contributor

    That is! And yes google doc is a good way to collaborate.

  14. tokoko commented on Sep 24, 2026

    @tokoko
    Author

    trimmed the text down a bit and moved to a Google doc: SPIP: ADBC Data Source.

  15. holdenk commented on Oct 10, 2026

    @holdenk
    Contributor

    Thanks @tokoko , by any chance are you at community over code in Glasgow this week?

  16. tokoko commented on Oct 10, 2026

    @tokoko
    Author

    No, unfortunately I'm not 😔 I'll DM you on LinkedIn if you prefer to discuss anything more interactively.

  17. HyukjinKwon commented on Oct 11, 2026

    @HyukjinKwon
    Member

    Let's discuss here for better visibility :-).

  18. holdenk commented on Oct 11, 2026

    @holdenk
    Contributor

    I shared the Google doc with a few of the ADBC folks at Community over Code so hopefully we'll get some comments on the doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions