title: Convert Spark DF to a DS with different fields names
body: <p>I want to convert a Spark dataframe to a dataset of a POJO with different fields names. I have a dataframe of the fields: <code>name</code>, <code>date_of_birth</code>, where their types are <code>StringType</code>, <code>DateType</code>.</p>
  <p>And a POJO of:</p>
  <pre><code>public class Person implements Serializable {
      private String name;
      private Date dateOfBirth;
  }
  </code></pre>
  <p>I <em>convert it to dataset successfully</em> with the following code:</p>
  <pre><code>Encoder&lt;Person&gt; personEncoder =  Encoders.bean(Person.class); 
  Dataset&lt;Person&gt; personDS = result.as(personEncoder);
  List&lt;Person&gt; personList = personDS.collectAsList();
  </code></pre>
  <p>Only if I change the dataframe’s columns names before that, to those of the Person POJO. Is there any way of telling Spark to map between the fields from the POJO side?</p>
  <p>I thought about Gson’s <code>@SerializedName(“date_of_birth”)</code> but it didn’t affect anything.</p>