Top "Scala" questions

Scala is a general-purpose programming language principally targeting the Java Virtual Machine.

Finding an item that matches predicate in Scala

I'm trying to search a scala collection for an item in a list that matches some predicate. I don't necessarily …

scala collections idioms
What is a sealed trait?

Sealed classes are described in 'Programming in Scala', but sealed traits are not. Where can I find more information about …

scala sealed traits
How to specify JVM maximum heap size "-Xmx" for running an application with "run" action in SBT?

My application does large data arrays processing and needs more memory than JVM gives by default. I know in Java …

scala sbt
Best way to merge two maps and sum the values of same key?

val map1 = Map(1 -> 9 , 2 -> 20) val map2 = Map(1 -> 100, 3 -> 300) I want to merge them, and …

scala map merge
Call by name vs call by value in Scala, clarification needed

As I understand it, in Scala, a function may be called either by-value or by-name For example, given the following …

scala
How to set heap size for sbt?

I am using SBT 0.12.0. I have read other answers on stack overflow and followed them, however none of them helps, …

scala sbt
How to get Scala List from Java List?

I have a Java API that returns a List like: public List<?> getByXPath(String xpathExpr) I am using …

java scala
(Why) do we need to call cache or persist on a RDD

When a resilient distributed dataset (RDD) is created from a text file or collection (or from another RDD), do we …

scala apache-spark rdd
How do I sort an array in Scala?

I can see there's a sorting object, Sorting, with a quicksort method, quickSort, on it. What would be a code …

sorting scala
aggregate function Count usage with groupBy in Spark

I'm trying to make multiple operations in one line of code in pySpark, and not sure if that's possible for …

java scala apache-spark pyspark apache-spark-sql