You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by Jacek Laskowski <ja...@japila.pl> on 2016/04/06 00:40:22 UTC

[STREAMING] DStreamClosureSuite.scala with { return; ssc.sparkContext.emptyRDD[Int] } Why?!

Hi,

In https://github.com/apache/spark/blob/master/streaming/src/test/scala/org/apache/spark/streaming/DStreamClosureSuite.scala#L190:

{ return; ssc.sparkContext.emptyRDD[Int] }

What is this return inside for? I don't understand the line and am
about to propose a change to remove it.

Pozdrawiam,
Jacek Laskowski
----
https://medium.com/@jaceklaskowski/
Mastering Apache Spark http://bit.ly/mastering-apache-spark
Follow me at https://twitter.com/jaceklaskowski

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


Re: [STREAMING] DStreamClosureSuite.scala with { return; ssc.sparkContext.emptyRDD[Int] } Why?!

Posted by Jacek Laskowski <ja...@japila.pl>.
Hi Ted,

Yeah, I saw the line, but forgot it's a test that may have been
testing that closures should not have return. More clear now. Thanks!

Pozdrawiam,
Jacek Laskowski
----
https://medium.com/@jaceklaskowski/
Mastering Apache Spark http://bit.ly/mastering-apache-spark
Follow me at https://twitter.com/jaceklaskowski


On Tue, Apr 5, 2016 at 6:47 PM, Ted Yu <yu...@gmail.com> wrote:
> The next line should give some clue:
>     expectCorrectException { ssc.transform(Seq(ds), transformF) }
>
> Closure shouldn't include return.
>
> On Tue, Apr 5, 2016 at 3:40 PM, Jacek Laskowski <ja...@japila.pl> wrote:
>>
>> Hi,
>>
>> In
>> https://github.com/apache/spark/blob/master/streaming/src/test/scala/org/apache/spark/streaming/DStreamClosureSuite.scala#L190:
>>
>> { return; ssc.sparkContext.emptyRDD[Int] }
>>
>> What is this return inside for? I don't understand the line and am
>> about to propose a change to remove it.
>>
>> Pozdrawiam,
>> Jacek Laskowski
>> ----
>> https://medium.com/@jaceklaskowski/
>> Mastering Apache Spark http://bit.ly/mastering-apache-spark
>> Follow me at https://twitter.com/jaceklaskowski
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
>> For additional commands, e-mail: dev-help@spark.apache.org
>>
>

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


Re: [STREAMING] DStreamClosureSuite.scala with { return; ssc.sparkContext.emptyRDD[Int] } Why?!

Posted by Ted Yu <yu...@gmail.com>.
The next line should give some clue:
    expectCorrectException { ssc.transform(Seq(ds), transformF) }

Closure shouldn't include return.

On Tue, Apr 5, 2016 at 3:40 PM, Jacek Laskowski <ja...@japila.pl> wrote:

> Hi,
>
> In
> https://github.com/apache/spark/blob/master/streaming/src/test/scala/org/apache/spark/streaming/DStreamClosureSuite.scala#L190
> :
>
> { return; ssc.sparkContext.emptyRDD[Int] }
>
> What is this return inside for? I don't understand the line and am
> about to propose a change to remove it.
>
> Pozdrawiam,
> Jacek Laskowski
> ----
> https://medium.com/@jaceklaskowski/
> Mastering Apache Spark http://bit.ly/mastering-apache-spark
> Follow me at https://twitter.com/jaceklaskowski
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
> For additional commands, e-mail: dev-help@spark.apache.org
>
>