Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16961#discussion_r101597873
  
    --- Diff: 
examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java
 ---
    @@ -139,11 +139,9 @@ private static void 
runBasicParquetExample(SparkSession spark) {
         // Parquet files can also be used to create a temporary view and then 
used in SQL statements
         parquetFileDF.createOrReplaceTempView("parquetFile");
         Dataset<Row> namesDF = spark.sql("SELECT name FROM parquetFile WHERE 
age BETWEEN 13 AND 19");
    -    Dataset<String> namesDS = namesDF.map(new MapFunction<Row, String>() {
    -      public String call(Row row) {
    -        return "Name: " + row.getString(0);
    -      }
    -    }, Encoders.STRING());
    +    Dataset<String> namesDS = namesDF.map(
    +        (MapFunction<Row, String>) row -> "Name: " + row.getString(0),
    --- End diff --
    
    For those wondering why this lambda has to be cast, it's because it is 
otherwise ambiguous, as there are two methods with an eligible function 
interface as arg.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to