Scala spark, listbuffer is empty
Apache Spark doesn’t provide shared memory therefore here: dataSet.foreach { e => items += e println(“len = ” + items.length) //1. here length is ok } you modify a local copy of items on a respective exectuor. The original items list defined on the driver is not modified. As a result this: items.foreach { x … Read more