Top "Scala" questions

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

Join two ordinary RDDs with/without Spark SQL

I need to join two ordinary RDDs on one/more columns. Logically this operation is equivalent to the database join …

scala join apache-spark rdd apache-spark-sql
Why does "split" on an empty string return a non-empty array?

Split on an empty string returns an array of size 1 : scala> "".split(',') res1: Array[String] = Array("") Consider …

java scala
How do I detect if a Spark DataFrame has a column

When I create a DataFrame from a JSON file in Spark SQL, how can I tell if a given column …

scala apache-spark dataframe apache-spark-sql
How to get the current date without time in scala

I want to get the current date so I used: Calendar.getInstance().getTime() But as it .getTime() it is returning: …

scala date datetime calendar
Easy idiomatic way to define Ordering for a simple case class

I have a list of simple scala case class instances and I want to print them in predictable, lexicographical order …

scala sorting case-class
Write to multiple outputs by key Spark - one Spark job

How can you write to multiple outputs dependent on the key using Spark in a single Job. Related: Write to …

scala hadoop output hdfs apache-spark
Scala: What is a TypeTag and how do I use it?

All I know about TypeTags is that they somehow replaced Manifests. Information on the Internet is scarce and doesn't provide …

scala types scala-2.10 reification
How to do an instanceof check with Scala(Test)

I'm trying to incorporate ScalaTest into my Java project; replacing all JUnit tests with ScalaTests. At one point, I want …

java scala junit scalatest
Scala UTC timestamp in seconds since January 1st, 1970

How do I get the Scala UTC timestamp in seconds since January 1st, 1970?

scala timestamp utc
How to convert an Int to a String of a given length with leading zeros to align?

How can I convert an Int to a 7-character long String, so that 123 is turned into "0000123"?

string scala formatting int