val rdd: RDD[_] = ......
rdd.repartition(1).saveAsTextFile(path)
编译错误
error: type mismatch;
[ERROR] found : Ordering[(some other)_$1(in value rdd)]
[ERROR] required: Ordering[_$1(in value rdd)]
源代码
def repartition(numPartitions: Int)(implicit ord: Ordering[T] = null): RDD[T] = withScope {
coalesce(numPartitions, shuffle = true)
}
我用 T
为了对不同类型的rdd使用相同的函数,我应该怎么做?
暂无答案!
目前还没有任何答案,快来回答吧!