René's URL Explorer Experiment


Title: feat(json): expose NdJsonReadOptions via registerJson and readJson by LantaoJin · Pull Request #47 · apache/datafusion-java · GitHub

Open Graph Title: feat(json): expose NdJsonReadOptions via registerJson and readJson by LantaoJin · Pull Request #47 · apache/datafusion-java

X Title: feat(json): expose NdJsonReadOptions via registerJson and readJson by LantaoJin · Pull Request #47 · apache/datafusion-java

Description: Which issue does this PR close? Closes #35 Rationale for this change DataFusion 53.x supports newline-delimited JSON via SessionContext::read_json / register_json, but the Java bindings only expose Parquet and CSV readers today. Users with NDJSON input have to fall back to CREATE EXTERNAL TABLE … STORED AS JSON through SessionContext.sql, which works but loses the typed-builder ergonomics the parquet/CSV bindings already provide. Issue #35 tracks closing that gap; this PR is the implementation. What changes are included in this PR? proto/json_read_options.proto — new NdJsonReadOptionsProto message. Reuses FileCompressionType from csv_read_options.proto (CSV and JSON accept the same compression set in DataFusion). NdJsonReadOptions Java builder with fileExtension, fileCompressionType, schemaInferMaxRecords, and an explicit Arrow schema(Schema). Defaults match the Rust struct (.json, UNCOMPRESSED, infer from data). SessionContext.registerJson(name, path[, options]) and readJson(path[, options]) overloads, structurally identical to the parquet/CSV entry points (Java builds the proto, JNI hands a byte[] to native). native/src/json.rs — JNI module that decodes NdJsonReadOptionsProto, constructs the upstream JsonReadOptions, and forwards to register_json / read_json. Imports prelude::JsonReadOptions rather than the deprecated NdJsonReadOptions alias; the user-facing Java/proto name still matches the issue ask. Out of scope (kept for follow-ups so each PR stays small): tablePartitionCols, fileSortOrder — neither parquet nor CSV exposes these in the Java surface today; adding them only for JSON would diverge. newline_delimited — DataFusion 53.x exposes the knob, but the JSON-array reader path is not yet stable upstream. Both the issue title and the Rust API name (NdJson) imply newline-delimited. AVRO source — separate issue. Are these changes tested? Yes. NdJsonReadOptionsTest (4 tests): defaults round-trip through proto, fully-configured options round-trip through proto, schema(Schema) is held by reference and not embedded in proto bytes, sweep over every FileCompressionType variant. SessionContextJsonTest (3 tests): registerJson + SQL COUNT(*) and projection on an inferred-schema NDJSON file, readJson with an explicit Arrow schema, registerJson with a custom .ndjson file extension. make test is green: 68 tests, 0 failures, 0 errors. The 12 skipped cases are pre-existing parquet/TPC-H data-dependent tests unaffected by this PR. cargo clippy --all-targets -- -D warnings, cargo fmt -- --check, and ./mvnw spotless:apply are all clean. Are there any user-facing changes? Yes — purely additive. New public API: org.apache.datafusion.NdJsonReadOptions SessionContext.registerJson(String, String) SessionContext.registerJson(String, String, NdJsonReadOptions) SessionContext.readJson(String) → DataFrame SessionContext.readJson(String, NdJsonReadOptions) → DataFrame No existing API changes; no deprecations.

Open Graph Description: Which issue does this PR close? Closes #35 Rationale for this change DataFusion 53.x supports newline-delimited JSON via SessionContext::read_json / register_json, but the Java bindings only expose...

