Skip to content

Commit

Permalink
[MINOR][DOCS] Correct the usage example of Dataset in Java
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

### Why are the changes needed?

### Does this PR introduce _any_ user-facing change?

### How was this patch tested?

### Was this patch authored or co-authored using generative AI tooling?

Closes #44342 from Aiden-Dong/aiden-dev.

Lead-authored-by: aiden <[email protected]>
Co-authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
  • Loading branch information
aiden and HyukjinKwon committed Jan 10, 2024
1 parent f526bea commit d2f5724
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ private[sql] object Dataset {
* the following creates a new Dataset by applying a filter on the existing one:
* {{{
* val names = people.map(_.name) // in Scala; names is a Dataset[String]
* Dataset<String> names = people.map((Person p) -> p.name, Encoders.STRING));
* Dataset<String> names = people.map(
* (MapFunction<Person, String>) p -> p.name, Encoders.STRING()); // Java
* }}}
*
* Dataset operations can also be untyped, through various domain-specific-language (DSL)
Expand Down

0 comments on commit d2f5724

Please sign in to comment.