You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Vadim Bichutskiy <va...@gmail.com> on 2015/04/08 22:08:06 UTC

Empty RDD?

When I call *transform* or *foreachRDD *on* DStream*, I keep getting an
error that I have an empty RDD, which make sense since my batch interval
maybe smaller than the rate at which new data are coming in. How to guard
against it?

Thanks,
Vadim
ᐧ

Re: Empty RDD?

Posted by Vadim Bichutskiy <va...@gmail.com>.
Thanks TD!



> On Apr 8, 2015, at 9:36 PM, Tathagata Das <td...@databricks.com> wrote:
> 
> Aah yes. The jsonRDD method needs to walk through the whole RDD to understand the schema, and does not work if there is not data in it. Making sure there is no data in it using take(1) should work. 
> 
> TD

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


Re: Empty RDD?

Posted by Tathagata Das <td...@databricks.com>.
Aah yes. The jsonRDD method needs to walk through the whole RDD to
understand the schema, and does not work if there is not data in it. Making
sure there is no data in it using take(1) should work.

TD

Re: Empty RDD?

Posted by Tathagata Das <ta...@gmail.com>.
What is the computation you are doing in the foreachRDD, that is throwing
the exception?
One way to guard against is to do a take(1) to see if you get back any
data. If there is none, then don't do anything with the RDD.

TD

On Wed, Apr 8, 2015 at 1:08 PM, Vadim Bichutskiy <vadim.bichutskiy@gmail.com
> wrote:

> When I call *transform* or *foreachRDD *on* DStream*, I keep getting an
> error that I have an empty RDD, which make sense since my batch interval
> maybe smaller than the rate at which new data are coming in. How to guard
> against it?
>
> Thanks,
> Vadim
> ᐧ
>