| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Add DataFrame.sort(SortExpr...), DataFrame.repartitionRoundRobin(int), and DataFrame.repartitionHash(int, String...). SortExpr is a small value class with static asc/desc factories and a fluent nullsFirst setter, mirroring DataFusion's expr::Sort. The SQL-string sort flavour the issue lists as option 1 is deferred: DataFusion 53.1 has no parse_sort_exprs helper on DataFrame, so the string flavour would force hand-rolled ORDER BY parsing. The typed SortExpr API is the same shape the issue authorises in option 2. repartitionHash takes column-name keys for v1 and translates each through col(...) in the native handler. Expression keys are deferred until a Java-side Expr builder lands.
There was a problem hiding this comment.
Thanks @LantaoJin
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Which issue does this PR close?
Rationale for this change
Two ordering / layout primitives have been missing from the Java DataFrame API: sort (no way to order without dropping to SQL) and repartition (no way to control parallelism / partitioning). Both are first-class on the upstream Rust DataFrame, in the default feature set, with no Cargo flag impact. This PR exposes them additively.
What changes are included in this PR?
Why typed SortExpr instead of the SQL-string flavour the issue suggests as option 1: DataFrame::parse_sql_expr parses a single expression, not an ORDER BY list, and DataFusion 53.1 has no parse_sort_exprs helper. The string flavour would force hand-rolled SQL parsing on the native side. The issue authorises starting at option 2; the SQL-string flavour can be layered on later if/when an Expr builder lands.
Out of scope (for follow-ups):
Are these changes tested?
Yes -- 20 new tests across SortExprTest and DataFrameTransformationsTest, plus six new lines extending the existing close/collect coverage.
Are there any user-facing changes?
Yes -- purely additive. New public API:
No API removals, no deprecations, no behaviour change for existing callers. No Cargo feature changes; binary size is unchanged.