René's URL Explorer Experiment


Title: feat(loader): bundle native library inside the JAR by andygrove · Pull Request #77 · apache/datafusion-java · GitHub

Open Graph Title: feat(loader): bundle native library inside the JAR by andygrove · Pull Request #77 · apache/datafusion-java

X Title: feat(loader): bundle native library inside the JAR by andygrove · Pull Request #77 · apache/datafusion-java

Description: Which issue does this PR close? Part of #33 (work items 1 and 3). Cross-build CI matrix, Sonatype/Maven Central wiring, and release docs are deferred to follow-up PRs. Rationale for this change NativeLibraryLoader currently calls System.loadLibrary("datafusion_jni"), so consumers need to set java.library.path or install the .so/.dylib system-wide before importing the library. That's a barrier to publishing a Maven-Central artifact that just works. This PR adds the runtime piece of the fat-JAR design from #33: the loader can pull a platform-specific native library out of the JAR's resource tree, and the Maven build copies the locally-built datafusion_jni into that tree before packaging. What changes are included in this PR? NativeLibraryLoader: Tries System.loadLibrary first so users can still override the bundled library via java.library.path / LD_LIBRARY_PATH. On UnsatisfiedLinkError, detects the host OS/arch, looks up org/apache/datafusion///lib. on the classpath, extracts it to $TMPDIR/datafusion-java//, and loads via System.load. Hash-based directory naming lets concurrent JVMs sharing a temp directory converge on the same file; extraction uses ATOMIC_MOVE to avoid racing writers clobbering each other. OS/arch detection lives in a new package-private Platform class that maps the OS/arch combinations from the design in #33: linux/amd64, linux/aarch64, darwin/x86_64, darwin/aarch64 (with a stub for windows/.dll to make the future Windows port a build-matrix change). Maven (core/pom.xml): Per-platform profiles activate by host OS/arch and set datafusion.lib.os / datafusion.lib.arch / datafusion.lib.filename. A new maven-antrun-plugin execution at process-classes copies native/target//lib. into target/classes/org/apache/datafusion///lib., failing fast with a clear message if the native crate hasn't been built. -Ddatafusion.native.profile=release switches the source from debug to release. Drops -Djava.library.path=... from the surefire argline (and the equivalent argument from the examples module's exec-maven-plugin) so the test path now exercises the same resource-extraction code path users will hit. --add-opens=java.base/java.nio=ALL-UNNAMED stays. Are these changes tested? New PlatformTest covers OS detection (linux/darwin/windows), arch detection across amd64/x86_64/x64/aarch64/arm64 aliases, unsupported-platform error handling, library filename mapping per OS, and resource paths matching the spec in #33 exactly. Existing JNI-using integration tests now load the library via the resource-extraction path (since -Djava.library.path is gone). Full local mvn test is green on macOS aarch64 (229 tests, 13 skipped, 0 failures). Verified that the JAR contains org/apache/datafusion/darwin/aarch64/libdatafusion_jni.dylib and that the extracted copy lands under $TMPDIR/datafusion-java//. Other host platforms (linux/amd64, linux/aarch64, darwin/x86_64) will be exercised once the cross-build CI matrix lands. Are there any user-facing changes? The NativeLibraryLoader.loadLibrary() public API is unchanged. Behavior is strictly broader — code that previously needed java.library.path set still works, and code that depended only on the bundled lib now works too.

Open Graph Description: Which issue does this PR close? Part of #33 (work items 1 and 3). Cross-build CI matrix, Sonatype/Maven Central wiring, and release docs are deferred to follow-up PRs. Rationale for this change N...

