I asked this question to get to know how to increase the runtime call stack size in the JVM. I\'ve got an answer to this, and I\'ve also got many useful answers and comments
Add this option
--driver-java-options -Xss512m
to your spark-submit command will fix this issue.