Reputation: 508
This code works in REPL but doesnt compile. I guess I am missing an implicit. But
people.select(when(people("gender") === "male", 0)
.when(people("gender") === "female", 1)
.otherwise(2))
Upvotes: 0
Views: 91
Reputation: 4471
In non-REPL code you should use the following import:
import org.apache.spark.sql.functions._
Upvotes: 2