我正在这样创建一个数据帧:
DF: DataFrame = df.sqlContext.createDataFrame(myTypeRDD, getMyTypeSchema())
MyType
是一种复杂的数据类型。
出于测试目的,我想将其用作MyType
集合。
我的尝试:
DF.as[MyType]
& DF.map(row => row.asInstanceOf[MyType]
给了:
找不到org.joda.time.DateTime
的编码器
DF.collect().asInstanceOf[MyType]
给了:
org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema无法转换为MyType
任何建议都将不胜感激