René's URL Explorer Experiment


Title: feat(datasource): add Java-implemented data sources by andygrove · Pull Request #65 · apache/datafusion-java · GitHub

Open Graph Title: feat(datasource): add Java-implemented data sources by andygrove · Pull Request #65 · apache/datafusion-java

X Title: feat(datasource): add Java-implemented data sources by andygrove · Pull Request #65 · apache/datafusion-java

Description: Which issue does this PR close? Closes #63. Rationale for this change Java users have no way to expose custom in-process tables (JDBC scans, in-memory collections, custom file formats, etc.) to DataFusion. This adds a minimal DataSource interface and the JNI wiring to register it on a SessionContext. The implementation mirrors the existing scalar-UDF JNI pattern. What changes are included in this PR? New public DataSource interface in org.apache.datafusion with Schema schema() and ArrowReader scan(BufferAllocator). SessionContext.registerDataSource(name, source) registers a Java-backed table; schema is captured at registration time. JniBridge.invokeDataSourceScan exports the user's ArrowReader through the Arrow C Data Interface (zero-copy). Native: JavaDataSource: TableProvider + JavaScanExec: ExecutionPlan in native/src/data_source.rs, plus the JNI entry point. Shared jthrowable_to_string helper lifted into native/src/jni_util.rs so the UDF and data-source paths share Java-exception formatting. New JdbcExample in the examples module demonstrating an end-to-end JDBC-backed DataSource: populates an H2 in-memory table, wraps a JDBC query in a JdbcDataSource, registers it, and runs an aggregation query. Streams batches via arrow-jdbc's ArrowVectorIterator wrapped in a small ArrowReader subclass — no IPC re-serialisation. Adds arrow-jdbc and com.h2database:h2 as examples-module deps. v1 scope: single partition, no projection or filter pushdown into Java (DataFusion projects/filters on top), no deregisterTable. Multi-partition, pushdown, and deregistration are listed as follow-ups in the user guide. Run the JDBC example with: ./mvnw -pl examples exec:exec -Dexec.mainClass=org.apache.datafusion.examples.JdbcExample Are these changes tested? Yes — eight integration tests in `core/src/test/java/org/apache/datafusion/DataSourceTest.java`: `SELECT *` happy path `UNION ALL` over the same registered table (multi-scan) Empty stream Column projection through DataFusion Two registered tables joinable in one query Schema-mismatch surfaces a readable error `scan()` throwing propagates the Java exception class and message `scan()` returning null is rejected with `IllegalStateException` The JDBC example is exercised end-to-end manually (output verified: aggregation produces `alice → 119.99` and `bob → 7.50` over the H2 fixture). It compiles as part of the standard `mvn package` build alongside the other example classes (`AddOneExample`, `DataFrameExample`, etc.) — none of which carry JUnit tests, by convention. Are there any user-facing changes? Yes — new public `DataSource` interface and `SessionContext.registerDataSource` method, plus a new user-guide page at `docs/source/user-guide/data-source.md` covering the API, contract, threading, errors, and v1 limitations. The runnable `JdbcExample` shows the API in action against an embedded H2.

Open Graph Description: Which issue does this PR close? Closes #63. Rationale for this change Java users have no way to expose custom in-process tables (JDBC scans, in-memory collections, custom file formats, etc.) to D...

X Description: Which issue does this PR close? Closes #63. Rationale for this change Java users have no way to expose custom in-process tables (JDBC scans, in-memory collections, custom file formats, etc.) to D...

