You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by VJ Anand <vj...@sankia.com> on 2015/10/18 15:39:14 UTC
No suitable Constructor found while compiling
I am trying to extend RDD in java, and when I call the parent constructor,
it gives the error: no suitable constructor found for RDD (SparkContext,
Seq, ClassTag<Object>).
Here is the snippet of the code:
class QueryShard extends RDD<Tuple> {
----
sc (sc, (Seq)new ArrayBuffer<Dependency<?>>,
ClassTag$.MODULE$.apply(Tuple.class);
}
Compiler error: no suitable constructor found for RDD (SparkContext, Seq,
ClassTag<Object>)
Any thoughts? pointers..
Thanks
VJ
Re: No suitable Constructor found while compiling
Posted by Ted Yu <yu...@gmail.com>.
I see two argument ctor. e.g.
/** Construct an RDD with just a one-to-one dependency on one parent */
def this(@transient oneParent: RDD[_]) =
this(oneParent.context , List(new OneToOneDependency(oneParent)))
Looks like Tuple in your code is T in the following:
abstract class RDD[T: ClassTag](
@transient private var _sc: SparkContext,
@transient private var deps: Seq[Dependency[_]]
FYI
On Sun, Oct 18, 2015 at 6:39 AM, VJ Anand <vj...@sankia.com> wrote:
> I am trying to extend RDD in java, and when I call the parent constructor,
> it gives the error: no suitable constructor found for RDD (SparkContext,
> Seq, ClassTag<Object>).
>
> Here is the snippet of the code:
>
> class QueryShard extends RDD<Tuple> {
>
> ----
>
> sc (sc, (Seq)new ArrayBuffer<Dependency<?>>,
> ClassTag$.MODULE$.apply(Tuple.class);
>
> }
>
> Compiler error: no suitable constructor found for RDD (SparkContext, Seq,
> ClassTag<Object>)
>
> Any thoughts? pointers..
>
> Thanks
> VJ
>
>
>