Following is how my code sequenced,
//Accumulator initialized
val count = new LongAccumulator
sparksession.sparkContext.register(count,"count accumulator")
// Streaming Transformation
val DF = fromKafkaDF.map{
count.add(1)
println(count.value) // This value is one
//some transformation
}.writeStream.outputMode("update").format("console").start()
//trying to access the value of accumulator from driver
println(count.value) //this value is zero
Why the value of accumulator is zero in driver? I have other logic to work on based on this accumulator. Please suggest.