-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Due to restrictions in Scala 2.10 that limit Case Classes to 22 parameters, I tried to create an explicit schema definition and pass it to the MongoRDD's toDF() method and received this error:
scala> val newTestType = StructType( | StructField("sentClaims", DoubleType, true):: | StructField("totalOrders", DoubleType, true):: | Nil | ) newTestType: org.apache.spark.sql.types.StructType = StructType(StructField(sentClaims,DoubleType,true), StructField(totalOrders,DoubleType,true)) scala> val simpleProgrammaticMongoDF = sqlContext.loadFromMongoDB().toDF[newTestType]() <console>:58: error: not found: type newTestType val simpleProgrammaticMongoDF = sqlContext.loadFromMongoDB().toDF[newTestType]()
Please provide a toDF(schema: StructType) method that will allow me to build and use schemas as needed.