Thanks for your response Owen:)
Yes, I define K as ClassTag type and it works.
Sorry for bothering.

On Thu, Apr 7, 2016 at 4:07 PM, Sean Owen <so...@cloudera.com> wrote:

> It means pretty much what it says. Your code does not have runtime
> class info about K at this point in your code, and it is required.
>
> On Thu, Apr 7, 2016 at 5:52 AM, Tenghuan He <tenghua...@gmail.com> wrote:
> > Hi all,
> >
> > I want to create an empty rdd and partition it
> >
> > val  buffer: RDD[(K, (V, Int))] = base.context.emptyRDD[(K, (V,
> > Int))].partitionBy(new HashPartitioner(5))
> > but got Error: No ClassTag available for K
> >
> > scala needs at runtime to have information about K , but how to solve
> this?
> >
> > Thanks in advance.
> >
> > Tenghuan
>

Reply via email to