title: Spark Dataset map row 'cannot resolve method map(<lambda expression>)'
body: <p>Trying to create RDD out of Dataset by trying to map to each row in the Dataset. Getting <code>cannot resolve method map(&lt;lambda expression&gt;)</code> error on the <code>map</code> in <code>df1.map(r -&gt;</code>:</p>
  
  <pre><code>Dataset&lt;Object&gt; df1 = session.read().parquet(tableName).as(Encoders.bean(Object.class));
  
  JavaRDD&lt;List&lt;Tuple3&lt;Long, Integer, Double&gt;&gt;&gt; tempDatas1 = df1.map(r -&gt; new MapFunction&lt;Object, List&lt;Tuple3&lt;Long, Integer, Double&gt;&gt;&gt;(){
              //@Override
              public List&lt;Tuple3&lt;Long, Integer, Double&gt;&gt; call(Object row) throws Exception
              {
  
              // Get the sample property, remove leading and ending spaces and split it by comma
              // to get each sample individually
              List&lt;Tuple2&lt;String, Integer&gt;&gt; samples = zipWithIndex((row.getSamples().trim().split(",")));
  
              // Gets the unique identifier for that s.
              Long snp = row.getPos();
  
              // Calculates the hamming distance.
              return samples.stream().map(t -&gt; {
                  String alleles = t._1();
                  Integer patient = t._2();
  
                  List&lt;String&gt; values = Arrays.asList(alleles.split("\\|"));
  
                  Double firstAllele = Double.parseDouble(values.get(0));
                  Double secondAllele = Double.parseDouble(values.get(1));
  
                  // Returns the initial s id, p id and the distance in form of Tuple.
                  return new Tuple3&lt;&gt;(snp, patient, firstAllele + secondAllele);
              }).collect(Collectors.toList());
              }
          });
  </code></pre>
  
  <p>Any help would be appreciated.</p>