title: converting RDD containing BigInt to Spark Dataframe
body: <p>Hi I'm working in spark 1.6.3. I have an rdd which has some BigInt scala types in there. How would I convert that to a spark dataframe ? 
  Is it possible to cast the types before creating the dataframe ?</p>
  
  <p>My rdd:</p>
  
  <pre><code>Array[(BigInt, String, String, BigInt, BigInt, BigInt, BigInt, List[String])] = Array((14183197,Browse,3393626f-98e3-4973-8d38-6b2fb17454b5_27331247X28X6839X1506087469573,80161702,8702170626376335,59,527780275219,List(NavigationLevel, Session)), (14183197,Browse,3393626f-98e3-4973-8d38-6b2fb17454b5_27331247X28X6839X1506087469573,80161356,8702171157207449,72,527780278061,List(StartPlay, Action, Session)))
  </code></pre>
  
  <p>printed out:</p>
  
  <pre><code>(14183197,Browse,3393626f-98e3-4973-8d38-6b2fb17454b5_27331247X28X6839X1506087469573,80161356,8702171157207449,72,527780278061,List(StartPlay, Action, Session))
  (14183197,Browse,3393626f-98e3-4973-8d38-6b2fb17454b5_27331247X28X6839X1506087469573,80161702,8702170626376335,59,527780275219,List(NavigationLevel, Session))
  </code></pre>
  
  <p>I've tired to create a schema object; </p>
  
  <pre><code>  val schema = StructType(Array(
      StructField("trackId", LongType, true),
      StructField("location", StringType, true),
      StructField("listId", StringType, true),
      StructField("videoId", LongType, true),
      StructField("id", LongType, true),
      StructField("sequence", LongType, true),
      StructField("time", LongType, true),
      StructField("type", ArrayType(StringType), true)
    ))
  </code></pre>
  
  <p>if I try <code>val df = sqlContext.createDataFrame(rdd, schema)</code> I get this error </p>
  
  <pre><code>error: overloaded method value createDataFrame with alternatives:
    (data: java.util.List[_],beanClass: Class[_])org.apache.spark.sql.DataFrame &lt;and&gt;
    (rdd: org.apache.spark.api.java.JavaRDD[_],beanClass: Class[_])org.apache.spark.sql.DataFrame &lt;and&gt;
    (rdd: org.apache.spark.rdd.RDD[_],beanClass: Class[_])org.apache.spark.sql.DataFrame &lt;and&gt;
    (rows: java.util.List[org.apache.spark.sql.Row],schema: org.apache.spark.sql.types.StructType)org.apache.spark.sql.DataFrame &lt;and&gt;
    (rowRDD: org.apache.spark.api.java.JavaRDD[org.apache.spark.sql.Row],schema: org.apache.spark.sql.types.StructType)org.apache.spark.sql.DataFrame &lt;and&gt;
    (rowRDD: org.apache.spark.rdd.RDD[org.apache.spark.sql.Row],schema: org.apache.spark.sql.types.StructType)org.apache.spark.sql.DataFrame
   cannot be applied to (org.apache.spark.rdd.RDD[(BigInt, String, String, BigInt, BigInt, BigInt, BigInt, scala.collection.immutable.List[String])], org.apache.spark.sql.types.StructType)
  </code></pre>
  
  <p>Or if I try <code>val df = sc.parallelize(rdd.toSeq).toDF</code> I get the following error ;</p>
  
  <pre><code>error: value toSeq is not a member of org.apache.spark.rdd.RDD[(BigInt, String, String, BigInt, BigInt, BigInt, BigInt, List[String])]
  </code></pre>
  
  <p>Any help is appreciated </p>