Title: feat(arrow): expose Arrow IPC reader via registerArrow and readArrow by LantaoJin · Pull Request #52 · apache/datafusion-java · GitHub
Open Graph Title: feat(arrow): expose Arrow IPC reader via registerArrow and readArrow by LantaoJin · Pull Request #52 · apache/datafusion-java
X Title: feat(arrow): expose Arrow IPC reader via registerArrow and readArrow by LantaoJin · Pull Request #52 · apache/datafusion-java
Description: Which issue does this PR close? Closes #37. Rationale for this change DataFusion 53.x supports Arrow IPC files via SessionContext::register_arrow / read_arrow, but the Java bindings only expose Parquet, CSV, and (in #47) NDJSON. Since JVM results already come back as Arrow batches via the C Data Interface, an Arrow IPC reader on the Java side closes the natural round-trip: Java callers can write Arrow IPC to disk with arrow-vector's ArrowFileWriter, then read it back through DataFusion without going through Parquet or any other intermediate format. Today they have to fall back to CREATE EXTERNAL TABLE … STORED AS ARROW via SQL, which works but bypasses the typed builder pattern. This PR is the Java surface for the existing upstream functionality. Issue #37 tracks it; the implementation follows the same proto-over-JNI pattern as #47 (NDJSON), #29 (the CSV/Parquet refactor), and the merged CSV/Parquet readers. What changes are included in this PR? proto/arrow_read_options.proto — new ArrowReadOptionsProto message. Single field: file_extension (default .arrow). Explicit Arrow schema rides on the existing IPC byte channel through the JNI layer, mirroring the parquet/csv/json paths, and is therefore not encoded in this message. No FileCompressionType field — Arrow IPC files carry body compression (LZ4_FRAME / ZSTD per-buffer) inside the file format itself. ArrowReadOptions Java builder with fileExtension(String) and schema(Schema) setters. SessionContext.registerArrow(name, path[, options]) and readArrow(path[, options]) overloads, structurally identical to the parquet/csv/json entry points. native/src/arrow.rs — JNI module that decodes ArrowReadOptionsProto, constructs the upstream ArrowReadOptions, and forwards to register_arrow / read_arrow. Imports ArrowReadOptions from datafusion::execution::options rather than prelude (it's not re-exported there, same situation as JsonReadOptions). Out of scope (for follow-ups): tablePartitionCols: neither parquet, csv, nor ndjson exposes Hive-style partitioning on the Java side yet. Adding it for Arrow only would diverge. Are these changes tested? Yes, 9 new tests across ArrowReadOptionsTest and SessionContextArrowTest. Are there any user-facing changes? Yes, purely additive. New public API: org.apache.datafusion.ArrowReadOptions SessionContext.registerArrow(String, String) SessionContext.registerArrow(String, String, ArrowReadOptions) SessionContext.readArrow(String) → DataFrame SessionContext.readArrow(String, ArrowReadOptions) → DataFrame The new org.apache.datafusion.protobuf.ArrowReadOptionsProto generated class is also exposed via the protobuf-Java output, consistent with how CsvReadOptionsProto, NdJsonReadOptionsProto, and ParquetReadOptionsProto are exposed. No API removals, no deprecations, no behavior change for existing callers.
Open Graph Description: Which issue does this PR close? Closes #37. Rationale for this change DataFusion 53.x supports Arrow IPC files via SessionContext::register_arrow / read_arrow, but the Java bindings only expose P...
X Description: Which issue does this PR close? Closes #37. Rationale for this change DataFusion 53.x supports Arrow IPC files via SessionContext::register_arrow / read_arrow, but the Java bindings only expose P...
Opengraph URL: https://github.com/apache/datafusion-java/pull/52
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:1b29864c-3678-133e-8380-4fae426b8139 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DB9A:BE8D0:29BCE6:3AC71E:6B046A4A |
| html-safe-nonce | 42844fbf377a80980a21a62b9f5afeb751944ebccaa3c772c2f194e812873db5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjlBOkJFOEQwOjI5QkNFNjozQUM3MUU6NkIwNDZBNEEiLCJ2aXNpdG9yX2lkIjoiNDE4NzA1MTAwNDYyMzM1MDM0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b0a1ad76bfb3af1ceffce33fbc91d113a7e3c738ea9f2e46ec3772d7848f92bf |
| hovercard-subject-tag | pull_request:3687249080 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/apache/datafusion-java/pull/52/files |
| twitter:image | https://avatars.githubusercontent.com/u/1853780?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1853780?s=400&v=4 |
| og:image:alt | Which issue does this PR close? Closes #37. Rationale for this change DataFusion 53.x supports Arrow IPC files via SessionContext::register_arrow / read_arrow, but the Java bindings only expose P... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/apache/datafusion-java git https://github.com/apache/datafusion-java.git |
| octolytics-dimension-user_id | 47359 |
| octolytics-dimension-user_login | apache |
| octolytics-dimension-repository_id | 1237105117 |
| octolytics-dimension-repository_nwo | apache/datafusion-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1237105117 |
| octolytics-dimension-repository_network_root_nwo | apache/datafusion-java |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width