X Description: Which issue does this PR close? Part of #33 (work items 1 and 3). Cross-build CI matrix, Sonatype/Maven Central wiring, and release docs are deferred to follow-up PRs. Rationale for this change N...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.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:70bcd7a6-fa14-13a7-a824-dd5325890c66
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9F98:34B9D4:542B79:77C72C:6B046A8A
html-safe-nonce73fca49e770618f560a44099fbecb33616f9882adc7395f006038a156877dca6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Rjk4OjM0QjlENDo1NDJCNzk6NzdDNzJDOjZCMDQ2QThBIiwidmlzaXRvcl9pZCI6IjM4Mzc5ODAzMjUwNzQ3MjU1MTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3e008797533ea971e293598505f784f4a2053339cd61892cbe437db20aab60aa
hovercard-subject-tagpull_request:3720203930
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/77/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? Part of #33 (work items 1 and 3). Cross-build CI matrix, Sonatype/Maven Central wiring, and release docs are deferred to follow-up PRs. Rationale for this change N...
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/77/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F77%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%2F77%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/77/files
Reloadhttps://github.com/apache/datafusion-java/pull/77/files
Reloadhttps://github.com/apache/datafusion-java/pull/77/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:fat-jar-loaderhttps://github.com/andygrove/datafusion-java/tree/fat-jar-loader
Conversation 5 https://github.com/apache/datafusion-java/pull/77
Commits 2 https://github.com/apache/datafusion-java/pull/77/commits
Checks 1 https://github.com/apache/datafusion-java/pull/77/checks
Files changed https://github.com/apache/datafusion-java/pull/77/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/77/files
feat(loader): bundle native library inside the JAR https://github.com/apache/datafusion-java/pull/77/files#top
Show all changes 2 commits https://github.com/apache/datafusion-java/pull/77/files
283e79e feat(loader): bundle native library inside the JAR andygrove May 21, 2026 https://github.com/apache/datafusion-java/pull/77/commits/283e79ee4b8aca3b865e0901be22381f211efdd2
9458b4e fix(loader): isolate native lib extraction and add Windows build profile andygrove May 25, 2026 https://github.com/apache/datafusion-java/pull/77/commits/9458b4e33b426404bd30825925a4eb3a71ea124c
Clear filters https://github.com/apache/datafusion-java/pull/77/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/77/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/77/files
pom.xml https://github.com/apache/datafusion-java/pull/77/files#diff-8d04401f1cc51365fe3e32f019cd720135ba920a1a7da7f19e9c9208478701fc
NativeLibraryLoader.java https://github.com/apache/datafusion-java/pull/77/files#diff-4d9fea3ed4c32dd4f5408b97e9424615d79733bb05b6c1eb6052ac8ef2376c0e
Platform.java https://github.com/apache/datafusion-java/pull/77/files#diff-a3a3cafde5da9f038ad5c602d87e87d49063e594c57462eb5849c43d4b75caf2
PlatformTest.java https://github.com/apache/datafusion-java/pull/77/files#diff-19b7816a66f2c09af44763165e5b95521922ba806bf1a92252234a3eb5f7ec0d
pom.xml https://github.com/apache/datafusion-java/pull/77/files#diff-3b6e36d2658def9d7acba8e7dba313f73f237d0342df368a91fb84473dec8f9f
core/pom.xmlhttps://github.com/apache/datafusion-java/pull/77/files#diff-8d04401f1cc51365fe3e32f019cd720135ba920a1a7da7f19e9c9208478701fc
View file https://github.com/andygrove/datafusion-java/blob/9458b4e33b426404bd30825925a4eb3a71ea124c/core/pom.xml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/77/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/77/files#diff-8d04401f1cc51365fe3e32f019cd720135ba920a1a7da7f19e9c9208478701fc
https://github.com/apache/datafusion-java/pull/77/files#diff-8d04401f1cc51365fe3e32f019cd720135ba920a1a7da7f19e9c9208478701fc
https://github.com/apache/datafusion-java/pull/77/files#diff-8d04401f1cc51365fe3e32f019cd720135ba920a1a7da7f19e9c9208478701fc
LantaoJinhttps://github.com/LantaoJin
May 21, 2026https://github.com/apache/datafusion-java/pull/77/files#r3280322316
Please reload this pagehttps://github.com/apache/datafusion-java/pull/77/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/apache/datafusion-java/pull/77/files
andygrovehttps://github.com/andygrove
May 25, 2026https://github.com/apache/datafusion-java/pull/77/files#r3298798259
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/apache/datafusion-java/pull/77/files
https://github.com/apache/datafusion-java/pull/77/files#diff-8d04401f1cc51365fe3e32f019cd720135ba920a1a7da7f19e9c9208478701fc
https://github.com/apache/datafusion-java/pull/77/files#diff-8d04401f1cc51365fe3e32f019cd720135ba920a1a7da7f19e9c9208478701fc
core/src/main/java/org/apache/datafusion/NativeLibraryLoader.javahttps://github.com/apache/datafusion-java/pull/77/files#diff-4d9fea3ed4c32dd4f5408b97e9424615d79733bb05b6c1eb6052ac8ef2376c0e
View file https://github.com/andygrove/datafusion-java/blob/9458b4e33b426404bd30825925a4eb3a71ea124c/core/src/main/java/org/apache/datafusion/NativeLibraryLoader.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/77/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/77/files#diff-4d9fea3ed4c32dd4f5408b97e9424615d79733bb05b6c1eb6052ac8ef2376c0e
core/src/main/java/org/apache/datafusion/Platform.javahttps://github.com/apache/datafusion-java/pull/77/files#diff-a3a3cafde5da9f038ad5c602d87e87d49063e594c57462eb5849c43d4b75caf2
View file https://github.com/andygrove/datafusion-java/blob/9458b4e33b426404bd30825925a4eb3a71ea124c/core/src/main/java/org/apache/datafusion/Platform.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/77/{{ revealButtonHref }}
Please reload this pagehttps://github.com/apache/datafusion-java/pull/77/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/77/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.