GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(spark): DataSource V2 connector, Scala (4/6) by timsaucer · Pull Request #107 · apache/datafusion-java

Conversation

@timsaucer

@timsaucer timsaucer commented Jun 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Stacked PR series (6 parts) — splitting the Spark DataSource V2 connector.
All six target main. They build on each other, so review and merge in order — until the earlier parts merge, this PR's diff includes their changes too.

  1. build: Cargo workspace + native-common extraction (1/6) #104 — Cargo workspace + native-common extraction
  2. feat(spark): datafusion-spark-bridge Rust SDK (2/6) #105 — datafusion-spark-bridge Rust SDK
  3. feat(spark): connector Java SPI module (3/6) #106 — Spark connector Java SPI
    ➤ 4. feat(spark): DataSource V2 connector, Scala (4/6) #107 — Spark DataSource V2 connector (Scala)
  4. feat(spark): bridge scaffold generator (5/6) #108 — Bridge scaffold generator
  5. feat(examples): end-to-end Spark bridge demo (6/6) #109 — End-to-end examples

Purpose

The connector: a Spark DataSource V2 implementation over the Java SPI and the bridge SDK. Covers DSv2 wiring (source/table/scan/builder), the per-partition columnar read path with Arrow→Spark conversion, V2 predicate pushdown, a shared-scan mode backed by a per-executor refcounted cache, and SupportsReportPartitioning for shuffle elision.

These share the scan-mode model and scan builder, so they land as one unit. Includes the connector test suite and module README.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
timsaucer and others added 4 commits June 12, 2026 13:23
@timsaucer @claude
build: consolidate Rust crates into a Cargo workspace + extract nativ…
9f78869
…e-common

Move the standalone `native` crate into a root Cargo workspace and extract
shared JNI plumbing (error->exception mapping, Tokio runtime singleton,
StreamingReader) into a new `datafusion-jni-common` crate under `native-common/`.
`native/src/errors.rs` moves to `native-common/src/errors.rs`; the nine native
modules now import error/runtime helpers from `datafusion_jni_common`.

Build glue follows: single root `Cargo.lock`, `.cargo/config.toml` redirects
output to `rust-target/`, Makefile/CI/poms updated to build `--workspace` and
target `-p datafusion-jni`. Core javadoc build commands updated to match.

Pure refactor; no behavior change. First of a 6-PR stack splitting the Spark
DataSource V2 connector work.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@timsaucer @claude
feat(spark): add datafusion-spark-bridge SDK for static bridges
28efd7c
New `spark/bridge` workspace crate providing the `export_bridge!` macro that
generates the six JNI entry points a Spark connector bridge exposes
(providerSchemaIpc, createScan, partitionCount, executeStreamPartition,
executeStream, closeScan). Includes the options decoder, scan planning/execution
glue, and the Arrow type-widening layer (wraps any TableProvider for Spark type
compatibility).

Self-contained SDK with no Java/Scala coupling. Depends only on
datafusion-jni-common. Second of the 6-PR connector stack.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@timsaucer @claude
feat(spark): add Spark connector Java SPI module
fd9d42b
Introduce the `spark` Maven module and the pure-Java contracts a bridge
implements: BridgeProviderFactory (no-arg factory + scanBackend()), ScanBackend
(delegates to the bridge's JNI methods), NativeLibraryLoader (cdylib
extraction/loading), OptionsCodec (cross-language options encoder), PartitionInfo
(one entry per Spark task), and ReportedPartitioning (optional shuffle-elision
declaration).

Compiles standalone with no Scala main yet. Includes the two SPI-only tests
(OptionsCodecTest, BridgeProviderFactoryDefaultsTest). Third of the 6-PR stack.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@timsaucer @claude
feat(spark): Spark DataSource V2 connector (Scala)
5db93ae
The connector implementation on top of the Java SPI and the bridge SDK:
DatafusionSource/Table/Scan/ScanBuilder DSv2 wiring, per-partition columnar
read path (FfiStream + Arrow->Spark batch conversion), V2 predicate pushdown
(SparkPredicateTranslator), shared-scan mode with a per-executor refcounted
cache (SharedScanCache, SharedScanPartitionReader, NativeSharedScanResources,
PinnedSessionConfig), and SupportsReportPartitioning for shuffle elision.

