Scala: How can I replace value in Dataframes using scala

Spark 1.6.2, Java code (sorry), this will change every instance of Tesla to S for the entire dataframe without passing through an RDD: dataframe.withColumn(“make”, when(col(“make”).equalTo(“Tesla”), “S”) .otherwise(col(“make”) ); Edited to add @marshall245 “otherwise” to ensure non-Tesla columns aren’t converted to NULL.

How to disable package and publish tasks for root aggregate module in multi-module build?

Instead of playing whac-a-mole by listing specific tasks to disable (publish, publish-local, publish-signed, etc), another option is to turn off artifact publishing at the source. publishArtifact := false Even though there’s no publishing happening, I also found I needed to supply a publishTo value to make sbt-pgp’s publish-signed task happy. It needs this value, even … Read more

In Scala; should I use the App trait?

The problem with the Application trait is actually described in its documentation: (1) Threaded code that references the object will block until static initialization is complete. However, because the entire execution of an object extending Application takes place during static initialization, concurrent code will always deadlock if it must synchronize with the enclosing object. This … Read more

How to restrict actor messages to specific types?

Then you’d have to encode the message type into the Actor ref, which would drastically decrease the value of something like the ActorRegistry. Also, with powerful mechanics like “become” (which is fundamental to the actor model) typing the messages is less valuable. Since Akka doesn’t leak memory when a message is not matched to the … Read more

Spray, Akka-http and Play, Which is the best bet for a new HTTP/REST project

Spray is production ready, but the development team (Mathias Doenitz) works for Typesafe on Akka-http now. The status of Akka-http is “development preview”. There are vague promises of a full release “within a few months”, but nothing you can take to the bank. Edited 29-July-2015: The status of Akka-HTTP is now “release candidate” with version … Read more