title: Java - Spark SQL DataFrame map function is not working
body: <p>In Spark SQL when I tried to use map function on DataFrame then I am getting  below error. </p>
  
  <p>The method map(Function1, ClassTag) in the type DataFrame is not applicable for the arguments (new Function(){})</p>
  
  <p>I am following spark 1.3 documentation as well. <a href="https://spark.apache.org/docs/latest/sql-programming-guide.html#inferring-the-schema-using-reflection" rel="nofollow">https://spark.apache.org/docs/latest/sql-programming-guide.html#inferring-the-schema-using-reflection</a> Have any one solution?</p>
  
  <p>Here is my testing code.</p>
  
  <pre><code>   // SQL can be run over RDDs that have been registered as tables.
  DataFrame teenagers = sqlContext.sql("SELECT name FROM people WHERE age &gt;= 13 AND age &lt;= 19");
  
  List&lt;String&gt; teenagerNames = teenagers.map(
              new Function&lt;Row, String&gt;() {
            public String call(Row row) {
              return "Name: " + row.getString(0);
            }
          }).collect();
  </code></pre>