René's URL Explorer Experiment


Title: feat(dataframe): add writeCsv with CsvWriteOptions by LantaoJin · Pull Request #53 · apache/datafusion-java · GitHub

Open Graph Title: feat(dataframe): add writeCsv with CsvWriteOptions by LantaoJin · Pull Request #53 · apache/datafusion-java

X Title: feat(dataframe): add writeCsv with CsvWriteOptions by LantaoJin · Pull Request #53 · apache/datafusion-java

Description: Which issue does this PR close? Closes #38. Rationale for this change DataFrame.writeParquet (#27) lets Java callers materialize a query result, but CSV remains read-only. DataFusion supports DataFrame::write_csv upstream with the full writer-side option surface (delimiter, quote, escape, null token, compression, partitioning, single-file vs directory output). Issue #38 tracks exposing it on the Java side. The CSV write surface is wider than parquet's — six writer-side knobs plus singleFileOutput and partitionCols — so this PR uses the proto-over-JNI pattern (introduced in #29 and reused by all the read-side option classes) instead of the wide-JNI pattern writeParquet shipped with. Sending a single byte[] keeps the JNI signature stable as more knobs are added. What changes are included in this PR? proto/csv_write_options.proto — new CsvWriteOptionsProto message. Fields are optional so unset values preserve DataFusion's defaults; partition_cols is repeated so the empty list round-trips unambiguously. FileCompressionType is reused from csv_read_options.proto because the codec set is identical between read and write at the upstream level. Promoting the enum to a shared compression.proto in PR #47. Once that lands, this PR's import switches one line. CsvWriteOptions Java builder mirroring the upstream CsvOptions writer-side API: singleFileOutput, partitionCols, hasHeader, delimiter, quote, escape, nullValue, fileCompressionType. All defaults are unset (null) so callers only pay for knobs they touch. DataFrame.writeCsv(String) and DataFrame.writeCsv(String, CsvWriteOptions) overloads with up-front null-arg validation. The receiver remains usable after the call, matching writeParquet's "retain after write" semantics. Java_org_apache_datafusion_DataFrame_writeCsvWithOptions JNI handler in native/src/csv.rs (co-located with the read-side handlers since they share the proto-decode plumbing). Decodes the proto, builds DataFrameWriteOptions and an Option, then calls DataFrame::write_csv. Option is left as None when no writer knob is set so DataFusion's defaults apply. Out of scope (for follow-ups): Other writer fields exposed by upstream CsvOptions but not in #38's checklist: terminator, doubleQuote, dateFormat, datetimeFormat, timestampFormat, timestampTzFormat, timeFormat, compressionLevel, truncatedRows. Easy follow-up — same proto, just add fields. compression_level — separate from the compression codec; the upstream CsvOptions exposes with_compression_level but the issue doesn't list it. Are these changes tested? Yes, 11 new tests across CsvWriteOptionsTest and DataFrameWriteCsvTest. Are there any user-facing changes? Yes, purely additive. New public API: org.apache.datafusion.CsvWriteOptions DataFrame.writeCsv(String) DataFrame.writeCsv(String, CsvWriteOptions) The new org.apache.datafusion.protobuf.CsvWriteOptionsProto generated class is also exposed via the protobuf-Java output, consistent with how the read-side option protos are exposed. No API removals, no deprecations, no behavior change for existing callers.

Open Graph Description: Which issue does this PR close? Closes #38. Rationale for this change DataFrame.writeParquet (#27) lets Java callers materialize a query result, but CSV remains read-only. DataFusion supports Dat...

