Spark Version : 1.3
I have a requirement where in I'm dealing with BigInteger type data. The Bean Class (Pojo) uses few BigInteger data-types. Parsing of the data and creating JavaRDD works fine, but when creating a dataframe which takes the JavaRDD and a BeanClass as a parameter,Spark throws below exception.
scala.MatchError: class java.math.BigInteger (of class java.lang.Class)
at org.apache.spark.sql.SQLContext$$anonfun$getSchema$1.apply(SQLContext.scala:1182)
at org.apache.spark.sql.SQLContext$$anonfun$getSchema$1.apply(SQLContext.scala:1181)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:108)
at org.apache.spark.sql.SQLContext.getSchema(SQLContext.scala:1181)
at org.apache.spark.sql.SQLContext.createDataFrame(SQLContext.scala:419)
at org.apache.spark.sql.SQLContext.createDataFrame(SQLContext.scala:447)
Using Spark-Shell I see that Scala is able to handle BigInt
scala> val x = BigInt("190753000000000000000");
x: scala.math.BigInt = 190753000000000000000
I'm not sure what is the reason for the Exception. Any help would be appreciated.