title: Apache Spark type mismatch of the same type (String)
body: <p>EDIT: Answer:  <strong>It was a JAR file that created a conflict!</strong>
  The related post is: <a href="https://stackoverflow.com/questions/29375027/must-include-log4j-but-it-is-causing-errors-in-apache-spark-shell-how-to-avoid">Must include log4J, but it is causing errors in Apache Spark shell. How to avoid errors?</a></p>
  
  <p>Doing the following:</p>
  
  <pre><code>val numOfProcessors:Int = 2
  val filePath:java.lang.String = "s3n://somefile.csv"
  var rdd:org.apache.spark.rdd.RDD[java.lang.String] = sc.textFile(filePath, numOfProcessors)
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>    error: type mismatch;
   found   : org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.RDD[String]
   required: org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.RDD[String]
         var rdd:org.apache.spark.rdd.RDD[java.lang.String] = sc.textFile(filePath, numOfProcessors)
  </code></pre>
  
  <hr>
  
  <p>EDIT:  Second case</p>
  
  <pre><code>val numOfProcessors = 2
  val filePath = "s3n://somefile.csv"
  var rdd = sc.textFile(filePath, numOfProcessors) //OK!
  
  def doStuff(rdd: RDD[String]): RDD[String] = {rdd}
  
  doStuff(rdd)
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>error: type mismatch;
   found   : org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.RDD[String]
   required: org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.org.apache.spark.rdd.RDD[String]
                doStuff(rdd)
                        ^
  </code></pre>
  
  <p>No comment...  </p>
  
  <p>Any ideas why I get this error ?</p>