Top "Scala" questions

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

Is there a way to take the first 1000 rows of a Spark Dataframe?

I am using the randomSplitfunction to get a small amount of a dataframe to use in dev purposes and I …

scala apache-spark
What is the difference between a var and val definition in Scala?

What is the difference between a var and val definition in Scala and why does the language need both? Why …

scala
Preferred way to create a Scala list

There are several ways to construct an immutable list in Scala (see contrived example code below). You can use a …

scala
Spark : how to run spark file from spark shell

I am using CDH 5.2. I am able to use spark-shell to run the commands. How can I run the file(…

scala apache-spark cloudera-cdh cloudera-manager
How to model type-safe enum types?

Scala doesn't have type-safe enums like Java has. Given a set of related constants, what would be the best way …

scala enums
What does a lazy val do?

I noticed that Scala provide lazy vals. But I don't get what they do. scala> val x = 15 x: Int = 15 …

scala lazy-evaluation
Logging in Scala

What is a good way to do logging in a Scala application? Something that is consistent with the language philosophy, …

logging scala
What Scala web-frameworks are available?

I've just started learning Scala, and the first thing I'm going to implement is a tiny web application. I've been …

scala frameworks web-frameworks lift
What JSON library to use in Scala?

I need to build a JSON string, something like this: [ { 'id': 1, 'name': 'John'}, { 'id': 2, 'name': 'Dani'} ] val jArray = JsArray(); jArray += (("…

json scala
Can't push to the heroku

I was pushing the current git repository into the heroku. That online application was developed using Scala and IntelliJ. And …

git scala heroku intellij-idea