Re: partition an empty RDD

2016-04-07 Thread Tenghuan He
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
>


Re: partition an empty RDD

2016-04-07 Thread Sean Owen
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

-
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org



partition an empty RDD

2016-04-06 Thread Tenghuan He
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