X Description: Which issue does this PR close? Closes #35 Rationale for this change DataFusion 53.x supports newline-delimited JSON via SessionContext::read_json / register_json, but the Java bindings only expose...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4

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:d4c4491d-564e-1110-24b3-784c7d71f228
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB998:1E2FF8:8F25:C2D4:6B046A67
html-safe-nonce06a981aa210ec263adee90326e8ee60df66a1642e060cafb55537b227d9e1555
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTk4OjFFMkZGODo4RjI1OkMyRDQ6NkIwNDZBNjciLCJ2aXNpdG9yX2lkIjoiNTUyMzI0NjQ0NzQ0NzAwOTg5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac21049253524bb7dd63e6c96701cd821124561da13d53c299489062a5b2b48e0b
hovercard-subject-tagpull_request:3680227538
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/47/files
twitter:imagehttps://avatars.githubusercontent.com/u/1853780?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1853780?s=400&v=4
og:image:altWhich issue does this PR close? Closes #35 Rationale for this change DataFusion 53.x supports newline-delimited JSON via SessionContext::read_json / register_json, but the Java bindings only expose...
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/47/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F47%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%2F47%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/47/files
Reloadhttps://github.com/apache/datafusion-java/pull/47/files
Reloadhttps://github.com/apache/datafusion-java/pull/47/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
LantaoJin:feat/json-source-v2https://github.com/LantaoJin/datafusion-java/tree/feat/json-source-v2
Conversation 10 https://github.com/apache/datafusion-java/pull/47
Commits 3 https://github.com/apache/datafusion-java/pull/47/commits
Checks 1 https://github.com/apache/datafusion-java/pull/47/checks
Files changed https://github.com/apache/datafusion-java/pull/47/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/47/files
feat(json): expose NdJsonReadOptions via registerJson and readJson https://github.com/apache/datafusion-java/pull/47/files#top
Show all changes 3 commits https://github.com/apache/datafusion-java/pull/47/files
29503c0 feat(json): expose NdJsonReadOptions via registerJson and readJson LantaoJin May 14, 2026 https://github.com/apache/datafusion-java/pull/47/commits/29503c0e6d28cc9f2ad66ffab3e3d63cd5956d1a
9885fc2 Promote FileCompressionType into a new shared proto/file_compression_… LantaoJin May 15, 2026 https://github.com/apache/datafusion-java/pull/47/commits/9885fc26ef38206c9a8315fb6d489ea4d062683b
7765eec Reject negative schemaInferMaxRecords LantaoJin May 15, 2026 https://github.com/apache/datafusion-java/pull/47/commits/7765eec39d843adc9038ef5afa5f4d93064d479b
Clear filters https://github.com/apache/datafusion-java/pull/47/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/47/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/47/files
CsvReadOptions.java https://github.com/apache/datafusion-java/pull/47/files#diff-111e261c5146b73918fba330756600d87a4c30dda37a5d8ebbcaad20abdfbdff
FileCompressionType.java https://github.com/apache/datafusion-java/pull/47/files#diff-74b4c090645cc7e9a44ef0bb3baf7961b4a1f26aacf36c58ee0917069d3a17eb
FileCompressionTypes.java https://github.com/apache/datafusion-java/pull/47/files#diff-7c3742aa6afe5ad8983d2814710e697f68e87d54813c0eb34c2838239d1f1226
NdJsonReadOptions.java https://github.com/apache/datafusion-java/pull/47/files#diff-15292dc4a087ae186c659220ac3957ea3de08c51ee32da1b71dbfac42f5bdab8
SessionContext.java https://github.com/apache/datafusion-java/pull/47/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
CsvReadOptionsTest.java https://github.com/apache/datafusion-java/pull/47/files#diff-ef150ba18b6cf195629ee7ff943d9470586ab2588342cf7f7a1c19c66365a382
NdJsonReadOptionsTest.java https://github.com/apache/datafusion-java/pull/47/files#diff-a00b66cae3970b0201ffc69b68d1d4f655ad7194d89c80010c34021ba4e8a01d
SessionContextJsonTest.java https://github.com/apache/datafusion-java/pull/47/files#diff-9a495fa0697a8dec50e1cb93acf37ef743fca4f33f4e47d7559fac42b75b5a2a
build.rs https://github.com/apache/datafusion-java/pull/47/files#diff-358ae2245aa2cd99768b0c568a07648d4c26c8cdd84b15cd6f0af2680ec85240
json.rs https://github.com/apache/datafusion-java/pull/47/files#diff-62740719457b09bd94c4c094562152ba5eff47b34b032f7480d144b01a51b042
lib.rs https://github.com/apache/datafusion-java/pull/47/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
csv_read_options.proto https://github.com/apache/datafusion-java/pull/47/files#diff-a57fc576e0543b01d5197e76e6f17133168f883e272f3a7909ca690b04db94be
file_compression_type.proto https://github.com/apache/datafusion-java/pull/47/files#diff-ad0c2eee7a519880f4beb42ccbc976b0907ace2f89bed4e33391c5188b68dd98
json_read_options.proto https://github.com/apache/datafusion-java/pull/47/files#diff-5615b8d090f3a3fecf8dfebe49894bfda86b53efda1df1e8509cd99a3797dbd5
core/src/main/java/org/apache/datafusion/CsvReadOptions.javahttps://github.com/apache/datafusion-java/pull/47/files#diff-111e261c5146b73918fba330756600d87a4c30dda37a5d8ebbcaad20abdfbdff
View file https://github.com/LantaoJin/datafusion-java/blob/7765eec39d843adc9038ef5afa5f4d93064d479b/core/src/main/java/org/apache/datafusion/CsvReadOptions.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/47/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/47/files#diff-111e261c5146b73918fba330756600d87a4c30dda37a5d8ebbcaad20abdfbdff
https://github.com/apache/datafusion-java/pull/47/files#diff-111e261c5146b73918fba330756600d87a4c30dda37a5d8ebbcaad20abdfbdff
https://github.com/apache/datafusion-java/pull/47/files#diff-111e261c5146b73918fba330756600d87a4c30dda37a5d8ebbcaad20abdfbdff
https://github.com/apache/datafusion-java/pull/47/files#diff-111e261c5146b73918fba330756600d87a4c30dda37a5d8ebbcaad20abdfbdff
https://github.com/apache/datafusion-java/pull/47/files#diff-111e261c5146b73918fba330756600d87a4c30dda37a5d8ebbcaad20abdfbdff
core/src/main/java/org/apache/datafusion/FileCompressionType.javahttps://github.com/apache/datafusion-java/pull/47/files#diff-74b4c090645cc7e9a44ef0bb3baf7961b4a1f26aacf36c58ee0917069d3a17eb
View file https://github.com/LantaoJin/datafusion-java/blob/7765eec39d843adc9038ef5afa5f4d93064d479b/core/src/main/java/org/apache/datafusion/FileCompressionType.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/47/{{ revealButtonHref }}
core/src/main/java/org/apache/datafusion/FileCompressionTypes.javahttps://github.com/apache/datafusion-java/pull/47/files#diff-7c3742aa6afe5ad8983d2814710e697f68e87d54813c0eb34c2838239d1f1226
View file https://github.com/LantaoJin/datafusion-java/blob/7765eec39d843adc9038ef5afa5f4d93064d479b/core/src/main/java/org/apache/datafusion/FileCompressionTypes.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/47/{{ revealButtonHref }}
core/src/main/java/org/apache/datafusion/NdJsonReadOptions.javahttps://github.com/apache/datafusion-java/pull/47/files#diff-15292dc4a087ae186c659220ac3957ea3de08c51ee32da1b71dbfac42f5bdab8
View file https://github.com/LantaoJin/datafusion-java/blob/7765eec39d843adc9038ef5afa5f4d93064d479b/core/src/main/java/org/apache/datafusion/NdJsonReadOptions.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/47/{{ revealButtonHref }}
core/src/main/java/org/apache/datafusion/SessionContext.javahttps://github.com/apache/datafusion-java/pull/47/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
View file https://github.com/LantaoJin/datafusion-java/blob/7765eec39d843adc9038ef5afa5f4d93064d479b/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/47/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/47/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
andygrovehttps://github.com/andygrove
May 14, 2026https://github.com/apache/datafusion-java/pull/47/files#r3242448636
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/apache/datafusion-java/pull/47/files
LantaoJinhttps://github.com/LantaoJin
May 15, 2026https://github.com/apache/datafusion-java/pull/47/files#r3245580172
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/apache/datafusion-java/pull/47/files
andygrovehttps://github.com/andygrove
May 14, 2026https://github.com/apache/datafusion-java/pull/47/files#r3242450901
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/apache/datafusion-java/pull/47/files
LantaoJinhttps://github.com/LantaoJin
May 15, 2026https://github.com/apache/datafusion-java/pull/47/files#r3245581727
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/apache/datafusion-java/pull/47/files
https://github.com/apache/datafusion-java/pull/47/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/47/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
core/src/test/java/org/apache/datafusion/CsvReadOptionsTest.javahttps://github.com/apache/datafusion-java/pull/47/files#diff-ef150ba18b6cf195629ee7ff943d9470586ab2588342cf7f7a1c19c66365a382
View file https://github.com/LantaoJin/datafusion-java/blob/7765eec39d843adc9038ef5afa5f4d93064d479b/core/src/test/java/org/apache/datafusion/CsvReadOptionsTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/47/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/47/files#diff-ef150ba18b6cf195629ee7ff943d9470586ab2588342cf7f7a1c19c66365a382
https://github.com/apache/datafusion-java/pull/47/files#diff-ef150ba18b6cf195629ee7ff943d9470586ab2588342cf7f7a1c19c66365a382
https://github.com/apache/datafusion-java/pull/47/files#diff-ef150ba18b6cf195629ee7ff943d9470586ab2588342cf7f7a1c19c66365a382
https://github.com/apache/datafusion-java/pull/47/files#diff-ef150ba18b6cf195629ee7ff943d9470586ab2588342cf7f7a1c19c66365a382
https://github.com/apache/datafusion-java/pull/47/files#diff-ef150ba18b6cf195629ee7ff943d9470586ab2588342cf7f7a1c19c66365a382
https://github.com/apache/datafusion-java/pull/47/files#diff-ef150ba18b6cf195629ee7ff943d9470586ab2588342cf7f7a1c19c66365a382
https://github.com/apache/datafusion-java/pull/47/files#diff-ef150ba18b6cf195629ee7ff943d9470586ab2588342cf7f7a1c19c66365a382
Please reload this pagehttps://github.com/apache/datafusion-java/pull/47/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/47/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.