Title: feat(dataframe): add join, joinOn, and JoinType by LantaoJin · Pull Request #72 · apache/datafusion-java · GitHub
Open Graph Title: feat(dataframe): add join, joinOn, and JoinType by LantaoJin · Pull Request #72 · apache/datafusion-java
X Title: feat(dataframe): add join, joinOn, and JoinType by LantaoJin · Pull Request #72 · apache/datafusion-java
Description: Which issue does this PR close? Closes #44 . Rationale for this change Joins are the largest missing piece of the DataFrame API today; without them, Java callers cannot programmatically express even simple star-join queries that DataFusion's Rust API has supported for years. What changes are included in this PR? This PR ships Phase 1 : column-name join plus joinOn with String-form predicates. By committing to SQL-string predicates here, it also closes the Phase-2 design question. A typed Expr builder is deliberately deferred. New public Java enum org.apache.datafusion.JoinType mirroring upstream's 10-variant enum (INNER, LEFT, RIGHT, FULL, LEFT_SEMI, RIGHT_SEMI, LEFT_ANTI, RIGHT_ANTI, LEFT_MARK, RIGHT_MARK). Crosses JNI as a byte code, mirroring the existing Volatility precedent for UDFs. Three new methods on DataFrame: DataFrame.join(right, type, leftCols, rightCols) — equi-join on named columns, no residual filter. DataFrame.join(right, type, leftCols, rightCols, filter) — equi-join with a residual SQL filter parsed against the combined schema of left + right. DataFrame.joinOn(right, type, predicates...) — arbitrary join predicates, each parsed as a SQL expression against the combined schema. Predicates may be qualified with the relation alias when ambiguous (e.g. "l.id = r.id", "left.x < right.y"). All three are non-consuming on the Java side: both left (the receiver) and right remain usable and must still be closed independently. Upstream's Rust join / join_on consume both, but the JNI layer clones the underlying Arc-backed DataFrame like every other transformation method (select / filter / withColumn / unnestColumns). This matches the established Java-side convention and supports the natural star-join pattern where the same fact table is joined to multiple dimensions: DataFrame fact = ctx.sql(...); DataFrame d1 = fact.join(dimA, INNER, fact_keys, dimA_keys); DataFrame d2 = fact.join(dimB, INNER, fact_keys, dimB_keys); // fact still usable Out of scope (for follow-ups): Typed Expr builder (Phase 2 option 2). Andy's issue explicitly cautions against the maintenance burden. The String-form predicate channel covers everything DataFusion's parser supports. Cross-join, natural-join. Not in #44; separate issues. Predicate validation pre-flight on the Java side. DataFusion's parser is the source of truth and surfaces errors the same way filter(String) already does. Are these changes tested? Yes, 18 new tests in core/src/test/java/org/apache/datafusion/DataFrameJoinTest.java Are there any user-facing changes? Yes, purely additive. New public API: org.apache.datafusion.JoinType (enum) DataFrame.join(DataFrame, JoinType, String[], String[]) DataFrame.join(DataFrame, JoinType, String[], String[], String) DataFrame.joinOn(DataFrame, JoinType, String...) No API removals, no deprecations, no behavior change for existing callers. The native binary is unchanged in size (no new Cargo features or dependencies).
Open Graph Description: Which issue does this PR close? Closes #44 . Rationale for this change Joins are the largest missing piece of the DataFrame API today; without them, Java callers cannot programmatically express e...
X Description: Which issue does this PR close? Closes #44 . Rationale for this change Joins are the largest missing piece of the DataFrame API today; without them, Java callers cannot programmatically express e...
Opengraph URL: https://github.com/apache/datafusion-java/pull/72
X: @github
Domain: github.com
IPv4 address: 140.82.113.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:cd4a3500-d244-0443-7267-6037f2ef8f8a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9F42:99B56:290B05:39F3B7:6B046A43 |
| html-safe-nonce | 888a652bdfae97d7dc8d56df42ef1be7b3ee05c845292bc0d8a6e3b0416090d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjQyOjk5QjU2OjI5MEIwNTozOUYzQjc6NkIwNDZBNDMiLCJ2aXNpdG9yX2lkIjoiMTQ3NDAwMzA4MjM3ODc2NjkxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 077edfa61d9ba11d94022e0b753e6ab2deb534e1e8b2dc935431d0aec088766a |
| hovercard-subject-tag | pull_request:3715345383 |
| 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/72/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 #44 . Rationale for this change Joins are the largest missing piece of the DataFrame API today; without them, Java callers cannot programmatically express e... |
| 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