spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xuelin Cao <xuelincao2...@gmail.com>
Subject Re: How to create an empty RDD with a given type?
Date Tue, 13 Jan 2015 07:51:28 GMT
Got it, thanks!

On Tue, Jan 13, 2015 at 2:00 PM, Justin Yip <yipjustin@gmail.com> wrote:

> Xuelin,
>
> There is a function called emtpyRDD under spark context
> <http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.SparkContext>
which
> serves this purpose.
>
> Justin
>
> On Mon, Jan 12, 2015 at 9:50 PM, Xuelin Cao <xuelincao2014@gmail.com>
> wrote:
>
>>
>>
>> Hi,
>>
>>     I'd like to create a transform function, that convert RDD[String] to
>> RDD[Int]
>>
>>     Occasionally, the input RDD could be an empty RDD. I just want to
>> directly create an empty RDD[Int] if the input RDD is empty. And, I don't
>> want to return None as the result.
>>
>>     Is there an easy way to do that?
>>
>>
>>
>

Mime
View raw message