You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2026/05/13 20:06:01 UTC
[PR] feat(dataframe): add limit, distinct, dropColumns, withColumnRenamed [datafusion-java]
andygrove opened a new pull request, #30:
URL: https://github.com/apache/datafusion-java/pull/30
## Which issue does this PR close?
- Closes #.
## Rationale for this change
The Java `DataFrame` API currently exposes only `select` and `filter` as
transformations. This PR rounds out the trivially-implementable subset of
DataFusion's Rust `DataFrame` API so users can build small pipelines without
falling back to SQL strings.
## What changes are included in this PR?
Four new methods on `DataFrame`, each backed by a thin JNI bridge that calls
the corresponding DataFusion operator:
- `limit(int fetch)` / `limit(int skip, int fetch)` — take the first N rows, optionally after skipping. Negative arguments throw `IllegalArgumentException`.
- `distinct()` — deduplicate rows across all columns.
- `dropColumns(String... columnNames)` — inverse of `select`. Unknown column names are silently ignored (matches DataFusion's `drop_columns` semantics).
- `withColumnRenamed(String oldName, String newName)` — rename a column. Unknown old names are a no-op (matches DataFusion's `with_column_renamed` semantics).
All four follow the existing pattern: throw `IllegalStateException` on closed/collected handles, and leave the receiver usable so chaining off a shared source is non-destructive.
## Are these changes tested?
Yes. `DataFrameTransformationsTest` gains 12 new tests covering happy paths,
non-destructive semantics, invalid arguments, and the silent-ignore behaviors
for `dropColumns`/`withColumnRenamed`. The existing `methodsThrowAfterClose`
and `methodsThrowAfterCollect` lifecycle tests are extended to cover the new
methods.
## Are there any user-facing changes?
Yes — four new public methods on `org.apache.datafusion.DataFrame`. No
breaking changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] feat(dataframe): add limit, distinct, dropColumns, withColumnRenamed [datafusion-java]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove merged PR #30:
URL: https://github.com/apache/datafusion-java/pull/30
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org