Top "Scala" questions

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

How to define partitioning of DataFrame?

I've started using Spark SQL and DataFrames in Spark 1.4.0. I'm wanting to define a custom partitioner on DataFrames, in Scala, …

scala apache-spark dataframe apache-spark-sql partitioning
Scala list concatenation, ::: vs ++

Is there any difference between ::: and ++ for concatenating lists in Scala? scala> List(1,2,3) ++ List(4,5) res0: List[Int] = List(1, 2, 3, 4, 5) scala&…

list scala concatenation
How to pattern match using regular expression in Scala?

I would like to be able to find a match between the first letter of a word, and one of …

regex scala
Joining Spark dataframes on the key

I have constructed two dataframes. How can we join multiple Spark dataframes ? For Example : PersonDf, ProfileDf with a common column …

scala apache-spark dataframe apache-spark-sql
How to create an empty DataFrame with a specified schema?

I want to create on DataFrame with a specified schema in Scala. I have tried to use JSON read (I …

scala apache-spark dataframe apache-spark-sql
How to write to a file in Scala?

For reading, there is the useful abstraction Source. How can I write lines to a text file?

scala file-io scala-2.8
What are all the uses of an underscore in Scala?

I've taken a look at the list of surveys taken on scala-lang.org and noticed a curious question: "Can you …

scala
Scala: what is the best way to append an element to an Array?

Say I have an Array[Int] like val array = Array( 1, 2, 3 ) Now I would like to append an element to the …

arrays scala append
Scala best way of turning a Collection into a Map-by-key?

If I have a collection c of type T and there is a property p on T (of type P, …

scala map scala-collections
Difference between a Seq and a List in Scala

I've seen in many examples that sometimes a Seq is being used, while other times is the List... Is there …

list scala collections seq