Exception -
[Thread-3] ERROR scala_maven.ScalaCompileMojo - error: java.lang.StackOverflowError
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.collection.generic.TraversableForwarder$class.isEmpty(TraversableForwarder.scala:36)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.collection.mutable.ListBuffer.isEmpty(ListBuffer.scala:45)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.collection.mutable.ListBuffer.toList(ListBuffer.scala:306)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.collection.mutable.ListBuffer.result(ListBuffer.scala:300)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.collection.mutable.Stack$StackBuilder.result(Stack.scala:31)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.collection.mutable.Stack$StackBuilder.result(Stack.scala:27)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.collection.generic.GenericCompanion.apply(GenericCompanion.scala:50)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkDead$.<init>(TypeDiagnostics.scala:556)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.tools.nsc.typechecker.Typers$Typer.checkDead$lzycompute(Typers.scala:111)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.tools.nsc.typechecker.Typers$Typer.checkDead(Typers.scala:111)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:4812)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5344)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5360)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
[Thread-3] INFO scala_maven.ScalaCompileMojo - at
We realized that we had been calling withColumnRenamed () 256 times on the cluster that was leading to OOM. We tried setting -Xmx option for building Jar but it worked locally and not with Cloudbees Jenkins, may be because executor didn't had needed memory.
Solution -
- We broke down 256 withColumnRenamed () in to multiple steps such that -
- We could have also used .selectExpr() to reduce number of anonymous functions.
Comments
Post a Comment