title: Spark VectorAssembler transformer with Strings
body: <p>First, let's define a couple of Spark dataframes <code>dfString</code> and <code>dfDouble</code> respectively made up of <code>strings</code> and <code>doubles</code> as such:</p>
  
  <pre><code>val dfString = sqlContext.createDataFrame(Seq(("a1", "b1", "c1"), ("a2", "b2", "c2"))).toDF("colx", "coly", "colz")
  val dfDouble = sqlContext.createDataFrame(Seq((0.0, 1.0, 2.0), (3.0, 4.0, 5.0))).toDF("colx", "coly", "colz")
  </code></pre>
  
  <p>Second, we prepare a pipeline made up of a single transformer:</p>
  
  <pre><code>val va = new VectorAssembler().setInputCols(Array("colx", "coly", "colz")).setOutputCol("ft")
  val pipeline = new Pipeline().setStages(Array(va))
  </code></pre>
  
  <p>Fitting this pipeline to <code>dfDouble</code> will return the expected result where all columns are concatenated into a single column called <code>ft</code>. But <code>pipeline.fit(dfString)</code> throws</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Data type StringType is not
    supported.</p>
  </blockquote>
  
  <p>The question is: How to obtain the same result with the strings as we get from the doubles while keeping within the pipeline framework?</p>
  
  <p>Note that this is not a duplicate of <a href="https://stackoverflow.com/questions/31450846/concatenate-columns-in-apache-spark-dataframe">Concatenate columns in apache spark dataframe</a> since </p>
  
  <ul>
  <li><p>I want to use only transformers to go in a pipeline framework</p></li>
  <li><p>and that I do not want to use a
  <code>StringIndexer</code> transformer.</p></li>
  </ul>
  
  <p>I am using Spark 1.6.</p>