我有JavaRDD<Tuple2<Object, BSONObject>>
SparkContext sc = new SparkContext()
Configuration config = new Configuration();
config.set("mongo.input.uri","mongodb://localhost:27017:testDB.testCollection);
JavaRDD<Tuple2<Object, BSONObject>> mongoRDD = sc.newAPIHadoopRDD(config, MongoInputFormat.class, Object.class,
BSONObject.class).toJavaRDD();
如何将此mongoRDD
转换为DataFrame
,以便我可以在其上运行SQL查询?