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: support scan planning and pushdown for Java table providers by wirybeaver · Pull Request #119 · apache/datafusion-java

Conversation

@wirybeaver

@wirybeaver wirybeaver commented Oct 28, 2026

Copy link
Copy Markdown

Which issue does this PR close?

Closes #118.

Rationale for this change

Java table providers currently receive no physical scan request. A selective source cannot choose an access path from pushed predicates, read only projected columns, or distinguish exact filtering from candidate pruning. Expose that existing DataFusion contract while keeping the Java/JNI binding thin and source-agnostic.

What changes are included in this PR?

Add an opt-in ScanTableProvider with per-expression pushdown capabilities and immutable projection/filter/limit requests. It returns a lazy TableScan, separating source planning from opening an Arrow reader. Existing providers retain full-schema scans and native projection fallback.

DataFusion optimizer -> Java filter capabilities
DataFusion planning  -> planScan(request) -> lazy TableScan
DataFusion execution -> fresh ArrowReader -> Arrow C stream -> Rust operators

DataFusion still owns residual filtering and limit placement. Planned readers produce the requested projected schema, including zero-column batches that preserve row counts. Source-specific access-path decisions stay in provider implementations; no storage SDK or DataFusion Rust-core change is introduced.

This remains a bounded, single-partition leaf-scan API, not a binding for arbitrary child-consuming physical operators.

Are these changes tested?

A Java/JNI/Arrow integration harness registers an in-memory selective source and inspects its planned requests and actual reads. EXPLAIN plans without opening the source; execution requests only the matching row and projected column. Inexact and unsupported predicates retain residual evaluation before LIMIT, exact predicates permit limit pushdown, and independent scans keep separate requests and readers. The existing full-schema provider path is exercised through the same native boundary.

The source is synthetic: this does not establish performance or correctness against an external storage service.

Are there any user-facing changes?

The new ScanTableProvider, TableScanRequest and TableScan APIs are additive. Existing TableProvider and SimpleTableProvider implementations need no changes. The provider guide documents projection, filter, limit, threading and reader-ownership contracts.

Sorry, something went wrong.

Uh oh!

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

All reactions
@wirybeaver
wirybeaver force-pushed the feat/java-table-scan-pushdown branch from 268a98f to 0b3a113 Compare October 29, 2026 06:08
@wirybeaver
wirybeaver marked this pull request as ready for review October 29, 2026 14:58
@wirybeaver
wirybeaver marked this pull request as draft October 29, 2026 15:30
pgwhalen
pgwhalen reviewed Nov 1, 2026
View reviewed changes
Comment thread core/src/main/java/org/apache/datafusion/ScanTableProvider.java Resolved

Uh oh!

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

Comment thread core/src/main/java/org/apache/datafusion/ScanTableProvider.java Resolved

Uh oh!

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

Comment thread core/src/main/java/org/apache/datafusion/TableScanRequest.java Resolved

Uh oh!

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

Comment thread core/src/main/java/org/apache/datafusion/TableScan.java Resolved

Uh oh!

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

@wirybeaver
feat: support scan planning and pushdown for Java table providers
c1869ed
Expose scanWithArgs and filter capabilities as default TableProvider methods with immutable ScanArgs. Plan a lazy ExecutionPlan before execution while retaining existing full-schema providers; execute receives an explicit partition index.

Forward DataFusion filter capabilities and preserve residual-filter/limit semantics without source-specific dependencies or DataFusion-core changes. Cover the Java/JNI/Arrow path with selective-source integration tests.
@wirybeaver
wirybeaver force-pushed the feat/java-table-scan-pushdown branch from 0b3a113 to c1869ed Compare November 2, 2026 01:05
pgwhalen
pgwhalen approved these changes Nov 2, 2026
View reviewed changes
@wirybeaver
wirybeaver marked this pull request as ready for review November 2, 2026 06:10
@wirybeaver

wirybeaver commented Nov 2, 2026

Copy link
Copy Markdown
Author

@andygrove Would you mind taking a review of this PR? Our team's service is in Java and needs to pass customized execution plan.

All reactions

Sorry, something went wrong.

Uh oh!

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

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

Reviewers

1 more reviewer
@pgwhalen pgwhalen pgwhalen approved these changes
Reviewers whose approvals may not affect merge requirements

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.

Support source scan planning and pushdown for Java table providers

Uh oh!

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

2 participants

@wirybeaver @pgwhalen
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 01402503 — 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.