title: Problem setting the input and output in Spark with vector assembler (Java)
body: <p>I have a data set with 5408 columns, all of them are  printed like: 
   _c0|   _c1|   _c2|   _c3|   _c4|   _c5|   _c6|   _c7|   _c8|   _c9|  |-0.169|-0.025|-0.010|-0.041|-0.045|-0.069| 0.038| 0.014| 0.008|-0.014|.</p>
  
  <p>I want to put all the columns together and put separate the label, but I have this error which means that my columns are not supported:
  xception in thread "main" java.lang.IllegalArgumentException: Data type string of column _c0 is not supported.
  Data type string of column _c1 is not supported.
  Data type string of column _c2 is not supported.
  Data type string of column _c3 is not supported.
  Data type string of column _c4 is not supported.</p>
  
  <p>I wanto to create a ML model, so fat I have:</p>
  
  <pre><code>Dataset&lt;Row&gt; csvData = spark.read()
                  .option("header", false)
                  .option("inferSchema", true)
                  .csv("src/main/resou`enter code here`rces/K9.data");
  
          StringIndexer conditionIndexer = new StringIndexer ()
                  .setInputCol("_c5408")
                  .setOutputCol("_c5408Index");
          csvData = conditionIndexer.fit(csvData).transform(csvData);
  
  //Cleaning data
  List&lt;org.apache.spark.sql.Column&gt; list = new ArrayList&lt;org.apache.spark.sql.Column&gt;();
          for (String col : csvData.columns()) {
              list.add(when(csvData.col(col).equalTo("?"), 0).otherwise(csvData.col(col)).alias(col));
          }
          csvData = csvData.select(list.toArray(new org.apache.spark.sql.Column[0]));
  
  
      List&lt;org.apache.spark.sql.Column&gt; list_null = new ArrayList&lt;org.apache.spark.sql.Column&gt;();
      for (String col : csvData.columns()) {
          list_null.add(when(csvData.col(col).isNull(), 0).otherwise(csvData.col(col)).alias(col));
      }
      csvData = csvData.select(list_null.toArray(new org.apache.spark.sql.Column[0]));
  
      csvData = csvData.na().fill(0, csvData.columns());
          csvData.groupBy(col("_c5408"),col("_c5408Index")).count().show();
  
   ArrayList&lt;String&gt; inputColsList = new ArrayList&lt;&gt;(Arrays.asList(csvData.columns()));
          //Make single features column for feature vectors
          inputColsList.remove("_c5408Index");
  
          VectorAssembler vectorAssembler = new VectorAssembler()
                  .setInputCols(inputColsList.parallelStream().toArray(String[]::new))
                  .setOutputCol("features");
  
         `enter code here` Dataset&lt;Row&gt; modelInputData = vectorAssembler.transform(csvData)
                  .select("_c5408Index", "features")
                  .withColumnRenamed("_c5408Index", "label");
  </code></pre>
  
  <p>The error is when the Dataset modelInputData = vectorAssembler.transform(csvData) is written.</p>
  
  <p>The Schema is</p>
  
  <pre><code>|-- _c0: string (nullable = true)
   |-- _c1: string (nullable = true)
   |-- _c2: string (nullable = true)
   |-- _c3: string (nullable = true)
   |-- _c4: string (nullable = true)
   |-- _c5: string (nullable = true)
   |-- _c6: string (nullable = true)
   |-- _c7: string (nullable = true)
   |-- _c8: string (nullable = true)
   |-- _c9: string (nullable = true)
   |-- _c10: string (nullable = true)
   |-- _c11: string (nullable = true)
   |-- _c12: string (nullable = true)
   |-- _c13: string (nullable = true)
   |-- _c14: string (nullable = true)
   |-- _c15: string (nullable = true)
   |-- _c16: string (nullable = true)
   |-- _c17: string (nullable = true)
   |-- _c18: string (nullable = true)
   |-- _c19: string (nullable = true)
   |-- _c20: string (nullable = true)
  
  c5408Index: double (nullable = false)
  </code></pre>
  
  <p>The data sets looks like</p>