You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by on 2015/07/06 23:11:15 UTC
How to create empty RDD
I need to return an empty RDD of type
val output: RDD[(DetailInputRecord, VISummary)]
This does not work
val output: RDD[(DetailInputRecord, VISummary)] = new RDD()
as RDD is abstract class.
How do i create empty RDD ?
--
Deepak
Re: How to create empty RDD
Posted by Richard Marscher <rm...@localytics.com>.
This should work
val output: RDD[(DetailInputRecord, VISummary)] =
sc.paralellize(Seq.empty[(DetailInputRecord, VISummary)])
On Mon, Jul 6, 2015 at 5:11 PM, ÐΞ€ρ@Ҝ (๏̯͡๏) <de...@gmail.com> wrote:
> I need to return an empty RDD of type
>
> val output: RDD[(DetailInputRecord, VISummary)]
>
>
>
> This does not work
>
> val output: RDD[(DetailInputRecord, VISummary)] = new RDD()
>
> as RDD is abstract class.
>
> How do i create empty RDD ?
> --
> Deepak
>
>
Re: How to create empty RDD
Posted by .
It worked Zhou.
On Mon, Jul 6, 2015 at 10:43 PM, Wei Zhou <zh...@gmail.com> wrote:
> I userd val output: RDD[(DetailInputRecord, VISummary)] = sc.emptyRDD[(DetailInputRecord,
> VISummary)] to create empty RDD before. Give it a try, it might work for
> you too.
>
> 2015-07-06 14:11 GMT-07:00 ÐΞ€ρ@Ҝ (๏̯͡๏) <de...@gmail.com>:
>
>> I need to return an empty RDD of type
>>
>> val output: RDD[(DetailInputRecord, VISummary)]
>>
>>
>>
>> This does not work
>>
>> val output: RDD[(DetailInputRecord, VISummary)] = new RDD()
>>
>> as RDD is abstract class.
>>
>> How do i create empty RDD ?
>> --
>> Deepak
>>
>>
>
--
Deepak
Re: How to create empty RDD
Posted by Wei Zhou <zh...@gmail.com>.
I userd val output: RDD[(DetailInputRecord, VISummary)] =
sc.emptyRDD[(DetailInputRecord,
VISummary)] to create empty RDD before. Give it a try, it might work for
you too.
2015-07-06 14:11 GMT-07:00 ÐΞ€ρ@Ҝ (๏̯͡๏) <de...@gmail.com>:
> I need to return an empty RDD of type
>
> val output: RDD[(DetailInputRecord, VISummary)]
>
>
>
> This does not work
>
> val output: RDD[(DetailInputRecord, VISummary)] = new RDD()
>
> as RDD is abstract class.
>
> How do i create empty RDD ?
> --
> Deepak
>
>