title: Exception:features must be of type org.apache.spark.ml.linalg.VectorUDT
body: <p>I want to run pca with KNN in spark. I have a file that contains id, features.</p>
  
  <pre><code>&gt; KNN.printSchema
  root
  |-- id: int (nullable = true)
  |-- features: double (nullable = true)
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>val dataset =  spark.read.parquet("/usr/local/spark/dataset/data/user")
  val features = new VectorAssembler()
      .setInputCols(Array("id", "features" ))
      .setOutputCol("features")
  val Array(train, test) = dataset
        .randomSplit(Array(0.7, 0.3), seed = 1234L)
        .map(_.cache())
  
  //create PCA matrix to reduce feature dimensions
  val pca = new PCA()
        .setInputCol("features")
        .setK(5)
        .setOutputCol("pcaFeatures")
  val knn = new KNNClassifier()
        .setTopTreeSize(dataset.count().toInt / 5)
        .setFeaturesCol("pcaFeatures")
        .setPredictionCol("predicted")
        .setK(1)
  val pipeline = new Pipeline()
        .setStages(Array(pca, knn))
        .fit(train)
  </code></pre>
  
  <p>Above code block is throwing this exception</p>
  
  <pre class="lang-none prettyprint-override"><code>Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: Column features must be of type org.apache.spark.ml.linalg.VectorUDT@3bfc3ba7 but was actually ArrayType(DoubleType,true).
      at scala.Predef$.require(Predef.scala:224)
      at org.apache.spark.ml.util.SchemaUtils$.checkColumnType(SchemaUtils.scala:42)
      at org.apache.spark.ml.feature.PCAParams$class.validateAndTransformSchema(PCA.scala:54)
      at org.apache.spark.ml.feature.PCAModel.validateAndTransformSchema(PCA.scala:125)
      at org.apache.spark.ml.feature.PCAModel.transformSchema(PCA.scala:162)
      at org.apache.spark.ml.Pipeline$$anonfun$transformSchema$4.apply(Pipeline.scala:180)
      at org.apache.spark.ml.Pipeline$$anonfun$transformSchema$4.apply(Pipeline.scala:180)
      at scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:57)
      at scala.collection.IndexedSeqOptimized$class.foldLeft(IndexedSeqOptimized.scala:66)
      at scala.collection.mutable.ArrayOps$ofRef.foldLeft(ArrayOps.scala:186)
      at org.apache.spark.ml.Pipeline.transformSchema(Pipeline.scala:180)
      at org.apache.spark.ml.PipelineStage.transformSchema(Pipeline.scala:70)
      at org.apache.spark.ml.Pipeline.fit(Pipeline.scala:132)
      at KNN$.main(KNN.scala:63)
      at KNN.main(KNN.scala)
  </code></pre>