X Description: Which issue does this PR close? Closes #38. Rationale for this change DataFrame.writeParquet (#27) lets Java callers materialize a query result, but CSV remains read-only. DataFusion supports Dat...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.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:1e9706e3-d76b-a065-fa4d-6444ef039aff
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE9EA:99B56:2993BD:3AB229:6B046A64
html-safe-noncecebbbc1dcb9b6db9ad98ff7a48aa0cbb92632a05ae6e6549ebbed536fb493dcc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUVBOjk5QjU2OjI5OTNCRDozQUIyMjk6NkIwNDZBNjQiLCJ2aXNpdG9yX2lkIjoiODIyNTQwNjU5MzIzNjQ5NDk0OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac518abcac2254b8134fc2b97db1d2f43f794d965fa0ca682c2749ffbb065a511d
hovercard-subject-tagpull_request:3687375017
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/53/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 #38. Rationale for this change DataFrame.writeParquet (#27) lets Java callers materialize a query result, but CSV remains read-only. DataFusion supports Dat...
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/53/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F53%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%2F53%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/53/files
Reloadhttps://github.com/apache/datafusion-java/pull/53/files
Reloadhttps://github.com/apache/datafusion-java/pull/53/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/dataframe-write-csvhttps://github.com/LantaoJin/datafusion-java/tree/feat/dataframe-write-csv
Conversation 3 https://github.com/apache/datafusion-java/pull/53
Commits 3 https://github.com/apache/datafusion-java/pull/53/commits
Checks 1 https://github.com/apache/datafusion-java/pull/53/checks
Files changed https://github.com/apache/datafusion-java/pull/53/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/53/files
feat(dataframe): add writeCsv with CsvWriteOptions https://github.com/apache/datafusion-java/pull/53/files#top
Show all changes 3 commits https://github.com/apache/datafusion-java/pull/53/files
6c070e8 feat(dataframe): add writeCsv with CsvWriteOptions LantaoJin May 15, 2026 https://github.com/apache/datafusion-java/pull/53/commits/6c070e896153ca2296c38fb5811082844d03e922
7ef0a47 Merge remote-tracking branch 'upstream/main' into feat/dataframe-writ… LantaoJin May 18, 2026 https://github.com/apache/datafusion-java/pull/53/commits/7ef0a47648bbda23fb37560e89de4d4430910548
607a751 fix(write): default to directory output when singleFileOutput is unset LantaoJin May 18, 2026 https://github.com/apache/datafusion-java/pull/53/commits/607a751a1f9c233544dcd551578bdf6914bd967a
Clear filters https://github.com/apache/datafusion-java/pull/53/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/53/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/53/files
CsvWriteOptions.java https://github.com/apache/datafusion-java/pull/53/files#diff-d89a336594e687cee02ad73e7d79ed4c3711c884bd7badad901f1b139d14fcdc
DataFrame.java https://github.com/apache/datafusion-java/pull/53/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
CsvWriteOptionsTest.java https://github.com/apache/datafusion-java/pull/53/files#diff-9a370ffdf031681b17fc88da4cd2ef57c760abd6b2dea17231c0fafdb8fb65e4
DataFrameWriteCsvTest.java https://github.com/apache/datafusion-java/pull/53/files#diff-80e85ebd723b235104ec9d4f00d507b368a378ccd4643dbd31e47aafbd611018
DataFrameWriteParquetTest.java https://github.com/apache/datafusion-java/pull/53/files#diff-ca7af525cc1564880ba8aabec41d55d76a4f06f00417ea37ad731c08cebda142
build.rs https://github.com/apache/datafusion-java/pull/53/files#diff-358ae2245aa2cd99768b0c568a07648d4c26c8cdd84b15cd6f0af2680ec85240
csv.rs https://github.com/apache/datafusion-java/pull/53/files#diff-3f93ec0d7a9d1312c4c66352cd078bf109654268074a062bde373a26db3fcbd3
lib.rs https://github.com/apache/datafusion-java/pull/53/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
csv_write_options.proto https://github.com/apache/datafusion-java/pull/53/files#diff-41690ba4eebc1359df112b4dd28fa5843e489a5a90071b55837e15dc2c950cfd
core/src/main/java/org/apache/datafusion/CsvWriteOptions.javahttps://github.com/apache/datafusion-java/pull/53/files#diff-d89a336594e687cee02ad73e7d79ed4c3711c884bd7badad901f1b139d14fcdc
View file https://github.com/LantaoJin/datafusion-java/blob/607a751a1f9c233544dcd551578bdf6914bd967a/core/src/main/java/org/apache/datafusion/CsvWriteOptions.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/53/{{ revealButtonHref }}
core/src/main/java/org/apache/datafusion/DataFrame.javahttps://github.com/apache/datafusion-java/pull/53/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
View file https://github.com/LantaoJin/datafusion-java/blob/607a751a1f9c233544dcd551578bdf6914bd967a/core/src/main/java/org/apache/datafusion/DataFrame.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/53/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/53/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
https://github.com/apache/datafusion-java/pull/53/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
https://github.com/apache/datafusion-java/pull/53/files#diff-a044f0300400b70bd8ec9c4e4a27c17b89674595e0ae3f5a6ebf88e393ba479b
core/src/test/java/org/apache/datafusion/CsvWriteOptionsTest.javahttps://github.com/apache/datafusion-java/pull/53/files#diff-9a370ffdf031681b17fc88da4cd2ef57c760abd6b2dea17231c0fafdb8fb65e4
View file https://github.com/LantaoJin/datafusion-java/blob/607a751a1f9c233544dcd551578bdf6914bd967a/core/src/test/java/org/apache/datafusion/CsvWriteOptionsTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/53/{{ revealButtonHref }}
Please reload this pagehttps://github.com/apache/datafusion-java/pull/53/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/53/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.