spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Semenov <vadim.seme...@datadoghq.com>
Subject Re: get different results when debugging and running scala program
Date Sun, 02 Oct 2016 05:37:21 GMT
The question has no connection to spark.

In future, if you use apache mailing lists, use external services to add
screenshots and make sure that your code is formatted so other members'd be
able to read it.

On Fri, Sep 30, 2016 at 11:25 AM, chen yong <cy163@hotmail.com> wrote:

> Hello All,
>
>
>
> I am using IDEA 15.0.4 to debug a scala program. It is strange to me that
> the results were different when I debug or run the program. The differences
> can be seen in the attached filed run.jpg and debug.jpg. The code lines
> of the scala program are shown below.
>
>
> Thank you all
>
>
> -------
>
> import scala.collection.mutable.ArrayBuffer
>
> object TestCase1{
> def func(testtttt:Iterator[(Int,Long)]): Iterator[(Int,Long)]={
> println("in")
> val testtttt1=testtttt.flatmap{
> case(item,count)=>
> val newPrefix=item
> println(count)
> val a=Iterator.single((newPrefix,count))
> func(a)
> val c = a
> c
> }
> testtttt1
> }
> def main(args: Array[String]){
> val freqItems = ArrayBuffer((2,3L),(3,2L),(4,1L))
> val testtttt = freqItems.toIterator
> val result = func(testtttt)
> val reer = result.toArray
> }
> }
>
>
>
>

Mime
View raw message