I hope there is an obvious answer to this question!
I've just upgraded to Spark v2.0 and have an odd problem with the spark-shell (Scala 2.11 build).
If I enter the following minimal Scala,
import java.sql.Timestamp case class Crime(caseNumber: String, date: Timestamp, description: String, detail: String, arrest: Boolean)
I get the following error,
<console>:11: error: not found: type Timestamp
If I use the Java Timestamp class elsewhere, e.g. in a function, then no errors are generated (as you would expect because of the import).
If I fully qualify and use java.sql.Timestamp in the case class it works!
Am I missing something obvious?
It's just that the Timestamp is not loaded in the case class declaration, to fix this you can:
:paste
import java.sql.Timestamp
case class Crime(caseNumber: String, date: Timestamp, description: String, detail: String, arrest: Boolean)
or
case class Crime(caseNumber: String, date: java.sql.Timestamp, description: String, detail: String, arrest: Boolean)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With