You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2024/01/10 03:39:01 UTC

Re: [PR] [MINOR][DOCS] Correct the usage example of Dataset in Java. [spark]

HyukjinKwon commented on code in PR #44342:
URL: https://github.com/apache/spark/pull/44342#discussion_r1446846063


##########
sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala:
##########
@@ -138,7 +138,7 @@ 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

Review Comment:
   ```suggestion
    *   Dataset<String> names = people.map(
    *     (MapFunction<Person, String>) p -> p.name, Encoders.STRING()); // Java
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org