title: How to fix: pyspark.sql.utils.IllegalArgumentException: incorrect type for Column features?
body: <p>I am new to pyspark and trying to run below simple codes.</p>
  
  <pre><code># create a RDD of LabeledPoint
  bcData = MLUtils.loadLibSVMFile(sc, "breast-cancer.txt")
  
  # convert it to DataFrame
  bcDataFrame = ss.createDataFrame(bcData)
  bcDataFrame.cache()
  
  # split the data
  (training_data, testing_data) = bcDataFrame.randomSplit([0.8, 0.2])
  
  # create the model
  dt_classifier = DecisionTreeClassifier(impurity="gini", maxDepth=2, labelCol="label", featuresCol="features")
  dt_model = dt_classifier.fit(training_data)
  </code></pre>
  
  <p>When running, I get the following error at the last line. </p>
  
  <blockquote>
    <p>pyspark.sql.utils.IllegalArgumentException: u'requirement failed: Column features must be of type struct&lt; type:tinyint,size:int,indices:array&lt; int >,values:array&lt; double >> but was actually struct&lt; type:tinyint,size:int,indices:array&lt; int >,values:array&lt; double >>.'</p>
  </blockquote>
  
  <p>I am not sure why I am getting this error when the actual type of the Column "features" matches the expected exactly.</p>