spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Pfeiffer <...@preferred.jp>
Subject Serializability: for vs. while loops
Date Thu, 15 Jan 2015 07:37:22 GMT
Hi,

sorry, I don't like questions about serializability myself, but still...

Can anyone give me a hint why

  for (i <- 0 to (maxId - 1)) {  ...  }

throws a NotSerializableException in the loop body while

  var i = 0
  while (i < maxId) {
    // same code as in the for loop
    i += 1
  }

works fine? I guess there is something fundamentally different in the way
Scala realizes for loops?

Thanks
Tobias

Mime
View raw message