Opengraph URL: https://github.com/apache/datafusion-java/pull/65

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:0c1b8d8a-3ea6-2b15-4302-53dc96c22748
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB964:3D1C6E:279256:378F90:6B046A40
html-safe-noncea252e03502980124c6f628e0f412e5b0074936699d1f0846551288817059a5d7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTY0OjNEMUM2RToyNzkyNTY6Mzc4RjkwOjZCMDQ2QTQwIiwidmlzaXRvcl9pZCI6Ijg2ODEwNzQzNzk2MzcxNTY0MTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac56d7b3b787bed81ce576e2013a4167c32cfb3b7c46a2435f53b8c62a3249c0f7
hovercard-subject-tagpull_request:3704687033
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/apache/datafusion-java/pull/65/files
twitter:imagehttps://avatars.githubusercontent.com/u/934084?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/934084?s=400&v=4
og:image:altWhich issue does this PR close? Closes #63. Rationale for this change Java users have no way to expose custom in-process tables (JDBC scans, in-memory collections, custom file formats, etc.) to D...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/apache/datafusion-java git https://github.com/apache/datafusion-java.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id1237105117
octolytics-dimension-repository_nwoapache/datafusion-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1237105117
octolytics-dimension-repository_network_root_nwoapache/datafusion-java
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/datafusion-java/pull/65/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F65%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F65%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=apache%2Fdatafusion-java
Reloadhttps://github.com/apache/datafusion-java/pull/65/files
Reloadhttps://github.com/apache/datafusion-java/pull/65/files
Reloadhttps://github.com/apache/datafusion-java/pull/65/files
apachehttps://github.com/apache
datafusion-javahttps://github.com/apache/datafusion-java
Codehttps://github.com/apache/datafusion-java
Issues10 (10)https://github.com/apache/datafusion-java/issues
Pull requests10 (10)https://github.com/apache/datafusion-java/pulls
Discussionshttps://github.com/apache/datafusion-java/discussions
Actionshttps://github.com/apache/datafusion-java/actions
Security and qualityhttps://github.com/apache/datafusion-java/security
Insightshttps://github.com/apache/datafusion-java/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fapache%2Fdatafusion-java%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fapache%2Fdatafusion-java%2Fissues%2Fnew%2Fchoose
andygrovehttps://github.com/andygrove
apache:mainhttps://github.com/apache/datafusion-java/tree/main
andygrove:feat/columnar-value-udfhttps://github.com/andygrove/datafusion-java/tree/feat/columnar-value-udf
Conversation 4 https://github.com/apache/datafusion-java/pull/65
Commits 18 https://github.com/apache/datafusion-java/pull/65/commits
Checks 2 https://github.com/apache/datafusion-java/pull/65/checks
Files changed https://github.com/apache/datafusion-java/pull/65/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/65/files
feat(datasource): add Java-implemented data sources https://github.com/apache/datafusion-java/pull/65/files#top
Show all changes 18 commits https://github.com/apache/datafusion-java/pull/65/files
b64accb build(native): add async-trait and futures deps for Java data sources andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/b64accb01587b35c25336a7920d8a6c93d56a15a
484cd12 refactor(native): lift jthrowable_to_string into shared jni_util module andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/484cd12314024110503b0d10c67be754cd8e5731
b699291 feat(datasource): add DataSource interface and SessionContext.registe… andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/b69929183011f1d48b547c49e795b7f0568f1047
e16a99e feat(native): add JavaDataSource TableProvider and JNI registration andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/e16a99eb60a563ed50746e710140607d40e6e9e8
79213dc docs(native): clarify JavaScanExec safety + schema check + JVM attach andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/79213dc8b4814cb0c3663a9aba6800c6d554ad78
9c60f3c feat(datasource)!: pass framework allocator to DataSource.scan andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/9c60f3c2316deb95b57098ab1f0ab42a43da10d4
cd03d90 test(datasource): cover repeated scans within a single query andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/cd03d90827512df27833c4a3623a0cfac863c963
1004f6c test(datasource): cover empty-stream scan andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/1004f6c50e0436bb33737dc3e3b660b1cb10316a
bf9c435 test(datasource): cover column projection through DataFusion andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/bf9c4355a2c8d7a26450cb637e7b80de0da10e77
0ff2d8c test(datasource): reject scan whose schema differs from registered sc… andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/0ff2d8c2cdb1d76b57b6219d26f3368a99c35e1f
248dc70 test(datasource): surface Java exception class and message from scan() andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/248dc7033023960caa95f1e134cb669878947eef
82d13fb test(datasource): reject null ArrowReader from scan() andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/82d13fbc7c4f06985ea53b9afae8618311f75f17
953fcf2 test(datasource): cover joining two registered Java data sources andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/953fcf23fbcffbe39719f5a4f1943a28fbe9204f
af57098 docs(datasource): document SessionContext.registerDataSource andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/af57098d7847a833423a00d5baa89290fd2fe817
a4eb41e docs(datasource): clarify scan() is per-physical-scan, not per-query andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/a4eb41e679e6b2a97afd55da29abb0b63c864605
82c740a feat(examples): add JDBC-backed DataSource example using H2 + arrow-jdbc andygrove May 18, 2026 https://github.com/apache/datafusion-java/pull/65/commits/82c740a73b94c18a2b2342c226587c6f404608ab
1df2bd2 refactor(datasource)!: rename DataSource API to TableProvider andygrove May 19, 2026 https://github.com/apache/datafusion-java/pull/65/commits/1df2bd2a5b71110b683ab6245a9de1e3e52f126b
9e8279d Merge remote-tracking branch 'apache/main' into feat/columnar-value-udf andygrove May 19, 2026 https://github.com/apache/datafusion-java/pull/65/commits/9e8279dfd1c49ef1210c63daea12480e18a48a9e
Clear filters https://github.com/apache/datafusion-java/pull/65/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/65/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/65/files
SessionContext.java https://github.com/apache/datafusion-java/pull/65/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
SimpleTableProvider.java https://github.com/apache/datafusion-java/pull/65/files#diff-f285b28a742c89335c157a6f0db023987c3085642bb79d123ff1ca24898c66f8
TableProvider.java https://github.com/apache/datafusion-java/pull/65/files#diff-55d0e8af086be99343cdf3d3a1a9cecebda447819176948fd3d558086c2f76a3
JniBridge.java https://github.com/apache/datafusion-java/pull/65/files#diff-d8782084eee38e7e495ad13caf3a16d2c19b6eb7a1c290c9423e4d7224a5f2f3
TableProviderTest.java https://github.com/apache/datafusion-java/pull/65/files#diff-0b44aed9776c150f2ac2ef7046c201b255911f6825677521fecd3075ad8da2c1
index.md https://github.com/apache/datafusion-java/pull/65/files#diff-c5d556935b075b3f69ce1807990a7d6a6c59e8ecb075ffdceb6d96bdea1e1ec0
table-provider.md https://github.com/apache/datafusion-java/pull/65/files#diff-9686d6b2fe834eeb5dd21441980f50e082fa03b3b5d502d43a3e202e7796d74f
pom.xml https://github.com/apache/datafusion-java/pull/65/files#diff-3b6e36d2658def9d7acba8e7dba313f73f237d0342df368a91fb84473dec8f9f
JdbcExample.java https://github.com/apache/datafusion-java/pull/65/files#diff-725bf8baaddd6f061f868c551e0c5fcd5aac3825dcc5c1469deefe1f3d0ebf1a
Cargo.lock https://github.com/apache/datafusion-java/pull/65/files#diff-078f375cfc74d2a2bae74160d7469389a54227046a6daec4edb0481597ec2aa8
Cargo.toml https://github.com/apache/datafusion-java/pull/65/files#diff-a1571d177cbc44d96f49c8f29b6340febcee141a0e26833931bcd78c5441fb55
jni_util.rs https://github.com/apache/datafusion-java/pull/65/files#diff-e2f1c915787e47817b4eb42b3633d80368df248d69ee2911c5ebad1d0c49dd2b
lib.rs https://github.com/apache/datafusion-java/pull/65/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
table_provider.rs https://github.com/apache/datafusion-java/pull/65/files#diff-38d9ab737d35717f547d476901756a0cdcbb27d73b954291203bd195abfca194
udf.rs https://github.com/apache/datafusion-java/pull/65/files#diff-1c9a0800b6151fc16f2965eb70c73bcf80208567d7d14d2f6f28de9f59cdda8a
core/src/main/java/org/apache/datafusion/SessionContext.javahttps://github.com/apache/datafusion-java/pull/65/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
View file https://github.com/andygrove/datafusion-java/blob/9e8279dfd1c49ef1210c63daea12480e18a48a9e/core/src/main/java/org/apache/datafusion/SessionContext.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/65/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/65/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/65/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/65/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
core/src/main/java/org/apache/datafusion/SimpleTableProvider.javahttps://github.com/apache/datafusion-java/pull/65/files#diff-f285b28a742c89335c157a6f0db023987c3085642bb79d123ff1ca24898c66f8
View file https://github.com/andygrove/datafusion-java/blob/9e8279dfd1c49ef1210c63daea12480e18a48a9e/core/src/main/java/org/apache/datafusion/SimpleTableProvider.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/65/{{ revealButtonHref }}
core/src/main/java/org/apache/datafusion/TableProvider.javahttps://github.com/apache/datafusion-java/pull/65/files#diff-55d0e8af086be99343cdf3d3a1a9cecebda447819176948fd3d558086c2f76a3
View file https://github.com/andygrove/datafusion-java/blob/9e8279dfd1c49ef1210c63daea12480e18a48a9e/core/src/main/java/org/apache/datafusion/TableProvider.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/65/{{ revealButtonHref }}
core/src/main/java/org/apache/datafusion/internal/JniBridge.javahttps://github.com/apache/datafusion-java/pull/65/files#diff-d8782084eee38e7e495ad13caf3a16d2c19b6eb7a1c290c9423e4d7224a5f2f3
View file https://github.com/andygrove/datafusion-java/blob/9e8279dfd1c49ef1210c63daea12480e18a48a9e/core/src/main/java/org/apache/datafusion/internal/JniBridge.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/65/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/65/files#diff-d8782084eee38e7e495ad13caf3a16d2c19b6eb7a1c290c9423e4d7224a5f2f3
https://github.com/apache/datafusion-java/pull/65/files#diff-d8782084eee38e7e495ad13caf3a16d2c19b6eb7a1c290c9423e4d7224a5f2f3
https://github.com/apache/datafusion-java/pull/65/files#diff-d8782084eee38e7e495ad13caf3a16d2c19b6eb7a1c290c9423e4d7224a5f2f3
Please reload this pagehttps://github.com/apache/datafusion-java/pull/65/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/65/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.