Top "Scala" questions

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

Provide schema while reading csv file as a dataframe

I am trying to read a csv file into a dataframe. I know what the schema of my dataframe should …

scala apache-spark dataframe apache-spark-sql spark-csv
How do I skip a header from CSV files in Spark?

Suppose I give three files paths to a Spark context to read and each file has a schema in the …

scala csv apache-spark
What is the apply function in Scala?

I never understood it from the contrived unmarshalling and verbing nouns ( an AddTwo class has an apply that adds two!) …

scala
What is the syntax for adding an element to a scala.collection.mutable.Map?

What is the syntax for adding an element to a scala.collection.mutable.Map ? Here are some failed attempts: val …

scala map add mutable put
Which programming languages can be used to develop in Android?

Possible Duplicate: Which programming languages can I use on Android Dalvik? Mostly, Android applications are written in Java. But i …

java android scala programming-languages scripting
Is the Scala 2.8 collections library a case of "the longest suicide note in history"?

I have just started to look at the Scala collections library re-implementation which is coming in the imminent 2.8 release. Those …

scala scala-2.8 scala-collections
What do all of Scala's symbolic operators mean?

Scala syntax has a lot of symbols. Since these kinds of names are difficult to find using search engines, a …

scala operators
How to select the first row of each group?

I have a DataFrame generated as follow: df.groupBy($"Hour", $"Category") .agg(sum($"value") as "TotalValue") .sort($"Hour".asc, $"TotalValue".…

sql scala apache-spark dataframe apache-spark-sql
Scala: write string to file in one statement

For reading files in Scala, there is Source.fromFile("file.txt").mkString Is there an equivalent and concise way to …

scala scala-2.9
Case objects vs Enumerations in Scala

Are there any best-practice guidelines on when to use case classes (or case objects) vs extending Enumeration in Scala? They …

scala enumeration case-class