title: Dropping multiple columns of Spark DataFrame in Java
body: <p>I'm using Spark 1.5.3, I tried separating the even and odd columns in a spark dataFrame,</p>
  
  <pre><code>String filePath = "/home/inputData.txt";
  DataFrame inputDataFrame = sql.read().format("com.databricks.spark.csv") //No I18N
      .option("inferSchema", "true") //No I18N
      .option("delimiter", ",") //No I18N
      .option("header", "false") //No I18N
      .load(filePath);
  
  inputDataFrame.show();
  
  List&lt;String&gt; evenColumns = Arrays.asList("C0", "C2", "C4", "C6", "C8", "C10", "C12");
  DataFrame oddDataFrame = inputDataFrame.na().drop(JavaConversions.asScalaBuffer(evenColumns));
  DataFrame evenDataFrame = inputDataFrame.selectExpr(JavaConversions.asScalaBuffer(evenColumns));
  
  evenDataFrame.show();
  oddDataFrame.show();
  </code></pre>
  
  <p>Output for the above code : </p>
  
  <p>inputDataFrame:</p>
  
  <pre><code>+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  | C0| C1| C2| C3| C4| C5| C6| C7| C8| C9|C10|C11|C12|C13|
  +---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  |  0|  0|  0|  0|  1|  0|  0|  0|  2|  3|  2|  2|  0|  5|
  |  1|  5|  6|  0| 14|  0|  5|  0| 95|  2|120|  0|  0|  9|
  |  1|  6|  1|  0|  3|  0|  4|  0| 21| 22| 11|  0|  0| 23|
  |  1|  0|  1|  0|  1|  0|  4|  0|  1|  4|  2|  0|  0|  5|
  |  1| 37|  9|  0| 19|  0| 31|  0| 87|  9|108|  0|  0|170|
  +---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  </code></pre>
  
  <p>evenDataFrame:</p>
  
  <pre><code>+---+---+---+---+---+---+---+
  | C0| C2| C4| C6| C8|C10|C12|
  +---+---+---+---+---+---+---+
  |  0|  0|  1|  0|  2|  2|  0|
  |  1|  6| 14|  5| 95|120|  0|
  |  1|  1|  3|  4| 21| 11|  0|
  |  1|  1|  1|  4|  1|  2|  0|
  |  1|  9| 19| 31| 87|108|  0|
  +---+---+---+---+---+---+---+
  </code></pre>
  
  <p>oddDataFrame:</p>
  
  <pre><code>+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  | C0| C1| C2| C3| C4| C5| C6| C7| C8| C9|C10|C11|C12|C13|
  +---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  |  0|  0|  0|  0|  1|  0|  0|  0|  2|  3|  2|  2|  0|  5|
  |  1|  5|  6|  0| 14|  0|  5|  0| 95|  2|120|  0|  0|  9|
  |  1|  6|  1|  0|  3|  0|  4|  0| 21| 22| 11|  0|  0| 23|
  |  1|  0|  1|  0|  1|  0|  4|  0|  1|  4|  2|  0|  0|  5|
  |  1| 37|  9|  0| 19|  0| 31|  0| 87|  9|108|  0|  0|170|
  +---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  </code></pre>
  
  <p>Dropping the <code>evenColumns</code> isn't performed in the above dataFrame. What I'm doing wrong? Expected output is</p>
  
  <pre><code>+---+---+---+---+---+---+---+
  | C1| C3| C5| C7| C9|C11|C13|
  +---+---+---+---+---+---+---+
  |  0|  0|  0|  0|  3|  2|  5|
  |  5|  0|  0|  0|  2|  0|  9|
  |  6|  0|  0|  0| 22|  0| 23|
  |  0|  0|  0|  0|  4|  0|  5|
  | 37|  0|  0|  0|  9|  0|170|
  +---+---+---+---+---+---+---+
  </code></pre>