title: spark.createDataFrame creates a DF but df.collect.foreach(println) fails with RuntimeException
body: <p>Spark version: <code>Scala 2.12.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_211)</code></p>
  
  <p>In the following code, <code>spark.createDataFrame</code> creates a DF but the dataframe is useless (I can't print it or do anything with it).</p>
  
  <pre class="lang-scala prettyprint-override"><code>val fieldSeparator = '\u001D' // 1D = group separator; 21 = !; 7C = |;
  val recordSeparator = '\u001E' // 1E = record separator
  
  val myRDD = dataSet.toDF().rdd.take(10)
      .map(r =&gt; r.mkString(fieldSeparator.toString))
  val schema = new StructType()
      .add("displayname", StringType, true)
      .add("reputation", IntegerType, true)
      .add("numberOfPosts", LongType, true)
      .add("score", DoubleType, true)
  
  println("---------- Creating DF from RDD: --------------")
  val df = spark.createDataFrame(
      spark.sparkContext
           .parallelize(myRDD.map(r =&gt; r.split(fieldSeparator.toString)))
           .map(a =&gt; Row.fromSeq(a)),
      schema
  )
  println("---------- Successfully created DF from RDD (?) --------------")
  
  println(df.getClass) // this prints: class org.apache.spark.sql.Dataset
  df.printSchema()
  /*
     root
     |-- displayname: string (nullable = true)
     |-- reputation: integer (nullable = true)
     |-- numberOfPosts: long (nullable = true)
     |-- score: double (nullable = true)
  */
  myRDD.foreach(println) // prints all records correctly
  df.collect.foreach(println)
  // this fails with error: RuntimeException: java.lang.String is not a valid
  // external type for schema of int ???
  </code></pre>
  
  <p>The result should be same as <code>myRDD.foreach(println)</code> which works fine.</p>