These pieces share the DatafusionScanMode sealed trait and the scan builder, so
they land together. Includes the connector test suite and the module README.
DataSourceRegister SPI file registers DatafusionSource. Fourth of the 6-PR stack.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This was referenced Jun 12, 2026
build: Cargo workspace + native-common extraction (1/6) #104
Merged
feat(spark): datafusion-spark-bridge Rust SDK (2/6) #105
Closed
feat(spark): connector Java SPI module (3/6) #106
Closed
feat(spark): bridge scaffold generator (5/6) #108
Closed
feat(examples): end-to-end Spark bridge demo (6/6) #109
Closed
@timsaucer
timsaucer marked this pull request as draft June 12, 2026 11:41
@timsaucer

timsaucer commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

Heads-up from the foundation split (01-workspace-foundation): the RAT exclude <exclude>**/META-INF/services/**</exclude> was removed from the root pom.xml there because it was forward-referencing files that do not exist until this PR. This PR (04) is the first to add a META-INF/services registration file (spark/src/main/resources/META-INF/services/org.apache.spark.sql.sources.DataSourceRegister), which is a line-delimited FQCN list with no license header.

Action required: re-add the exclude to the root pom.xml RAT <excludes> block in this PR, or apache-rat:check will flag the file as unapproved once 01 is rebased in.

<!-- Spark DataSource SPI registration file (line-delimited FQCN list, no header) -->
<exclude>**/META-INF/services/**</exclude>
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@timsaucer

timsaucer commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

Repo-layout docs follow-up (from #104 review): #104 trimmed docs/source/contributor-guide/development.md. With the Scala connector landing here, the spark/ bullet should describe the full datafusion-java-spark DataSource V2 connector (Scala + Java, pure JVM) rather than the Java-SPI-only stage.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

timsaucer added a commit to timsaucer/datafusion-java that referenced this pull request Jun 12, 2026
@timsaucer @claude
fix: scope foundation docs/excludes to what 1/6 ships
3ff4fda
Address review feedback on the workspace-foundation PR:

- development.md: trim the repo-layout section to the crates this PR
  actually ships (native, native-common). It was forward-referencing
  spark/, spark/bridge, datafusion-spark-bridge, and examples/native --
  none of which exist until later PRs in the stack -- and called the
  member list "three" while listing four. Later PRs (apache#105/apache#106/apache#107/apache#109)
  carry notes to re-add their own slice when those dirs land.

- rat_exclude_files.txt: the Rust lockfile moved to the workspace root,
  so the stale native/Cargo.lock entry left the root Cargo.lock with no
  RAT exclude for the source-tarball check (check-rat-report.py). Point
  it at Cargo.lock.

- native-common: dedupe the panic-payload downcast -- StreamingReader::next
  now calls errors::panic_message instead of repeating the String/&str
  match inline.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@timsaucer timsaucer closed this Jun 30, 2026
@timsaucer
timsaucer deleted the split/04-spark-scala-connector branch June 30, 2026 19:32
timsaucer added a commit to timsaucer/datafusion-java that referenced this pull request Jun 30, 2026
@timsaucer @claude
fix: scope foundation docs/excludes to what 1/6 ships
8054c23
Address review feedback on the workspace-foundation PR:

- development.md: trim the repo-layout section to the crates this PR
  actually ships (native, native-common). It was forward-referencing
  spark/, spark/bridge, datafusion-spark-bridge, and examples/native --
  none of which exist until later PRs in the stack -- and called the
  member list "three" while listing four. Later PRs (apache#105/apache#106/apache#107/apache#109)
  carry notes to re-add their own slice when those dirs land.

- rat_exclude_files.txt: the Rust lockfile moved to the workspace root,
  so the stale native/Cargo.lock entry left the root Cargo.lock with no
  RAT exclude for the source-tarball check (check-rat-report.py). Point
  it at Cargo.lock.

- native-common: dedupe the panic-payload downcast -- StreamingReader::next
  now calls errors::panic_message instead of repeating the String/&str
  match inline.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@timsaucer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.