title: Pyspark ML pipeline error when fitting pipeline
body: <p>I have constructed a pipelined from three pyspark.ml.feature (tokenizer,CV,idf)  for the first time all thongs goes well but for the second try it tell me Py4JJavaError: An error occurred while calling o175.fit.
  Does any one know what is the cause of this error thanks</p>
  
  <pre><code>   import findspark
     findspark.init()
     import pyspark.sql.types as typ
     import pyspark as ps
     from pyspark.sql import SparkSession
     import pandas as pd
     import numpy as np
     import warnings
     from pyspark.sql import SQLContext
     sparkSession = SparkSession.builder \
         .master("local[2]") \
         .appName("Pyspark Sentiment") \
         .getOrCreate()
     df = sparkSession.read.load('data/Microblog_Trialdata.csv', 
                            format='com.databricks.spark.csv', 
                            header='true', 
                            inferSchema='true')
  df=df.select("sentiment score","spans")
  (train_set, val_set, test_set) = df.randomSplit([0.6, 0.2, 0.2], seed = 42)
  from pyspark.ml.feature import HashingTF, IDF, Tokenizer ,CountVectorizer
  from pyspark.ml.feature import StringIndexer
  from pyspark.ml import Pipeline
  
  tokenizer = Tokenizer(inputCol="spans", outputCol="words")
  CV = CountVectorizer(vocabSize=2**11, inputCol="words", outputCol='cv_')
  idf = IDF(inputCol='cv_', outputCol="features", minDocFreq=5) #minDocFreq: 
  
  remove sparse terms
  
  
  #model=CV.fit(data)
      #vo=model.vocabulary 
      #print(type(vo))
      pipeline = Pipeline(stages=[tokenizer, CV, idf])
  
      pipelineFit = pipeline.fit(train_set)
      train_df = pipelineFit.transform(train_set)
      val_df = pipelineFit.transform(val_set)
      train_df.select("cv_").show(5,truncate=False)
      train_df.show(5)
  </code></pre>