title: How can I customize column-mapping when save RDD to Cassandra?
body: <p>I am using Java to write Spark application.
  If I have a customized tuple, let's say class "Person". </p>
  
  <pre><code>Class Person { 
    public String name1; 
    public String name2; 
    public String name3; 
  } 
  </code></pre>
  
  <p>And I have a</p>
  
  <pre><code>JavaRDD&lt;Person&gt; rdd;
  </code></pre>
  
  <p>Now I want to save it to Cassandra. </p>
  
  <p>Assume that I have a table called "people" with three columns "name1", "name2" and "name3", "name4", ..., "name10" in Cassandra.
  According to the tutorial, the default column-mapping is using this code: </p>
  
  <pre><code>javaFunctions(rdd).writerBuilder("test", "person", mapToRow(Person.class)).saveToCassandra(); 
  </code></pre>
  
  <p>This will use the default column-mapping like:</p>
  
  <pre><code>Person.name1  --&gt; "name1"    
  Person.name2  --&gt; "name2"     
  Person.name3  --&gt; "name3" 
  </code></pre>
  
  <p>But I want to customize the column mapping, the new mapping looks like this: </p>
  
  <pre><code>Person.name1  --&gt; "name3"       
  Person.name2  --&gt; "name2"  
  Person.name3  --&gt; "name1" 
  </code></pre>
  
  <p>or even that I want to discard Person.name2</p>
  
  <pre><code>Person.name1  --&gt; "name3"
  Person.name3  --&gt; "name1"
  </code></pre>
  
  <p>Anyway, I wonder if there is way to override or replace the default RowWriter?<br>
  What should I do to modify the column-mapping ?<br>
  I cannot find any good material about customized column-mapping in Java.</p>