Title: feat(dataframe): expose sort and repartition · Issue #42 · apache/datafusion-java · GitHub
Open Graph Title: feat(dataframe): expose sort and repartition · Issue #42 · apache/datafusion-java
X Title: feat(dataframe): expose sort and repartition · Issue #42 · apache/datafusion-java
Description: Is your feature request related to a problem or challenge? Two ordering / layout primitives are missing from the DataFrame API: sort — no way to order a DataFrame today without dropping to SQL. repartition — no way to control parallelism...
Open Graph Description: Is your feature request related to a problem or challenge? Two ordering / layout primitives are missing from the DataFrame API: sort — no way to order a DataFrame today without dropping to SQL. rep...
X Description: Is your feature request related to a problem or challenge? Two ordering / layout primitives are missing from the DataFrame API: sort — no way to order a DataFrame today without dropping to SQL. rep...
Opengraph URL: https://github.com/apache/datafusion-java/issues/42
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(dataframe): expose sort and repartition","articleBody":"### Is your feature request related to a problem or challenge?\n\nTwo ordering / layout primitives are missing from the DataFrame API:\n\n- `sort` — no way to order a DataFrame today without dropping to SQL.\n- `repartition` — no way to control parallelism / partitioning of a\n DataFrame.\n\n### Describe the solution you'd like\n\n**`sort`**. Two ergonomics options worth considering:\n\n1. SQL-string flavour matching `filter(String)` / proposed\n `withColumn`: `df.sort(\"a ASC, b DESC NULLS FIRST\")`. Parsed via\n `parse_sql_expr` plus an `ORDER BY` shim, or via the SQL parser's\n `parse_order_by`. Cheapest to implement; no Java-side model.\n2. Typed: a `SortExpr` Java record (column, ascending, nullsFirst) and\n `df.sort(SortExpr... exprs)`. Discoverable, IDE-friendly.\n\nSuggest starting with (1) for consistency with `filter`, then layering\n(2) on top if/when an `Expr` builder lands for joins.\n\n**`repartition`**. DataFusion's `Partitioning` enum has three variants:\n\n- `RoundRobinBatch(usize)` — `df.repartitionRoundRobin(n)`\n- `Hash(Vec\u003cExpr>, usize)` — `df.repartitionHash(int n, String... columns)` (column-name flavour to start; expression variant later)\n- `UnknownPartitioning(usize)` — not user-facing.\n\nTests in `DataFrameTransformationsTest` (sort round-trip, partition\ncount assertion via `collect_partitioned` once that's wired, or via\nplan inspection).\n\n### Describe alternatives you've considered\n\n`ORDER BY` / `DISTRIBUTE BY` via SQL. Works but loses the lazy\nDataFrame composition.\n\n### Additional context\n\nEach carries a small Java-side design choice (sort-expression shape,\npartitioning constructor shape); fine to land them as two separate PRs\nunder this issue if that's cleaner than one batched PR.","author":{"url":"https://github.com/andygrove","@type":"Person","name":"andygrove"},"datePublished":"2026-05-13T22:08:30Z","url":"https://github.com/apache/datafusion-java/issues/42"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:691d0bc9-d72a-6b3a-87fb-97c986af6fe2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8322:3D1C6E:26CD11:367A01:6B046A13 |
| html-safe-nonce | 6956836ad3ca3d226d5e9953f3af77a55a1ec9832bc26a6befdf4c085c5294b8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzIyOjNEMUM2RToyNkNEMTE6MzY3QTAxOjZCMDQ2QTEzIiwidmlzaXRvcl9pZCI6IjM5NTYzODg0NTg4NDY3NzU4MjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7d843e03224f180dcf242ab0fb92ee7c59fa3097cc57fc4d3287828808e6b215 |
| hovercard-subject-tag | issue:4441513114 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/apache/datafusion-java/42/issue_layout |
| twitter:image | https://opengraph.githubassets.com/27537838318f712bec6d6381cf053b0b237991d23aa9b3ed3824a19c874c55a7/apache/datafusion-java/issues/42 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/27537838318f712bec6d6381cf053b0b237991d23aa9b3ed3824a19c874c55a7/apache/datafusion-java/issues/42 |
| og:image:alt | Is your feature request related to a problem or challenge? Two ordering / layout primitives are missing from the DataFrame API: sort — no way to order a DataFrame today without dropping to SQL. rep... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andygrove |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| 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 |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width